2 Replies - 750 Views - Last Post: 08 March 2013 - 02:19 PM

#1 loveandwar  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 14
  • Joined: 08-April 12

How to apply condition

Posted 07 March 2013 - 02:07 AM

hello everyone,
how can i apply condition on the value of given input as you see this code is written inside the .php file thats why i used the echo statment to show the html inputs,at this point i dont know how can i apply condition on the value of input. If a user enters "hello" then php code should show " welcome back" else it should show "hello new user". i shall be very thankfull to you.

echo "<html> 
<head>
</head> 
<body> 

<input type=\"text\" name=\"usertext\" value=\"\" /> 


</body> 
</html>"; 


Is This A Good Question/Topic? 0
  • +

Replies To: How to apply condition

#2 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3616
  • View blog
  • Posts: 12,442
  • Joined: 12-December 12

Re: How to apply condition

Posted 07 March 2013 - 02:41 AM

You need to keep studying PHP until you cover:

handling form data
submitting a page to PHP
using if statements

etc.. This is almost the main purpose of PHP so it is probably covered in the next chapter of the book or tutorial that you are following :whistling:

[This should be in the PHP forum]

This post has been edited by andrewsw: 07 March 2013 - 02:42 AM

Was This Post Helpful? 0
  • +
  • -

#3 Koyume  Icon User is offline

  • D.I.C Head

Reputation: 15
  • View blog
  • Posts: 89
  • Joined: 19-February 13

Re: How to apply condition

Posted 08 March 2013 - 02:19 PM

View Postandrewsw, on 07 March 2013 - 03:41 AM, said:

You need to keep studying PHP until you cover:

handling form data
submitting a page to PHP
using if statements

etc.. This is almost the main purpose of PHP so it is probably covered in the next chapter of the book or tutorial that you are following :whistling:/>

[This should be in the PHP forum]


He already has one.

Click here
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1