Jump to content

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();

}

 

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.