|
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|
|
hello again...
Have to create 4 or 5 online forms for a website I built for my local area of NA. I found a basic HTML Form template at w3schools; & used that for my first form:
https://www.burlingtoncountyna.org/gsr.report.html
So...when users finish & hit the Submit button, the form (& all included info) needs to go to our secretary's e-mail. I've read everything I can get my hands on regarding PHP, but for a beginner coder such as myself...informationals on the web never tell you precisely *take this snippet...customize it thusly; & place it here*...even the instructionals on w3schools are vague on this topic (for people such as myself). So...can someone take a look at that form page; & point me in the right direction, at least?
thanx
mark4man
|
|
|
|
|
Hi guys.
I have Debian 9 and Wine 5.16
I run "wine control" to add new certificate from pfx-file, but when i try to add pfx from certificate import wizard i receive message, that file format is not supported.
Where could the problem be?
Thank.
|
|
|
|
|
ArturNoubel wrote: i receive message, that file format is not supported.
Where could the problem be? Probably in the fact that the file format is not supported by the application you are using for the import.
|
|
|
|
|
Thank you, problem solved!
modified 4-Nov-20 8:13am.
|
|
|
|
|
Hello
I want the source code for a project
Solver of third-degree equations php
Hope you can help me
|
|
|
|
|
Member 14965627 wrote: Hope you can help me People here will help with code that you have written, but we will not do your work for you. If you are looking for samples or tutorials then www.google.com[^] is the place.
|
|
|
|
|
No. And don't you realize how rude it is to ask that?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
this page has an error when pressing the money button to consult, I have sql code but it is not working properly
https://i.stack.imgur.com/9AkC5.jpg[^]
sql code used:
SELECT
e.nomeEvento,p.nomecompl,c.nomecasa, COALESCE(l.observacao,'Sem informação') AS `observacao`, CONCAT('R$ ',REPLACE(REPLACE(REPLACE(FORMAT(IFNULL(l.valorExtornado, 0), 2), ".", "@"), ",", "."), "@", ",")) AS `valorExtornado`,
l.idpart, l.parcela, p.id AS idParticipante, DATE_FORMAT(l.datavcto, '%d/%m/%Y') AS `dataVcto`,
CONCAT('R$ ',REPLACE(REPLACE(REPLACE(FORMAT(l.valor, 2), ".", "@"), ",", "."), "@", ",")) AS `valorDevido`,
IF(l.datapgto IS NULL,'danger','success') AS `pagoCSS`,
IF(l.datapgto IS NULL,'Pendente','Pago') AS `pago`,
IFNULL(DATE_FORMAT(l.datapgto,'%d/%m/%Y'),'') AS `dataPgto`, CONCAT('R$ ',REPLACE(REPLACE(REPLACE(FORMAT(IFNULL(l.valorpago, 0), 2), ".", "@"), ",", "."), "@", ",")) AS `valorPago`,
(SELECT COUNT(1) FROM UF_financeiro_lctofinan WHERE id_eventos_participante=p.id AND fl_excluido='N') AS NUM_PARCELAS
FROM UF_financeiro_lctofinan AS l
LEFT JOIN UF_eventos_participantes AS p ON l.id_eventos_participante=p.id
LEFT JOIN UF_eventos AS e ON e.id_evento=p.id_evento
LEFT JOIN UF_casas AS c ON p.idcasainscr = c.idcasa
LIMIT 150 -- retirar esse LIMIT depois, isso é apenas para debugar
|
|
|
|
|
Hello, May I kindly ask for some help please. I have limited knowledge with html contact forms and validation by php. The form as it is works fine and validates fine. I would like to add a "file upload" field to the form, but can't quite work out what I need to add to the mail.php file. Please disregard some of the content responses, they are example questions only. Thank you very much.
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// access
$secretKey = '6LdhAK8UAAAAAD3Uaj5ILNiO5EPYPtDr2Wmr3sRO';
$captcha = $_POST['g-recaptcha-response'];
if(!$captcha){
echo '<p class="alert alert-warning">Please check the the captcha form.</p>';
exit;
}
# FIX: Replace this email with recipient email
$mail_to = "dixie7@xtra.co.nz";
# Sender Data
$subject = trim($_POST["subject"]);
$name = str_replace(array("\r","\n"),array(" "," ") , strip_tags(trim($_POST["name"])));
$email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL);
$phone = trim($_POST["phone"]);
$address1 = trim($_POST["address1"]);
$address2 = trim($_POST["address2"]);
$bandname = trim($_POST["bandname"]);
$urlfacebook = trim($_POST["urlfacebook"]);
$urlinstagram = trim($_POST["urlinstagram"]);
$datepicker = trim($_POST["datepicker"]);
$row1 = trim($_POST["row1"]);
$row2 = trim($_POST["row2"]);
$row3 = trim($_POST["row3"]);
$row4 = trim($_POST["row4"]);
$bandmembers = trim($_POST["bandmembers"]);
$concertpreference = trim($_POST["concertpreference"]);
$gender = trim($_POST["gender"]);
$venue = trim($_POST["venue"]);
$comment1 = trim($_POST["comment1"]);
$ideas = trim($_POST["ideas"]);
$comment2 = trim($_POST["comment2"]);
$lunch = trim($_POST["lunch"]);
$additional_options = implode(' | ', $_POST["afternoontea"]);
$footwear = trim($_POST["footwear"]);
$option = trim($_POST["dropdown"]);
$message = trim($_POST["message"]);
$contact = trim($_POST["contact"]);
if ( empty($name) OR !filter_var($email, FILTER_VALIDATE_EMAIL) OR empty($message)) {
# Set a 400 (bad request) response code and exit.
http_response_code(400);
echo '<p class="alert alert-warning">Please complete the form and try again.</p>';
exit;
}
$ip = $_SERVER['REMOTE_ADDR'];
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
$responseKeys = json_decode($response,true);
if(intval($responseKeys["success"]) !== 1) {
echo '<p class="alert alert-warning">Please check the the captcha form.</p>';
} else {
# Mail Content
$content = "Name: $name\n";
$content .= "Email: $email\n";
$content .= "Phone: $phone\n";
$content .= "Address 1: $address1\n";
$content .= "Address 2: $address2\n";
$content .= "Band Name: $bandname\n";
$content .= "Facebook Profile: $urlfacebook\n";
$content .= "Instagram Profile: $urlinstagram\n";
$content .= "Preferred Date: $datepicker\n";
$content .= "Snort Cocaine: $row1\n";
$content .= "Smoke Marijuana: $row2\n";
$content .= "Drink Bourbon: $row3\n";
$content .= "Smash Guitars: $row4\n";
$content .= "Band Members: $bandmembers\n";
$content .= "Concert Preference: $concertpreference\n";
$content .= "Gender: $gender\n";
$content .= "Venue: $venue\n";
$content .= "Venue Comments: $comment1\n";
$content .= "Ideas: $ideas\n";
$content .= "Ideas Comments: $comment2\n";
$content .= "Lunch: $lunch\n";
$content .= "Afternoon Tea: $additional_options\n";
$content .= "Footwear: $footwear\n";
$content .= "Option Selected: $option\n";
$content .= "Preferred Contact: $contact\n";
$content .= "Message: $message\n";
# email headers.
$headers = "From: $name <$email>";
# Send the email.
$success = mail($mail_to, $subject, $content, $headers);
if ($success) {
# Set a 200 (okay) response code.
http_response_code(200);
header('Location: https://www.mywebsitenz.com/test/thanks.html');
} else {
# Set a 500 (internal server error) response code.
http_response_code(500);
echo '<p class="alert alert-warning">Oops! Something went wrong, we couldnt send your message.</p>';
}
}
} else {
# Not a POST request, set a 403 (forbidden) response code.
http_response_code(403);
echo '<p class="alert alert-warning">There was a problem with your submission, please try again.</p>';
}
?>
|
|
|
|
|
|
That's excellent. Thanks so much for your kindness in helping. I will do just that. 
|
|
|
|
|
index.php
<pre><pre><!DOCTYPE html>
<html>
<head>
<title>PHP MySQL Insert Tutorial</title>
<script src='https://code.jquery.com/jquery-2.1.3.min.js'></script>
</head>
<body>
<form action='insert.php' method='post' id='myform' >
<p>
<input type='text' name='username' placeholder='user name' id='username' />
</p>
<p>
<input type='text' name='password' placeholder='password' id='password' />
</p>
<p>
<input id = "minus" type="text" name="main" value="<?php echo $num1; ?>" autocomplete="off">
</p>
<button id='insert'>Insert</button>
<p id='result'></p>
</form>
</body>
</html>
2nd.php
<pre><?php
session_start();
if(isset($_POST['Submit']))
{
$num_2 = "";
$pass_num = $_POST['main'];
}
?>
<h2>minus</h2>
<br>
<form method="post" action="index.php">
<input type="text" name="state" value="<?php echo $num_2;?>" autocomplete="off">
<br>
<input type="hidden" name="rrr" value="<?php echo $pass_num;?>" autocomplete="off">
<br>
<br>
<input nam
js
$('#myform').submit(function(){
return false;
});
$('#insert').click(function(){
$.post(
$('#myform').attr('action'),
$('#myform :input').serializeArray(),
function(result){
$('#result').php(result);
}
);
});
|
|
|
|
|
|
I had a feeling I had already seen it, but his homepage shows a Messages count of 0. I think counting and adding has gone a bit awry here: Bugs and Suggestions[^]
|
|
|
|
|
Hi everyone.
I am a complete novice and need help on some coding
I have a database with 2 tables.
one table is called income and in this table i have a column called IAMOUNT (this represents income amount)
the other table is called expense and in this table i have a column called EAMOUNT (this represents expense amount)
I want to subtract the expense from income to show a profit if any.
For example if IAMOUNT was lets say 100 and EAMOUNT was lets say 50 then profit would be 50.
However if IAMOUNT was lets say 100 and EAMOUNT was lets say 110 then profit would be -10
I need help with the code and how do i echo the result.
I have tried copying code from other questions on this but i just cant understand the coding to adapt it to my use.
help would be much appreciated.
Thanks
|
|
|
|
|
Something like:
SELECT SUM(i.IAMOUNT) - SUM(e.EAMOUNT) from income AS i, expenses AS e;
where income and expenses are the table names in the database.
|
|
|
|
|
Thanks Richard but how do i display the result in my webpage ?
|
|
|
|
|
That will depend on the design and implementation of your website.
|
|
|
|
|
Because the amounts are in different tables do i have to use join or inner join etc
|
|
|
|
|
It should work as I showed you; give it a try and see.
|
|
|
|
|
Hi, I am developing a Laravel app and I am trying to integrate PayPal subscriptions and I followed the instructions here and I've managed to create a product, create a plan, create a subscription and then redirect to PayPal for subscription approval, however, I can't find information on how to proceed in other words how to handle the response after PayPal redirects to my success link. I've looked at the "BASIC INTEGRATION" as well as the "FULL INTEGRATION" and the "REFERENCE" sections and can't find the information.
Any ideas where this information might be? Any tutorials, links with up-to-date info will be much appreciated.
|
|
|
|
|
i have query php like this
<?php
include('../config.php');
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
if(isset($_POST['pasar'])){
$code = $mysqli->real_escape_string($_POST['pasar']);
$queryPeriode = $mysqli->query("SELECT * FROM tb_periode WHERE code_pasaran = '".$code."' ORDER BY no DESC LIMIT 10");
$data = [];
while ($result = $queryPeriode->fetch_assoc()) {
$data[] = [
"periode" => $result['no'],
];
}
echo json_encode($data) ;
}
}
?>
my js code is like this
$("#pasaran").on('change',function(e) {
$("#periode").html("");
let code = $(this).val();
$.ajax({
method: "POST",
url: "?page=get_data_priode",
data: {pasar:code},
dataType: "json",
})
.done(function( data ) {
$.each( data, function( key, value ) {
$( "#periode" ).append("<option value="+value.periode+">"+value.periode+"</option>");
});
});
e.preventDefault();
});
the result is like this
[
0: {periode: "1521"}
1: {periode: "1520"}
2: {periode: "1519"}
3: {periode: "1518"}
4: {periode: "1517"}
5: {periode: "1516"}
6: {periode: "1515"}
7: {periode: "1514"}
8: {periode: "1513"}
9: {periode: "1512"}
]
but i want is the result after 1521 have result 1522 how can i do it? can someone teach me? how to do like that? me already tried to searching my quested in google but still no have answer
|
|
|
|
|
You need to pass the correct starting value to your SELECT clause, and get the returned values in ASCending order.
|
|
|
|
|
captan3899 wrote: $queryPeriode = $mysqli->query("SELECT * FROM tb_periode WHERE code_pasaran = '".$code."' ORDER BY no DESC LIMIT 10"); Don't do it like that!
Your code is vulnerable to SQL Injection[^]. NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
PHP: SQL Injection - Manual[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|