Topic awaiting preservation: Need Idea on how to begin using Session in PHP. (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: |
posted 10-04-2004 17:59
T.W.I.M.C, |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 10-04-2004 18:52
Basic PHP Session Tutorial |
Nervous Wreck (II) Inmate From: |
posted 10-05-2004 10:59
Prime, quote:
quote:
|
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 10-05-2004 13:08
Well... Parses errors occur when the parser can't make sense of something anymore. |
Nervous Wreck (II) Inmate From: |
posted 10-05-2004 16:14
I coppied, pasted and executed the code below: code: <html>
quote:
code: print "<form method="post" enctype="multipart/form-data" action="{$_SERVER['PHP_SELF']}">";
code: print '<form method="post" enctype="multipart/form-data" action="{$_SERVER['PHP_SELF']}">';
code: {$_SERVER['PHP_SELF']}
quote:
|
Paranoid (IV) Inmate From: France |
posted 10-05-2004 16:30
code: //this must be before any printing is being done, inside or outside of the php tags. It means that the session_start(); statement MUST be before any output. And in your script there is a lot of output before that statement : code: <html> |
Nervous Wreck (II) Inmate From: |
posted 10-05-2004 16:44
Tthink i was just too anxoius to see my result that i did not get the time to read all instruction! its done now! code: action="{$_SERVER['PHP_SELF']}"
quote:
|
Paranoid (IV) Inmate From: France |
posted 10-05-2004 17:45
Fikzy: Since you're at it, you should re-read the manual about the print function. You also have some problems with quotes escaping. For instance : code: print "<form method="post" enctype="multipart/form-data" action="{$_SERVER['PHP_SELF']}">"; should be code: print "<form method=\"post\" enctype=\"multipart/form-data\" action=\"{$_SERVER['PHP_SELF']}\">"; and the problem in code: print '<form method="post" enctype="multipart/form-data" action="{$_SERVER['PHP_SELF']}">'; is that in a string surrounded by single quotes the characters are output(ed) as is. Thus {$_SERVER['PHP_SELF']} is not interpreted and the single quotes in it are f**ing up the string. So long, to avoid that kind of problems you'd better simply use string concatenation and voilà: code: echo '<form method="post" enctype="multipart/form-data" action="'. $_SERVER['PHP_SELF'] .'">'; You can use echo or print. That's, in 99% of the cases, just a matter of choice. |
Nervous Wreck (II) Inmate From: |
posted 10-05-2004 18:07
Thanks, |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 10-05-2004 18:25
in theory. I wouldn't bet on it. |
Paranoid (IV) Inmate From: France |
posted 10-05-2004 18:26
"if i do not specify an action for my form in php, the form redirects to itself right ?" code: <!ATTLIST FORM |
Nervous Wreck (II) Inmate From: |
posted 10-05-2004 18:50
Great! so i'll just use code: $_SERVER['PHP_SELF'] any time i want to "redirect here again". |
Nervous Wreck (II) Inmate From: |
posted 10-05-2004 18:51
Great! so i'll just use code: $_SERVER['PHP_SELF'] any time i want to "redirect here again". |
Paranoid (IV) Inmate From: France |
posted 10-05-2004 19:53 |
Nervous Wreck (II) Inmate From: |
posted 10-05-2004 19:57
that i'll do! |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 10-05-2004 20:10
yeah, read the HTTP RFC if you really wanna now. |