Title: PHP Script error
Last modified: August 19, 2016

---

# PHP Script error

 *  Resolved [amanonline](https://wordpress.org/support/users/amanonline/)
 * (@amanonline)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/php-script-error/)
 * Hi friends,
 * I am using a custom php script in my wordpress website. my aim is to redirect
   the user to error page when the filled form is empty or with any wrong value.
   
   He should go to success page when he filled the form with correct text. The correct
   text is for example anytext. But i am getting error constantly. Can anyone please
   check that what the error is and how to correct it?
 * > <?php
   >  $answer = $_POST[‘answer’];
   > if ($answer == 0 )
   >  { header(“Location: [http://www.domain.com/error&#8221](http://www.domain.com/error&#8221););
   > exit; }
   > if ($answer == anytext )
   >  { header(“Location: [http://www.domain.com/success&#8221](http://www.domain.com/success&#8221););}
   > else { header(“Location: [http://www.domain.com/error&#8221](http://www.domain.com/error&#8221););
   > exit; } ?>
 * Any help please. Thanks in advance.

Viewing 1 replies (of 1 total)

 *  Thread Starter [amanonline](https://wordpress.org/support/users/amanonline/)
 * (@amanonline)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/php-script-error/#post-1667419)
 * I have solved it myself.

Viewing 1 replies (of 1 total)

The topic ‘PHP Script error’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 1 reply
 * 1 participant
 * Last reply from: [amanonline](https://wordpress.org/support/users/amanonline/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/php-script-error/#post-1667419)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
