473,385 Members | 1,357 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,385 software developers and data experts.

How to refer from one variable to hidden variable?

Hi All,

I have started with my php source code shown below, and how can I
refer from one var to hidden var?

----------------------------------------------------------------------------
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"));

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= "">

----------------------------------------------------------------------------

The "UserID" is generated by MySql with auto_increment.
UserID int(4) auto_increment primary key,


Assume that I want to add new user and the value for UserID is 5
(after auto increment). Then, I want HMID refer to UserID, the value
of HMID is also 5,
thats mean HMID = UserID, how can I do that? What is the command?
Thanks.
Best Regards,
Hau Jyn
Jul 17 '05 #1
0 1315

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 my php source code shown below --------------------------------------------------------- if ((isset($_POST)) && ($_POST == "form1")) { $insertSQL = sprintf("INSERT...
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>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.