Unstoppable Domains โ€” AI Assistant

How to do this...

Spacemail by SpaceshipSpacemail by Spaceship
Watch
Impact
48
Well basically
i am trying to set up a contact
so e.g.

if it was contact.php?to=Joe

it would show the 'Joe' bit on the top of a drop down box

but heh, you're probably thinking.. yeah.. thats easy
well what i'm asking for, is for it to choose something that is already in the drop down box, it just brings it to the top
(its so people can choose who to send the email too)

ok lemme summaries

contact.php?to=Joe
shows Joe at the top

contact.php
shows a default option that cant be submitted?

contact.php?to=News
shows News at the top

anyone know how to do this?

thanks
Joe
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
PHP:
<select name="name">
<?php
if ($_GET['to'])
{
echo "<option value=\"default">
<option value='1'>Name 1";
} else
{
echo "<option value=\"$_GET['to']\">$_GET['to']
<option value='1'>Name 1";
}
?>
</select>
 
0
•••
i put it on www.artemisfowl.info/testing.php (doesn't work for me, if not try http://www.heskett.org/~artemis/testing.php)

heres the source:
Code:
<form method="post" action="test2.php">
<select name="name">
<?php
$to = $_GET['to'];
if ($_GET['to'])
{
echo "<option value=\"default\">default</option>
<option value='Jack'>Jack</option>";
} else
{
echo "<option value=\"$to\">$to</option>
<option value='Joe'>Joe</option>";
}
?>
</select>  
<input type="submit" name="submit" value="Submit">
</form>

but it doesn't work :S

Joe
 
Last edited:
0
•••
Code:
<?php
$to=$_GET['to'];
?>
<select name="name">
<option value="Joe" <?php if($to == "Joe"){ echo 'selected="selected"'; } ?> >Joe</option>
<option value="Other" <?php if($to == "Other"){ echo 'selected="selected"'; } ?> >Other</option>
</select>
That shoudl work, although it may require a bit of editing as I have not tested it, although it is the basic idea
 
Last edited:
0
•••
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back