Jump to content

PHP Header Error:


timothyltaylor

Recommended Posts

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.
Link to comment
Share on other sites

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?

ALSO

2) 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.
     
Link to comment
Share on other sites

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 instance
I 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
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.