Jump to content

Recommended Posts

Can someone please tell me why my header redirect isnt working i simply want it to redirect if their is nothing entered in the input field of the form.

 

 

 

if(trim($_POST

)==''){
header('Location:http://www.example.php'); 
  }


this is the input field

<label> Code :
    <input value="<?php echo $_POST[code]; ?>"  type="text" name="code"  />
  </label>

Link to comment
https://forums.phpfreaks.com/topic/180207-header-redirect-in-if-statement/
Share on other sites

 

Hello thanks for the reply's

 

i tried but those options and it still doesnt work

 

if(empty($_POST['code'])){

header('Location:http://www.warrenbrooksbutler.com/healthcheck/paypal.php');

  }

 

sorry my fault working now i had it half way down the page put it at the top and works great now thanks for the help.

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.