473,387 Members | 1,925 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.

help! passing list value using href

13
hi guys need help again...

i need to pass my form values in the browser's address bar using href.

can anyone help me on how to do this? thanks and God bless.
Aug 24 '07 #1
6 3370
nathj
938 Expert 512MB
hi guys need help again...

i need to pass my form values in the browser's address bar using href.

can anyone help me on how to do this? thanks and God bless.
Hi,

Set the form method to 'GET' and away you go. This would mean that the information could be seen by on the address bar. It may be better to use 'POST' and then access it at the other side using $_POST[]. If it can't be seen it has to be safer.

Take a look at form methods, it's fairly straight forward stuff, and you should be up and running in no time.

Cheers
nathj
Aug 24 '07 #2
kid
13
Hi,

Set the form method to 'GET' and away you go. This would mean that the information could be seen by on the address bar. It may be better to use 'POST' and then access it at the other side using $_POST[]. If it can't be seen it has to be safer.

Take a look at form methods, it's fairly straight forward stuff, and you should be up and running in no time.

Cheers
nathj
hi! i know how to use that method but my real problem is i want to display the value of my list in the address bar of browser this is my sample code but it is not working.

<div align='left'>Region&nbsp
<select name='region' id='region'>
<option value='****' selected>[Select]</option>
<option value='LUZON'>Luzon</option>
<option value='VISAYAS'>Visayas</option>
</select>
<?
$a = $_GET['region'];
?>


<a href='page.php?region=$a' >sample</a>

can you help me on this? please
Aug 24 '07 #3
nathj
938 Expert 512MB
Hi,

Could you post the full code for the form? This may shed some more light on the matter.

Cheers
nathj
Aug 24 '07 #4
kid
13
Hi,

Could you post the full code for the form? This may shed some more light on the matter.

Cheers
nathj


<form id="all_region" name="all_region" method="GET" action="">
<label>
<select name="region" id="region">
<option value="****">[Select]</option>
<option value="LUZON">Luzon</option>
<option value="VISAYAS">Visayas</option>
</select>
</label>
<?
$a = $_GET["Region"];
?>
<p><a href="page.php?region=<? echo $a ?>">GO</a></p>
</form>


this is my code but it is not working i cannot echo $a in my browser.
Aug 24 '07 #5
nathj
938 Expert 512MB
Hi,

there is nothing to submit your form and the action is empty.

If you want it to stay on the same page set the action to that page and then add aubmit button to the form.

At the top of the page you can test for the $_GET[] variableand if it has been set then do whatever needs to be done otherwise display the form.

The information in the $_GET[] array is not set until the form is submitted. So you need to submit the form in order to set the array.

Cheers
nathj
Aug 24 '07 #6
<form id="all_region" name="all_region" method="GET" action="">
<label>
<select name="region" id="region">
<option value="****">[Select]</option>
<option value="LUZON">Luzon</option>
<option value="VISAYAS">Visayas</option>
</select>
</label>
<?
$a = $_GET["Region"];
?>
<p><a href="page.php?region=<? echo $a ?>">GO</a></p>
</form>


this is my code but it is not working i cannot echo $a in my browser.
OK I think what you need is this:
[PHP]
<form id="all_region" name="all_region" method="GET" action="">
<label>
<select name="region" id="region">
<option value="****">[Select]</option>
<option value="LUZON">Luzon</option>
<option value="VISAYAS">Visayas</option>
</select>
</label>
<?
if(isset($_REQUEST["region"]))
{
$a = $_REQUEST["region"];
?>
<p><a href="page.php?region=<? echo $a ?>">GO</a></p>
<?
}
else
{ ?>
<input type="submit" value="Update link">
</form>
} ?>
[/PHP]

I have not tested this, but first you need to submit the information to the same page (action=""), then using the if(isset(bla)) code, capture the submitted 'region' value.
Aug 24 '07 #7

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

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
2
by: BT Openworld | last post by:
I have just had to upgrade to Access 2003 as Access 97 EMail (SendObject) doesn't work when loaded on Windows XP. I'm finding my way around Access 2003 but my biggest problem is getting...
5
by: dixie | last post by:
I was wondering if there is a way of doing a simple help system with either viewing a page in a browser or looking at a definite page in a .pdf file when a help button was pushed on an Access...
5
by: TD | last post by:
Hey All, I am hooking up our custom html (.chm) help file to our Access xp application, and, despite reading several posts and manuals on this, I still have a gap in my understanding... OK, so...
3
by: lord.zoltar | last post by:
I've managed to get a nice little chm help system written. Now I need to display it! I added a HelpProvider to my MDIParent form and set the namespace of the HelpProvider to be the help file. So...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
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: 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?
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,...

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.