Page 1 of 1

Inserting data in the database

Posted: Fri Oct 12, 2007 10:31 pm
by fastmike
Hi Guys,

Please i am in need of great help. I have an html form which have drop down menu, checkboxes, textfields, etc.. I have a php script also which does all the processing just one php file which takes the variables and then insert it in the database. I have 2 buttons in my form reset and submit. for some reason after entring all the fields and clicking on submit i recieve a blank page. When i check my database nothing is updated. whats the problem? I have a php file which includes 2 more files header and footer files. and i am using this action attribue

Code: Select all

<body>
<form action="http://localhost/login1.php" method = "post" >
.
.
.
<input type = "reset">
	<input type = "SUBMIT">
Please tell me if i am doing the right thing. I am using easy php and both of my html files and php file is in www folder. why is it not updating the database? The file is huge thats why i am not posting.

Posted: Sat Oct 13, 2007 1:11 am
by feyd
It's impossible for us to say what's wrong without seeing your code. I would suspect your code looks for a submit button where there is none to be found. Your buttons don't have names.

Posted: Sat Oct 13, 2007 11:27 am
by fastmike
ok. Thank God i got everything working. But now i got another problem. I can't send the email can you please tell me whats wrong?

Code: Select all

$pfw_header = "From: abc@gmail.com\n"
  . "Reply-To: abc@gmail.com\n";
$pfw_subject = "Entry in the database";
$pfw_email_to = "cateyesmale@yahoo.com";
$pfw_message = "Visitor's IP: $pfw_ip\n"
. "firstname: $firstname\n"
. "middlename: $middlename\n"
. "lastname: $lastname\n"
. "unit: $unit\n"
. "region: $region\n"
. "dept: $dept\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
I dont see any mail at all. Is this the right way to do it?

Posted: Sun Oct 14, 2007 6:36 am
by feyd
If memory serves, it's supposed to be \r\n instead of \n in the headers.

I don't know if that will fix the issue or not, but I cannot recommend Swift Mailer enough.. so I think you should look into using it instead of attempting to create the email directly.