PHP
- Started
- Last post
- 16 Responses
- cosmo
When I do a 'print_r ($_session)' the values in the session variable is not displayed? Is there a way I can register the $_POST values in a session?
My code:
foreach( $_POST as $key => $v) {
$_SESSION['new'] = $_POST['v'];
}
print_r($_POST);
print_r($_SESSION);
- cosmo0
anyone?
- ikbenvanrijn0
i asume your not using mysql?
- cosmo0
nope.
- ikbenvanrijn0
ok. then why not run the session_id(); through the url?
- cosmo0
could you show an example please.
- cosmo0
ok, that helps a little.
- enobrev0
$_SESSION = $_POST
- enobrev0
and don't forget t ostart your session with session_start()
example file 1
post2session.php
-----------------Test 1 <input type="text" name="test" size="40" value="" />
Test 2 <input type="text" name="test2" size="40" value="" />Next
------------------
example file 2
post2session2.php
-------------------Form
-----------------
Try it out. Worked fine here.
- enobrev0
wow. . thw for mfields showed... nevcer saw that here before.
email me and i'll send you the example
- tfs__mag0
omg.. you're gonna get flagged for "altering the apppearance of newstoday". I did once for making my name pink.
- cosmo0
enobrev. what's your email? The one NT doesn't work.
- cosmo0
enobrev. what's your email? The one NT doesn't work.
- enobrev0
just fixed my nt one, give it one more shot.
- cosmo0
done!
- enobrev0
replied!