Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PHP] Very Basic Login Page
#16
(06-07-2012, 07:47 PM)RubiksHQ Wrote: You could have used the empty() function instead of
PHP Code:
If ($_POST["text"] == "" || $_POST["pass"] == ""){ echo '<script>alert("Please enter something into the text boxes!")</script>'

Technically speaking, empty is a language construct, not a function. The most obvious difference between a language construct (that requires parenthesis) and a function is that you are unable to have a variable as a name for it (unlike in a function).
PHP Code:
$a 'empty';
if(
$a($_POST['b'])) #invalid

$c 'trim';
$d $c($_POST['b']); #valid 
$c is known as a variable function now.

@BreShiE, there's no need for you to question if there is input in the third IF statement because the ELSE part of the second IF statement will make sure of that.
Reply


Messages In This Thread
[PHP] Very Basic Login Page - by BreShiE - 12-01-2011, 11:45 AM
RE: [PHP] Very Basic Login Page - by SuhinderG - 12-01-2011, 03:33 PM
RE: [PHP] Very Basic Login Page - by D3xus - 12-01-2011, 03:34 PM
RE: [PHP] Very Basic Login Page - by BreShiE - 12-02-2011, 09:32 AM
RE: [PHP] Very Basic Login Page - by D3xus - 12-02-2011, 10:09 AM
RE: [PHP] Very Basic Login Page - by BreShiE - 12-03-2011, 10:53 AM
RE: [PHP] Very Basic Login Page - by D3xus - 12-03-2011, 06:25 PM
RE: [PHP] Very Basic Login Page - by HF~Legend - 12-04-2011, 12:13 PM
RE: [PHP] Very Basic Login Page - by BreShiE - 12-05-2011, 05:30 AM
RE: [PHP] Very Basic Login Page - by Hex - 12-05-2011, 01:44 PM
RE: [PHP] Very Basic Login Page - by Retribute - 06-07-2012, 07:47 PM
RE: [PHP] Very Basic Login Page - by Haxalot - 06-21-2012, 02:34 PM
RE: [PHP] Very Basic Login Page - by Rwkeith - 08-09-2012, 10:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 789 07-27-2020, 11:26 PM
Last Post: tk-hassan
  [help] Improve login script Montana" 1 1,553 03-18-2013, 12:59 PM
Last Post: Haxalot
  Don't need to login Strafeness 5 1,827 01-21-2012, 08:28 AM
Last Post: AceInfinity
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,313 10-10-2011, 01:00 PM
Last Post: Greyersting
  PHP error on page submit kaosjon 7 2,207 09-18-2011, 03:31 AM
Last Post: AceInfinity

Forum Jump:


Users browsing this thread: 1 Guest(s)