Jump to content

OneShot

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by OneShot

  1. to add to Nightslyr's reply ............. list($idNumber, $idText) = explode(':', (htmlspecialchars($_GET['id']))); echo $idNumber; or you could do as voip03 suggested and just ignore d if you have no reason to call it.....
  2. Header will forward the user to a specified page somewhat like an HTML meta redirection. include will include whatever page and run it's code in that page, so basically if would be the same as if you copied the code from the included page and pasted it in the page asking to include that page. require is the same exact thing as include with the exception that any error will result in a fatal error while include will shoot an error but continue. From php.net: The documentation below also applies to require(). The two constructs are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error. In other words, use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. Be sure to have an appropriate include_path setting as well. Be warned that parse error in required file doesn't cause processing halting in PHP versions prior to PHP 4.3.5. Since this version, it does.
  3. Not 100% sure if I am understanding what exactly you want but if I am this would work...... function insertDATA($postData) { if(!ifEmailExists($postData['email'])){ $sql = " INSERT INTO tbl SET email = '".$postData['email']."', name = '".$postData['name']."', phone = '".$postData['phone']."' "; return header(sprintf("Location: %s", 'yourpage.php?success=yes')); //echo "data submitted successfully!";//this line withing the form executeSql($sql); } When the query is sucessful the use will be redirected back to the original page with the message. // yourpage.php if(!empty($_GET['success'])){ if($_GET['success'] == 'yes'){ $Success = 'data submitted successfully'; } } //Then place this where ever you want the message to appear. if(isset($Success)){ echo $Success; }
  4. Have been learning PHP for a little while now, being a php freak it only seems fitting to join this great community. Happy to be here
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.