timothyltaylor Posted December 11, 2006 Share Posted December 11, 2006 I realize this is very common, especially when starting and stopping a session(). I'm not using those commands here, and still have a problem with the error:"Warning: Cannot modify header information - headers already sent by (output started at /xxxxxx/xxxxxxx/xxxxxxxxxx-www/xxxxxxx/process.php:83) in /xxxxxxx/xxxxxxx/xxxxxxxxx-www/xxxxxxx/process.php on line 123"Here's my code:[code] $send = mail("myname@mysite.com", "EPSA CAP2 Evaluation Results from $name", $body, "Content-type: text/html"); $send2 = mail('$email', "Your EPSA CAP2 Evaluation Results:", $body, "Content-type: text/html"); if($send) header ("Location: xxxxxxxxx.com=1"); else print "We encountered an error sending your mail, please notify myname@mysite.com";?>[/code]Can someone give any suggestions?Thank you! Lee T. Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted December 11, 2006 Share Posted December 11, 2006 You can make php ignore this error with:[code]<?php ob_start();?>[/code] Quote Link to comment Share on other sites More sharing options...
timothyltaylor Posted December 11, 2006 Author Share Posted December 11, 2006 Thanks. That's a big help. Do I need to add an:[code]ob_start();[/code] at the end?Also,1) How do I hide the url (with the user's password and username) in a php script?ALSO2) How do I carry user's (form) input records to another page, without grabbing them from the database? BECAUSE a) if I grabbed them from the database, I'd have to use the session_start () and session_stop () and I'd rather not Thanks! Lee T. Quote Link to comment Share on other sites More sharing options...
wattsup88 Posted December 12, 2006 Share Posted December 12, 2006 I'm no expert, but you could use hidden inputs and the superglobal $_POST and try it that way... thats how i do it... you shoulnd't have to go through your database Quote Link to comment Share on other sites More sharing options...
timothyltaylor Posted December 12, 2006 Author Share Posted December 12, 2006 What if different users/different computers are accesing the form at the same time? Will each user's information be kept and displayed on a "results.php" page where the records are to be displayed in?For instanceI want 1 user to store his name in the database. He fills it out, and then I grab that specific name to display it onto another page in a certificate. If I try and use the superglobal, $_Post, will it be able to grab his specific name - EVEN when other user's are accessing the same form from different computers? Or will the "saved" records get mixed up between users? thanks for helping, Lee Quote Link to comment Share on other sites More sharing options...
wattsup88 Posted December 12, 2006 Share Posted December 12, 2006 hmmm... I personally don't know i dont have a high traffic rate on my site... I don't see why there would be a problem tho... Why would php be designed that way especially since so many people use $_POST superglobal to display form results and such... Quote Link to comment Share on other sites More sharing options...
timothyltaylor Posted December 12, 2006 Author Share Posted December 12, 2006 Good call. So, say that I'm receiving the user's name through form input. The field input on the form is named "name".I define it as : $name=$_POST['name']; in my "process.php file"I can then go to a separate file named "results.php" and use: $name=$_POST['name'];Then I can use the following code to display/use that same input value?:[code]...echo " <p align=\"center\">This certificate is presented to</p>\n";echo " <p align=\"center\">$name</p>\n"; ...[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.