hmpft, this day started out so well and now i feel so dumb :mad: ... sorry to pest you guys with this again ... i have no clue why, but i simply can not get this to work ...
- "index_scr.php" - here i calculate my user id (uid) and pass it on to the next page using:
header ("Location: ../setup_b.php?uid=$newid");
- on "setup_b.php" the user id shows up in the address bar. now i try to get it from there into a hidden form field like so:
<input type="hidden" name="uid" value="<?php echo $_REQUEST['uid']; ?>">
- the form action on "setup_b.php" calls the next script, "setup_b_scr.php" where i need "$uid" to open the flat text file with the composite name "user_"."$uid"."txt" to write the info from the "setup_b.php" form into the text file. so far i tried to get the hidden field "uid" from above like this
<?php
//part 1 - open "user_$uid.txt" file and append personal info, close file
//
$_GET['uid'];
$filename = "../user_results/user_$uid.txt";
$handle = fopen ($filename, "a+");
fwrite ($handle, "$name"."\n"."$company"."\n"."$position"."\n"."$email"."\n"."$url"."\n"."\n");
fclose ($handle);
//
//part 2 - forward user to next page, include user id ($uid)
//
header ("Location: ../survey01.php?uid=$uid");
?>
- from the script "setup_b_scr.php" i then need to forward "uid" through a few more "loops" like the one above so i can keep opening the flat text file for that user and write info to it ... it's basically a continous
form->script->form->script->form-> etc. loop
the problem is that as soon as i submit info from the form in "setup_b.php" (step 2 -> step 3), the user id seems to get lost ... my script "setup_b_scr.php" instead of creating the proper composite file name (e.g., "user_12.txt") and opening that file, creates an empty file "user_.txt" and writes the info in there ... :mad: (i hate being stupid) .. . so, my guess is that the user id never makes it from the address bar to the hidden form field in "setup_b.php" to the script "setup_b_scr.php"
can you guys maybe see what i'm doing wrong? i'm totally lost here ...
thanks + cheers 🙂 ,
kubik