Jump to content

Suddenly: Value not getting passed from a hidden field


swatisonee

Recommended Posts

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 bar

echo $cid;
?>[/code]

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 ?
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 !!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.