ibdrumin81
-
Posts
9 -
Joined
-
Last visited
Never
Posts posted by ibdrumin81
-
-
Correction, I figured it out. Thanks Again!
-
Alright now I read that article, and I apoligize for being a newbie to the PHP/MySQL thing but I would think that I would make it like this to assign that value to a variable. That is not working though. Any suggestions? Thanks!
$confirmation = "Thank You, $HisName and $HerName for your request to attend the Party on $PartyDate.
Your Reservation Number is $ResNumber. Please have this number available when arriving at the party.
Feel free to check our Guest List for other members attending the party on $PartyDate.
Can't wait to see you there!";
mail($to, $subject, $msg, "From: Form Submission\nReply-To: $EmailAddress\n");
mail($EmailAddress, $subject2, $confirmation, "From: Planet Pocono\nReply-To: $to\n");
mysql_query("INSERT INTO reservations (ReservationNumber, FirstParty, ProfileUsername, HisName, HerName, EmailAddress)
VALUES ('$ReservationNumber' , '$FirstParty' , '$ProfileUsername' , '$HisName' , '$HerName' , '$EmailAddress')");
$ResNumber = mysql_insert_id();
mysql_close($con)
?> -
I was wondering if anyone could enlighten me on how to retrieve the value of the last entry into the database. Specifically I want to get the auto_increment id value, place it in a variable value ($ResNumber), then use that variable value for an immediately generated confirmation email. Thanks in advance.
My php file uses these components:
<?php
$con = mysql_connect("host","user","pw");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
(Other Misc Stuff that all works fine)
$confirmation = "Thank You, $HisName and $HerName for your request to attend the Party on $PartyDate.
Your Reservation Number is $ResNumber. Please have this number available when arriving at the party.
Feel free to check our Guest List for other members attending the party on $PartyDate.
Can't wait to see you there!";
mail($to, $subject, $msg, "From: Form Submission\nReply-To: $EmailAddress\n");
mail($EmailAddress, $subject2, $confirmation, "From: Planet Pocono\nReply-To: $to\n");
mysql_query("INSERT INTO reservations (ReservationNumber, FirstParty, ProfileUsername, HisName, HerName, EmailAddress)
VALUES ('$ReservationNumber' , '$FirstParty' , '$ProfileUsername' , '$HisName' , '$HerName' , '$EmailAddress')");
mysql_close($con)
?> -
it looks like I was using PHP Version 4.4.4
Apparently I can use 5 as well by just renaming the PHP file with the extension .php5.
Should I do that or no?
I can't seem to find where I would change the setting for GlobalSettings. -
redarrow: I tried that method and now im not even getting any emails nor is my mysql database getting any entries. What is the reasoning behind using the method you mentioned? Sorry I was completely new at this about 5 days ago.
zero: I'm using this method to post my form:
loadVariablesNum ("form.php", 0, "POST");
I know the rest of the form is working correctly its all just basicaly validation and such.
Thanks for trying to help guys. -
I just found something on another forum about using a different method to define the form fields in the PHP file. I know with the original script I was using as a guide, users had left feedback saying that the fields need to be defined like the following to make the form work correctly, but I wasn't having a problem with just using the fields directly from the form.
i.e.
$field2= $_POST["field2"];
Could this possible have anything to do with it? -
The reason I have two mail() sets is because one of them gets sent as a confirmation to the end user who submits the form and the other gets sent to me so I have all of the data. Everything still works fine, both emails get sent, it is just for some reason the blank emails get sent an hour or so later for no reason at all.
And also I might add that the blank emails are only going to me not to the end user's email so it is only using the first of the two mail() sets when it sends the blank emails.
One more thing I just discovered. It looks like it is running the whole form.php file process when it is unsolicited. I have a blank entry in my database as well. Hope that helps. -
Hello,
I have recently delved into the world of PHP to avoid using the Bravenet Form Processing tool. Everything was working great, sending a confirmation email to the end user, sending an email to me with all of the submitted fields. Last night I finally figured out how to get the submitted fields in a mysql Database. The problem is that a few hours after someone submits the form I will receive about 10 emails that have nothing but the text labels I have added before each of the form fields to identify them. If it makes any difference this is coming from a form in Flash. As you can see from my example below, I am not entering all of the submitted fields into the database. Thanks in advance for any help anyone can give me.
Here is an example of my coded form.php file:
<?php
$con = mysql_connect("*****","*****","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("******", $con);
$to = "email@website.com";
$subject= "Reservation Request";
$subject2= "Your Reservation Request";
if ($field8=="No")
{
$msg= "Reservation Request Information
Party Date: $PartyDate
First Party: $FirstParty
Prev. Res. #: $ReservationNumber
His Name: $HisName
Her Name: $HerName
Email: $EmailAddress
Profile Name: $ProfileUsername
Profile Website: $ProfileWebsite
BlahBlahBlah
Guestlist: $AppearOnGuestList
Use Previous Pic: $UsePreviousPhoto
Comments: $Comments";
}
else
{
$msg= "Reservation Request Information
Party Date: $PartyDate
First Party: $FirstParty
Prev. Res. #: $ReservationNumber
His Name: $HisName
Her Name: $HerName
Email: $EmailAddress
Profile Name: $ProfileUsername
Profile Website: $ProfileWebsite
Guestlist: $AppearOnGuestList
Use Previous Pic: $UsePreviousPhoto
Comments: $Comments";
}
if ($FirstParty=="no")
{
$confirmation = "Thank You, $HisName and $HerName for your request to attend the Party on $PartyDate.
Feel free to check our Guest List for other members attending the party on $PartyDate.
Can't wait to see you there!";
}
else
{
$confirmation = "Thank You, $HisName and $HerName for your request to attend the Party on $PartyDate.
Since this is your first party, you will receive a Reservation Number in a few hours.
Feel free to check our Guest List for other members attending the party on $PartyDate.
Can't wait to see you there!";
}
mail($to, $subject, $msg, "From: Form Submission\nReply-To: $EmailAddress\n");
mail($EmailAddress, $subject2, $confirmation, "From: Form Submission\nReply-To: $to\n");
mysql_query("INSERT INTO reservations (ReservationNumber, FirstParty, ProfileUsername, HisName, HerName, EmailAddress)
VALUES ('$ReservationNumber' , '$FirstParty' , '$ProfileUsername' , '$HisName' , '$HerName' , '$EmailAddress')");
mysql_close($con);
?>
Problem with Receiving Unsubmitted Blank Emails from PHP
in PHP Coding Help
Posted
Thanks Again to all who tried to help!