Re: $_server[php_self]



Mikey P:
hi all i'm having issues with this returned function. I can get it to
delete a database but i really want it to grab the stateselect
extention and grab all the cities related to that state. I wanted to
contain this on one page instead of going over multiple pages which i
can do. Sorry if this doesn't make much sense i'm a newbie.. below is
the code. the isset($_get  is where i have the issues. any help would
be appreciated.


First off I wanted to suggest you do some reading on PHP Security as your application falls victim to an input validation failure. Anytime you get data from a user IE: $_GET, $_POST, $_COOKIE, $_REQUEST, $_SERVER you need to check that the data you are getting is right...
Read the PHP Security Guide: http://phpsec.org/projects/guide/


Also your code is quite ugly... Work on formatting and not hiding errors. Fix them first not hide them. In production you should log your errors instead of allowing them to be displayed to the browser. Also you only need to select the database once, and you should reuse variables when they make sense to.

When inserting data into mysql use mysql_real_escape_string

Now onto fixing your code:
http://pastebin.com/368628


-- Mike Willbanks Zend Certified Engineer http://www.digitalstruct.com .



Relevant Pages

  • Re: Reboot instead of debugger/dump from X11? (Re: an accidental way to pull the plug)
    ... when it took place with X11 ... on startup and switch back to the text console. ... I have been using FreeBSD as a fine platform for a Free database I ... using xv to grab the windows. ...
    (freebsd-current)
  • an accidental way to pull the plug
    ... so I am letting you folks know. ... I have been using FreeBSD as a fine platform for a Free database I ... using xv to grab the windows. ... wait (it has a timer delay, which I set to 5 seconds). ...
    (freebsd-current)
  • Re: Parsing Mail Messages
    ... Step 1: Grab the appropriate message ... The intent here is to call this from an Outlook rule. ... If necessary, this can be to a delimited text file, but preferably it would be to a database. ... grep wrote: ...
    (microsoft.public.office.developer.outlook.vba)
  • Re: "stamping" records by user
    ... Just enter =curentuserin the timestamp field's default value, ... Do a search if you would prefer to grab the login name from Windows and use ... create a new case record (this database is medical-related). ... by making a drop-down list of usernames and making it mandatory ...
    (microsoft.public.access.formscoding)
  • Re: [PHP] Echoing input w/o sanatizing - what is the danger
    ... I'm not sure I'd go so far as to call it a Bible for PHP Security, ... Number 2 is to "escape output" ... If it's headed out to a database, ... Javascript to deface websites, or even adding Javascript to use YOUR ...
    (php.general)