Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

PHP Error: Undefined Index

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,098
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 5, 2011

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (phpacademy)

  • hi there you don't have to add a hidden field and check for it you could just

    give the submit button a name like this:

    input type="submit" value="Submit" name="submit"

    and then check if the submit button is clicked like this:

    if (issset($_POST['subbmit']){

  • @tyoil That's true. It's personal preference really. I just feel it's cleaner to specify a hidden value.

  • another way that wasn't mentioned here is to just mark a '@' before the dollar sign, which will remove the error. For example:

    if ($_POST['something']) becomes if (@$_POST['something'])

  • @strafir No! Never do this. It will decrease script performance (load time).

  • since when can you do commas instead of dots for concatenating?

  • @winfr34k The echo construct is loosely regarded as a function, which can take an unlimited amount of parameters. Hence, each string can be separated by a comma.

see all

All Comments (21)

Sign In or Sign Up now to post a comment!
  • whoa did not know you can do isset for multiple variables and separate with commas. In your beginner tutorials on thenewboston, you typed isset for each one. Good thing I saw this video, saves lots of typing.

    Also good idea on that indentation. Looks much cleaner.

  • @EmilsMC That's Cheating! Haha!

  • I'd just add an @ before the variable :)

  • You are an absolute don!!!

  • I found other solution, copy and paste this code to your scripts.

    error_reporting (E_ALL ^ E_NOTICE);

  • Thank you a lot.

    I have googled a lot and posted on forums but nothing had worked out even from the book itself [thaugh not finished up reading].

    Using the tips you gave it helped a lot.

  • @phpacademy Thank you very much, never knew that!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more