Inserting data in the database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fastmike
Forum Commoner
Posts: 32
Joined: Wed Jan 24, 2007 12:52 am

Inserting data in the database

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
fastmike
Forum Commoner
Posts: 32
Joined: Wed Jan 24, 2007 12:52 am

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply