Jump to content

[SOLVED] Quick & Simple PHP Questions


thesaleboat

Recommended Posts

For a Form:

 

How do you check to see that the user only enters numbers in his phone number?

 

Is there a way to make the browser go back instead of to a specific url? For example instead of:

 

echo '<meta content="1; URL=index.htm#ThankYouForYourResume.php" http-equiv="Refresh" />'; //go back to homepage after they read the thank you message

have the user go to the last page he was at?

Link to comment
https://forums.phpfreaks.com/topic/125535-solved-quick-amp-simple-php-questions/
Share on other sites

1) Only numbers:

<?php
//assume $number is their entered number
if (!ctype_digit($number)) {
 //not all digits, give an error
}
?>

 

2) You could use Javascript for that.  It can be done with history.go(-1).

 

EDIT: Discomatt beat me to it, lol.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.