seany123 Posted January 25, 2010 Author Share Posted January 25, 2010 As i said, You didn't pass anything in the URL.. add ?ref=10 to it! for that form to process you need to POST the form BUT the form is NOT passing the get <form method="POST" action="register.php"> for example try <form method="POST" action="register.php?ref=10"> ooh i see BUT the problem is i want to allow my players to use it as a Refferal link... so they can type ref= whatever they id is. Link to comment https://forums.phpfreaks.com/topic/189633-why-wont-this-echo/page/2/#findComment-1001013 Share on other sites More sharing options...
MadTechie Posted January 25, 2010 Share Posted January 25, 2010 Okay, change it to a POST and add the input to the form (could be hidden) ie <INPUT type="hidden" value="<?php $_GET['ref']?>"> OR leave as GET <form method="POST" action="register.php?ref=<?php $_GET['ref']?>"> (personally i'll use the hidden field) other options are sessions, cookies Link to comment https://forums.phpfreaks.com/topic/189633-why-wont-this-echo/page/2/#findComment-1001018 Share on other sites More sharing options...
seany123 Posted January 25, 2010 Author Share Posted January 25, 2010 okay so what i have done is this added this just below the <form method='POST' action='register.php'> i added this: <input type="hidden" value="<?php $_GET['ref']?>" name="refid"> then where the query is i added: if($_POST['ref'] >= 1) { $ref_id = $_POST['refid']; $insert['ref'] = $ref_id; } now that should work right? EDIT: it didnt work Link to comment https://forums.phpfreaks.com/topic/189633-why-wont-this-echo/page/2/#findComment-1001024 Share on other sites More sharing options...
MadTechie Posted January 25, 2010 Share Posted January 25, 2010 Not quite if($_POST['ref'] >= 1) should be if($_POST['refid'] >= 1) Link to comment https://forums.phpfreaks.com/topic/189633-why-wont-this-echo/page/2/#findComment-1001027 Share on other sites More sharing options...
seany123 Posted January 25, 2010 Author Share Posted January 25, 2010 Not quite if($_POST['ref'] >= 1) should be if($_POST['refid'] >= 1) that still hasn't worked omg lol if($_POST['refid'] >= 1) { $ref_id = $_POST['refid']; $insert['ref'] = $ref_id; } echo $insert['ref']; also $insert['ref'] isnt echoing. Link to comment https://forums.phpfreaks.com/topic/189633-why-wont-this-echo/page/2/#findComment-1001031 Share on other sites More sharing options...
MadTechie Posted January 25, 2010 Share Posted January 25, 2010 change <input type="hidden" value="<?php $_GET['ref']?>" name="refid"> to <input type="text" value="<?php $_GET['ref']?>" name="refid"> and check the value is in their if it is then do a print_r($_POST); Link to comment https://forums.phpfreaks.com/topic/189633-why-wont-this-echo/page/2/#findComment-1001034 Share on other sites More sharing options...
seany123 Posted January 25, 2010 Author Share Posted January 25, 2010 its not there! thats weird i now changed it to: <input type="text" value="<?=$_GET['ref'];?>" name="refid"> and it appears but surely short tags are not the way forward lol! Link to comment https://forums.phpfreaks.com/topic/189633-why-wont-this-echo/page/2/#findComment-1001035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.