edit patrikG: use
Code: Select all
orCode: Select all
-tags around code[/color]
This is the form:
<form method="get" name="sw">
<select name="swspecies">
<option value="">Please Select...</option>
<option name="the Ewoks" value="0">the Ewok</option>
<option name="the Wookiee" value="1">the Wookiee</option>
<option name="the Jawa" value="2">the Jawa</option>
<option name="the Mon Calamari" value="3">the Mon Calamari</option>
</select>
<input type"text" name="swcharactername" value="">
<input type="submit" value"Go!">
</form>
This is the PHP:Code: Select all
$speciewithname_array=array(
0=>"the Ewok",
1=>"the Wookiee",
2=>"the Jawa",
3=>"the Mon Calamarian");
$speciewithoutname_array=array(
0=>"Ewok",
1=>"Wookie",
2=>"Jawa",
3=>"Mon Calamarian");
if(is_array($_post) && count($_post)>1){
if($_post["swcharactername"]!=""){
$speciewithname=$speciewithname_array[$key];}
//what i'm trying to write here is IF swcharactername is NOT blank then I want to extract out your charactername (the name you submitted) and specie for later use. It would maybe be better two makes these two variables into one variable. example: "Creative Force the Ewok". But I don't know how
elseif($_post["searchtext"]==""){
$speciewithoutname=$speciewithoutname["$key"];}
//what i'm trying to write here is IF swcharactername is blank then charactername is Ewok."http://localhost/starwarsrpgame/characterinfo/($swcharactername + $speciewithname).html or http://localhost/starwarsrpgame/characterinfo/(one variable).html
As you can see from the coding I absolutely know nothing about PHP.
I'm sure you have all written tons of threads explaining this. But I just don't know where to search for them.
Thanks