chennaibala Posted September 23, 2009 Share Posted September 23, 2009 hi frds... <td width="25%" align="left" scope="col"><input id="regid" name="regid" type="hidden" size="10" value="<?php if (rehnum == null) { $reg1="abc000001"; echo "$reg1"; } else { $reg="art"; $reg1="$reg"."$regid"; echo "$reg1"; } ?> "></td> i used post method: $hiregid=$_POST["regid"]; i cannot get my hidden echo value while submit..how to get hidden value?thanks in advance Link to comment https://forums.phpfreaks.com/topic/175197-how-to-get-hidden-value/ Share on other sites More sharing options...
Bricktop Posted September 23, 2009 Share Posted September 23, 2009 Hi chennaibala, You get hidden form data via the $_GET['POST'] method in exactly the same way as normal data. I would suggest from your example that the problem is with your if/else statement. If you view the source of your page, is the hidden input field populated with a value? Link to comment https://forums.phpfreaks.com/topic/175197-how-to-get-hidden-value/#findComment-923388 Share on other sites More sharing options...
chennaibala Posted September 23, 2009 Author Share Posted September 23, 2009 <td width="25%" align="left" scope="col"><input id="regid" name="regid" type="text" size="10" value="<?php include 'db0.php'; $query="SELECT LPAD(MAX(SUBSTR(id,4))+1,6,0) as NextNum FROM registrater"; $result = mysql_query($query) or die ("Error in query: $query " . mysql_error()); $row = mysql_fetch_assoc($result); $num_results = mysql_num_rows($result); //echo "NextNum:".$row['NextNum']."end| "; if ($row['NextNum'] == null) { $reg1="abc000001"; echo "$reg1"; } else { $regid=$row['NextNum']; $reg="abc"; $reg1="$reg"."$regid"; echo "$reg1"; } ?> "></td> i used post method: $hiregid=$_POST["regid"]; above is my actual coding....i can get my echo value,when type ="text"...when i change to type ="hidden"..i get value as null.. thanks in advance Link to comment https://forums.phpfreaks.com/topic/175197-how-to-get-hidden-value/#findComment-923409 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.