Jump to content

[SOLVED] problems with form handling script


prime

Recommended Posts

Hi have the following peice of code in a form handling php script I have, Not exactly sure whats going on with it, any help would be appreciated thank you

 

<?php

$badname  = array("example1");

?>

<?php

if ($rs_name == in_array($badname))  /* I've also tried using if(in_array($rs_name, $badname)) without any success */
{
    echo "<br/><br/><center>
    
    <font color='orange' size='4'>
This name has been Blocked from the registry submitter
<br/>
If you are the owner of this account
<br/>
Please use the contact us form to verify you are the account owner
<p/>
Account verification requires in-game verification
    </font>
    </center>";
    exit();
}

?>

<?php
$badname  = array('example1','testing','bob');
?>
<?php
$rs_name='bob';



if (in_array($rs_name, $badname))  
{
    echo "<br/><br/><center>
    
    <font color='orange' size='4'>
This name has been Blocked from the registry submitter
<br/>
If you are the owner of this account
<br/>
Please use the contact us form to verify you are the account owner
<p/>
Account verification requires in-game verification
    </font>
    </center>";
    exit();
}

?>

 

This worked for me. I got the error message for all 3 items in the array.

 

Nate

Look at your form method. It is either post or get. then just create the variable for it.

 

<?php

$badname  = array('example1','testing','bob');

?>

<?php

// only use one of the following, as one will work, and one will fail.

$rs_name=$_POST['name_of_field'];

$rs_name=$_GET['name_of_field'];

 

 

 

if (in_array($rs_name, $badname)) 

{

    echo "<br/><br/><center>

   

    <font color='orange' size='4'>

This name has been Blocked from the registry submitter

<br/>

If you are the owner of this account

<br/>

Please use the contact us form to verify you are the account owner

<p/>

Account verification requires in-game verification

    </font>

    </center>";

    exit();

}

 

?>

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.