thesaleboat Posted September 23, 2008 Share Posted September 23, 2008 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 More sharing options...
discomatt Posted September 23, 2008 Share Posted September 23, 2008 Only numbers is either is_numeric( $var ); // allows decimals and -'s ctype_digit( (string)$var ); // only allows 0-9 Going 'back' is purely javascript Link to comment https://forums.phpfreaks.com/topic/125535-solved-quick-amp-simple-php-questions/#findComment-649075 Share on other sites More sharing options...
DarkWater Posted September 23, 2008 Share Posted September 23, 2008 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. Link to comment https://forums.phpfreaks.com/topic/125535-solved-quick-amp-simple-php-questions/#findComment-649079 Share on other sites More sharing options...
thesaleboat Posted September 23, 2008 Author Share Posted September 23, 2008 You guys are awsome hahaha thanks guys! Link to comment https://forums.phpfreaks.com/topic/125535-solved-quick-amp-simple-php-questions/#findComment-649082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.