Author Topic: Action file on submit when if condition is true  (Read 2091 times)

piyu

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Action file on submit when if condition is true
« on: January 11, 2008, 02:30:21 AM »
HI !
I have made a form which is containing some condition.
such as
if ($_POST['submit'] && condition = true)
(!!! Open action file !!!)
else
echo "Invalid username";

I can not open it on submit when condition is true.

If condition is true & submit, Either open action file or jump the paricular file

PLEASE !!!!!!!!!
Help Me !

peg110

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 799
  • Karma: +0/-0
    • View Profile
    • http://www.tripleclicks.com/11260983/go
Re: Action file on submit when if condition is true
« Reply #1 on: April 02, 2008, 10:56:41 AM »
Quote from: "piyu"
HI !
I have made a form which is containing some condition.
such as
if ($_POST['submit'] && condition = true)
(!!! Open action file !!!)
else
echo "Invalid username";

I can not open it on submit when condition is true.

If condition is true & submit, Either open action file or jump the paricular file

PLEASE !!!!!!!!!
Help Me !

I know this is late, but a couple of notes...

First this is not really an PHP Installation and Configuration but i will go ahead anyway.

Next consider checking for content in the $_POST variable. more like
Code: [Select]
if (!empty($_POST['submit']) && $condition == true) {
     (!!! Open action file !!!)
} else {
     echo "Invalid username";
}

Also I am not sure if what you put up there is more pseudo-code or not, however, I noticed it was a half and half. Please make sure:
 -  your Comparison (equals) is an ==
 - You use the curly braces { } to segment the IF statement
 - Your Variables start with a $

Again, sorry it's late but I hope it helps. (or maybe helps someone else.)