swatisonee Posted November 14, 2006 Share Posted November 14, 2006 I feel silly even putting this post up but am at my wits end. Have done loads of this kind of scripting but all of a sudden, a hidden field value is not getting passed into the next script.Php 1 snippet[code]$sql1="select max(CID) from `Customers`"; $result1 = mysql_query($sql1) or die (mysql_error()); $myrow = mysql_fetch_row($result1); $cid = $myrow[0]; echo "<b>Information entered</b>"; ?> // needed as its part of a code.<input type="hidden" name="cid" value="<? echo $cid ?>"> // WORKS CORRECTLY Click to enter the <?php echo "<a href=\"add_custadd1.php?cid=$cid&userid=$userid\">"; ?> address </a>[/code]Php 2 snippet[code]<? include("protect.php"); ?> // db info<?$cid = $_POST["cid"]; // NOT REFLECTING although the value of $cid shows up in the address barecho $cid;?>[/code] Quote Link to comment Share on other sites More sharing options...
CheesierAngel Posted November 14, 2006 Share Posted November 14, 2006 If the value appears in the adress bar you are probably using as form action GET en not POST.You can easely check this by using (temporarly):[code]<?php$cid = $_REQUEST["cid"];echo $cid;?>[/code]Really sure you didn't make any typo faults ? Quote Link to comment Share on other sites More sharing options...
swatisonee Posted November 14, 2006 Author Share Posted November 14, 2006 That is so odd. Yes the value did come up but i dont get it . i have been using POST all this while with nary a problem and now this ? I use ver. 4.0 of php fwiw but i am so puzzled by this. Thanks though for that tip though i still wonder why !! Quote Link to comment Share on other sites More sharing options...
dk4210 Posted November 15, 2006 Share Posted November 15, 2006 Hey usually $_Get works for me$cid = $_GET['cid'];echo $cidWorks for me... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.