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

passing value to php script

10
I am trying to pass a value from one PHP script to another PHP script. Below is the code. I am not sure why this is not working.

Thank you in advance for your help.
Fred Bernstein

<?php
if ($view_tenure_flag == 1) {
print('<p align="center"><a href="TenureData.php?view_tenure_flag=<?php echo $view_tenure_flag; ?>">View Tenure Records</a> </p>');
}
else if ($view_tenure_flag == 0) {
print('<p align="center"><a href="TenureData.php?view_tenure_flag=<?php echo $view_tenure_flag; ?>">Enter Tenure Records</a> </p>');
}
?>
Mar 1 '07 #1
4 1307
Motoma
3,237 Expert 2GB
Your problem is you are embedding <?php?> in PHP which is unnecessary.
[php]
<?php
if ($view_tenure_flag == 1)
{
print('<p align="center"><a href="TenureData.php?view_tenure_flag='.$view_tenu re_flag.'">View Tenure Records</a> </p>');
}
else if ($view_tenure_flag == 0)
{
print('<p align="center"><a href="TenureData.php?view_tenure_flag='.$view_tenu re_flag.'">Enter Tenure Records</a> </p>');
}
?>
[/php]
Mar 1 '07 #2
I am trying to pass a value from one PHP script to another PHP script. Below is the code. I am not sure why this is not working.

Thank you in advance for your help.
Fred Bernstein

<?php
if ($view_tenure_flag == 1) {
print('<p align="center"><a href="TenureData.php?view_tenure_flag=<?php echo $view_tenure_flag; ?>">View Tenure Records</a> </p>');
}
else if ($view_tenure_flag == 0) {
print('<p align="center"><a href="TenureData.php?view_tenure_flag=<?php echo $view_tenure_flag; ?>">Enter Tenure Records</a> </p>');
}
?>
You've PHP tags inside PHP tags of each print around the variable $view_tenure_flag. Try removing those so it looks like

print('<p align="center"><a href="TenureData.php?view_tenure_flag='.$view_tenu re_flag.'">View Tenure Records</a> </p>');

Don't forget to view the source in the browser too to make sure you're getting either
<p align="center"><a href="TenureData.php?view_tenure_flag=1">View Tenure Records</a> </p>
or
<p align="center"><a href="TenureData.php?view_tenure_flag=0">Enter Tenure Records</a> </p>

Just to think about, is it possible that $view_tenure_flag could be a value than 1 or 0?
Mar 1 '07 #3
fredb
10
Your problem is you are embedding <?php?> in PHP which is unnecessary.
[php]
<?php
if ($view_tenure_flag == 1)
{
print('<p align="center"><a href="TenureData.php?view_tenure_flag='.$view_tenu re_flag.'">View Tenure Records</a> </p>');
}
else if ($view_tenure_flag == 0)
{
print('<p align="center"><a href="TenureData.php?view_tenure_flag='.$view_tenu re_flag.'">Enter Tenure Records</a> </p>');
}
?>
[/php]
Your solution resolved the problem. Thank you very much for your help.
Mar 1 '07 #4
Motoma
3,237 Expert 2GB
Your solution resolved the problem. Thank you very much for your help.
Glad to help. Come back anytime you have a question.
Mar 1 '07 #5

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

Similar topics

3
by: Miranda johnsen | last post by:
Hello, I need some help with passing a value from my login authorization page. The authorization is done with the code below (it works), but I need the 'uName' value passed on when the...
0
by: Mario T. Lanza | last post by:
Seasoned ASP Developers, I have developed an ASP page that displays multiple rows of data with which the user may work. As each row is updated, the graphical info displayed immediately beside...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
9
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
5
by: Paul | last post by:
Just wondering if someone could provide an example of passing a variable from the code behind to javascript in vb. I want to have one control have focus with the page loading with one condition...
5
by: sfeher | last post by:
Hi All, I need to call a function(loaded with appendChild) for which I have the name as a string. .... var fnName = 'fn1'; var call = fnName + '('+ param +' )'; eval(call);
2
satterfieldben
by: satterfieldben | last post by:
I have a newbie question about passing variables between functions. I am wanting to use a drop down box to select a value. Then base on which was selected, it would create a variable and I would...
1
satterfieldben
by: satterfieldben | last post by:
I have a newbie question about passing variables between functions. I am wanting to use a drop down box to select a value. Then base on which was selected, it would create a variable and I would call...
5
by: moni | last post by:
Hi.. I am trying to use javascript for google maps display. If I call the javascript function from my aspx file I use: <input type="text" id="addresstext" value="Huntington Avenue,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.