Forum Moderators: coopster
<form onSubmit="return isCurrency(frm)" name="frm" action="add.php?sortlist=$sortlist&category=$category" method="post">
Where $sortlist and $category are variables being passed between different PHP programs.
I don't know where those vars are coming from but if they are available to php in that particular script you need to have them parsed to echo the values
<form onSubmit="return isCurrency(frm)" name="frm" action="add.php?sortlist=<? echo $sortlist;?>&category=<? echo $category;?>" method="post">
These variables are being passed between some update routines and are used to select and sort the database. Sortlist being the sort filed and xxcategory being the selection criteria. I'm passing these between seperate add and update routines using
add.php?sortlist=$sortlist....
Using the code provided by yourself, I get the following link
[<webaddress>...]
I'm using the following to pick up the variables in the the routines
// If current sortlist, use it
// if not, set one!
if(!isset($_GET['sortlist'])){
$sortlist = brand;
} else {
$sortlist = $_GET['sortlist'];
}
// If current category, use it
// if not, set one!
if(!isset($_GET['xxcategory'])){
$xxcategory = Beer;
} else {
$xxcategory = $_GET['xxcategory'];
}
Thanks for the quick response.
Andy
What a star you are..... All that was wrong was that the add-form.html files should have been named add-form.php! Well, that's 2 hours it's taken me to sort that one out.. with your help of course. Atleast I was on the right track with the code.
What fun PHP is ;) It's great to be programming again.
Cheers,
Andy
Even so, you've got a mix of the GET and POST actions which is confusing you. Add your variables as form items (which can then be accessed through the $_GET array:
<input name="sortlist" type="hidden" value="<?php echo $sortlist;?>">
which can be accessed using $_GET['sortlist'].
I *think* you can only have variables attached to the URL if you use POST to access the page (through a regular HTML link), in which case you'd use the $_POST array instead of $_GET. I am willing to be proved wrong here though ...
Edit: Too many posts, too little time :0 Andy, can you pull the vars off the URL string using your approach? Does it work as you'd hoped?