Skip to main content
gamedev.net
🔒 Locked 🤖 Godot

php form value question

Started by Khaos Dragon Oct 24, 2005 at 1:37 PM 0 replies 350+ views
Original Post
Khaos Dragon
Khaos Dragon
Is there a way to check if a variable is defined or has been posted in a php script? For example before I use $_POST['username'] I want to make sure that username has indeed been posted first.
jflanglois
jflanglois
You can use the isset "function".

[edit] You should also make sure to read the user comments on that page.
[edit2] So usage would be:
if( isset( $_POST['username'] ) ) {  // Do what you were going to do}else {  // It doesn't exist}



jfl.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.