Jump to content

<form action= > problem


robert_gsfame

Recommended Posts

if((!empty($_POST['title'])) && (!empty($_POST['text']))){

$check="success.php";}else{

$check="failed.php";}?>

 

<form method = "post" action="<?php echo $check;?>">

 

Which part is wrong as i always go to failed.php although both text and title are not empty

 

i've tried with !isset but it didn't work either...need someone suggestion..

 

Thanks in advance

Link to comment
Share on other sites

Try this:

 

Make a new file called action.php and in it place the following code:

 

<?php
if((!empty($_POST['title'])) && (!empty($_POST['text']))){
      INSERT INTO HERE WHATEVER IS IN success.php (excluding <?php and ?>) ;
} else {
      INSERT INTO HERE WHATEVER IS IN failed.php (excluding <?php and ?>) ;
}
?>

 

Change the code on the form to this:

 

<form method="POST" action="action.php">

 

Maybe you should try that :)

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.