PDA

View Full Version : Some Help, Please?


Darkest Days
07-12-2006, 11:44 PM
Mkay.. let me try and explain myself as best as possible..

What I'm doing is trying to make an order form work with specific links..

I have a packages page setup with links.. and each link is directed to an orderform page and on that orderform page I have a Select Drop Down Menu with each individual package..

so what I'm trying to do is have the package they want highlighted/selected when they click that specific package...

Now the way i'm doing it is.. probably too much.. Since each link directs to a diff page.

Is there anyway to change that as to where it's all directed to one page, but the Select Menu is still changed to the corresponding package?

The way I have it setup right now is the links on the left and the orderform on the right inside an iframe..

I'm pretty sure this will be easier in php.. and if so, could someone please explain the general idea to me?

Puhhleease? :-D

Pegasus
07-12-2006, 11:57 PM
It sounds like what you want is PHP. I'll just move this over to the proper forum for you.

Peg

Darkest Days
07-13-2006, 12:00 AM
thank you.. I couldn't quite find it =/

Darkest Days
07-13-2006, 05:51 AM
Nothing :-(?

<h1>
07-13-2006, 08:23 AM
hmm yes this would be easy in php
On your package links you would need to have your link like so:
<a href="contactform.php?package=boxes">Boxes</a>
Now with php you can retrieve the package value from the url and select the option that matches the variable in the url... If you want to make this method more controllalbe with regards to package values VS what the actial packages are, you will need to use a multidimensional array..well i hope this helps

<?php
if (isset($_GET['package'])) {$orderpackage = $_GET['package'];}
else $orderpackage = '';
$packages = array("boxes", "pots", "pans");
$buff = '<select name="package">';
foreach($packages as $package)
{
$buff .= '<option value="'.$package.'"';
if ($package == "$orderpackage") {$buff .= ' selected';}
$buff .= '>'.ucfirst($package).'</option>';
}
$buff .= "</select>";
echo $buff
?>

Darkest Days
07-13-2006, 06:46 PM
GREATLY APPRECIATED!

Thank you much for that information.. It's gonna save me so much time

Much love :-D

Darkest Days
07-14-2006, 04:07 AM
Kk, I just verified it.. It works like a charm..

Thanks for the help.

<h1>
07-14-2006, 05:49 AM
Coolios..
BTW that purple colour works a lot better than the pink ;)