Jump to content

Disallow URL in php Form variable


wads24

Recommended Posts

So, right now if the form field variable is blank it errors out with below code, but I have been getting a lot of spam submissions on my form and they have been typing in URLs in field.  How can I modify the below so that if they put a URL that is will also error out?  Thanks in advance for any help!

    else if(!$_POST['description'])
    {
        print "<table style='border-collapse: collapse' id='AutoNumber1' border='0' bordercolor='#111111' cellpadding='0' cellspacing='0' width='100%'>
  <tr>
    <td width='38%'>
    <p align='right'>
    <img class='decoded' alt='error.png' src='error.png'></td>
    <td width='26%'>
    <p align='center'><u><font size='5' color='#FF0000'><b>DESCRIPTION ERROR</b></font></u></td>
    <td width='36%'>
    <img class='decoded' alt='error.png' src='error.png'></td>
  </tr>
  <tr>
    <td colspan='3' width='100%'>
    <p align='center'><font size='1'>The Site Description field cannot be blank, or cannot include and URLs.</font></td>
  </tr>
  <tr>
    <td width='100%' colspan='3'> </td>
  </tr>
  <tr>
    <td width='100%' colspan='3'>
    <p align='center'><a href='javascript:javascript:history.go(-1)'>Click here
    to go back to previous page</a></td>
  </tr>
</table>";}
Link to comment
Share on other sites

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.