473,408 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How can I refer from one variable to hidden variable?

Hi All,

I have started my php source code shown below

---------------------------------------------------------
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1"))
{
$insertSQL = sprintf("INSERT INTO users (UserID, UserName, Password)
VALUES (%s, %s, %s)",
GetSQLValueString($_POST['UserID'], "int"),
GetSQLValueString($_POST['UserName'], "text"),
GetSQLValueString($_POST['Password'], "text"));

mysql_select_db($database_SHHConnection, $SHHConnection);
$Result1 = mysql_query($insertSQL, $SHHConnection) or
die(mysql_error());
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1"))
{
$insertSQL = sprintf("INSERT INTO holidaymaker (HMID, Name, Status)
VALUES (%s, %s, %s)",
GetSQLValueString($_POST['HMID'], "int"),
GetSQLValueString($_POST['Name'], "text"),
GetSQLValueString($_POST['Status'], "text"));
$HMID = $_POST['users.UserID'];
mysql_select_db($database_SHHConnection, $SHHConnection);
$Result1 = mysql_query($insertSQL, $SHHConnection) or
die(mysql_error());
}

<input type="hidden" name="UserID" value="">
<input type="hidden" name="HMID" value= "Users.UserID">
---------------------------------------------------------

The value for "UserID" is auto_increment by MySql
UserID int(4) auto_increment primary key,


Assume that I want to add new user, the value auto increment for
UserID is 5, I want HMID to be 5 too, which mean HMID refer to UserID.
How can I do that?

Thanks.
Best Regards,
Hjyn
Jul 17 '05 #1
0 1392

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hjyn | last post by:
Hi All, I have started with my php source code shown below, and how can I refer from one var to hidden var? ---------------------------------------------------------------------------- if...
6
by: Hansan | last post by:
Hi all. I am working on a webpage where I use python and html. When I want to send one variable to a new script/page I use the following code: 0) print '''<input type=hidden name="eventid"...
6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
3
by: Geoff Winsor | last post by:
Hi, I am experiencing a problem with recalling a session variable which stores whether a person is logged in to a "members only" section of a website. This area of the site has been working...
10
by: Frank Rizzo | last post by:
Ok, this is probably so simple... Anyway, I'd like to pass a value in the hidden variable. I have code like this: <form...> <input type="Hidden" name="zzz" value="1"> ... </form> I want...
3
by: TheNedMan | last post by:
Sorry for the repost, but I want to get to the bottom of this... From the Microsoft sample "How-To Create an Offline Application": Public Delegate Sub CustomersRowChangeEventHandler(ByVal...
19
by: k.karthikit | last post by:
Hello all, In some hidden variable (<input type="hidden" name="hiddenId" value="test" /> ,i stored some value.I accessed the value "test" using var id = document.getElementById( 'hiddenId' );...
6
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why doesn't the global variable "divId" always refer to the element with id="divId"?...
4
by: sgogula | last post by:
Hi, Could someone help me how to access a JSP hidden variable in Java Script? Here is my code: <script type="text/javascript"> var mnuItems = hdnItem] </script>
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.