473,397 Members | 2,033 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,397 software developers and data experts.

href passing values to php script

10
I am trying to create a hyperlink that also passes a value to the destination php
page? I think the syntax is correct. The value contained in the $id_num variable does not appear in the called PHP script. Below is a sample of the code.

Thanks for your help.
Fred

Code from calling PHP script
[php]
<table width="700" border="0" align="center">
<tr>
<td width="30%" nowrap><A class=blue href="http://cc010.admin.esu.edu:12345/test/idnumtest.php?id_num=$idnum&amp;"><?php echo "<font style='font-family: ariel; font-size: 16px;'>" . $fn . ' ' . $mn . ' ' . $ln . "</font>" ?></a></td>
</tr>
</table>[/php]

Code from php script
[php]
<?php

// GET $id_num from Enter_Faculty_Info script
$id_num = $_GET['id_num'];
print "\n id_num = $idnum\n\n";
?>[/php]
Feb 16 '07 #1
3 3232
ronverdonk
4,258 Expert 4TB
Since the following statement is not generated by PHP but just plain HTML, you must enclose any PHP variable that you want to pass on within the php tags, just like you do with the echo of the style. So you must <?php echo $idnum; ?> it.

[php]<td width="30%" nowrap><A class=blue href="http://cc010.admin.esu.edu:12345/test/idnumtest.php?id_num=$idnum&amp;"><?php echo "<font style='font-family: ariel; font-size: 16px;'>" . $fn . ' ' . $mn . ' ' . $ln . "</font>" ?></a></td>[/php]

Ronald :cool:
Feb 16 '07 #2
fredb
10
Since the following statement is not generated by PHP but just plain HTML, you must enclose any PHP variable that you want to pass on within the php tags, just like you do with the echo of the style. So you must <?php echo $idnum; ?> it.

[php]<td width="30%" nowrap><A class=blue href="http://cc010.admin.esu.edu:12345/test/idnumtest.php?id_num=$idnum&amp;"><?php echo "<font style='font-family: ariel; font-size: 16px;'>" . $fn . ' ' . $mn . ' ' . $ln . "</font>" ?></a></td>[/php]

Ronald :cool:
Thank you for your reply. I did as you suggested and modified how I am referencing $idnum:

<td width="30%" nowrap><A class=blue href="http://cc010.admin.esu.edu:12345/test/idnumtest.php?id_num=<?php echo $idnum; ?>"><?php echo "<font style='font-family: ariel; font-size: 16px;'>" . $fn . ' ' . $mn . ' ' . $ln . "</font>" ?></a></td>

The problem is now resolved. Thank you very much for your help.

Fred
Feb 16 '07 #3
ronverdonk
4,258 Expert 4TB
You are welcome any time.

Ronald :cool:
Feb 16 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: rick | last post by:
Does anyone having a working example of passing values between web forms pages? I tried the example in the ms- help but I can't get by the following: To read property values from the source...
2
by: Jim Heavey | last post by:
I know that I can create session variables and pass those values from one screen to another, but is there not a way to makes variables from one scree n available to another screen other then...
2
by: VS_NET_DEV | last post by:
Hi All, There two ways of passing values between pages - 1) Context.Items.Add 2) Context.Handler (cast the page1 class etc) I know for sure #2 does not store the values between requests. How...
1
by: olduncleamos | last post by:
Hello all. With a background in ASP, I am finding the work required for passing values between pages mystifying. For various obvious reasons, I have eliminated using cookies and session to store...
2
by: Ganesh | last post by:
Hi there, I'm new to .net just started with 2005 and asp.net 2.0, I'm passing control values to other page to retrieve the data from data set based on the passing values. It works fine. But when...
1
by: Steve | last post by:
After a few hours of trial and error I have reached the following conclusions, can you please tell me if I am right: I have 2 aspx pages both with the same master page and I wish to pass values...
2
by: johnj | last post by:
I am converting an application I wrote in VB.NET to C#. I am not a C# guy, at all. I am having a problem passing values to a property in C#. I understand that it is probably not the best way of...
13
by: sindhu | last post by:
Hello acoder. I want to know another type of passing values between pages I have three frames frame1 for main horizontal menu frame 2 for vertical submenu frame 3 which is is loaded based on...
3
by: Archanak | last post by:
Hi, Any limits exists while passing values of checkbox to another program? Here is the code: <script type="text/javascript"> function valuate() {
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.