Jump to content

[SOLVED] Vaild Key


Daney11

Recommended Posts

Hey guys, Im using this bit of code to pull out all locations and values, and it works perfect.

 

<?php 
echo '<select name="member_nation">';
echo '<option value="nonationA" selected="selected">Please Select...</option>';
?>
<?php
foreach ($location as $key => $value) { echo "<option value=\"$key\">$value</option>\n"; 
} 
echo '</select>';
?>

 

However this peice of checking code keeps telling me to enter a vaild nation, even though i am. Any ideas?

 

if (eregi ('^[[:alpha:]\.\'\-]{2,15}$', stripslashes(trim($key)))) {
   $member_nation = escape_data($key);
} else {
   $member_nation = FALSE;
   $errors[] = 'Please Enter A Valid Nation';
       }

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/81477-solved-vaild-key/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.