| | |
Age Verification Script
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 2
Reputation:
Solved Threads: 0
Duke SNIPPED Nukem will only allow 18 and above on his site. It seems like my html page is correct and my php is the problem. Anyone have any answers they would like to share with me? MAY JUSTICE REIGN SUPREME!!!!!
PHP Syntax (Toggle Plain Text)
<?php $month = $_REQUEST['bmonth']; $day = $_REQUEST['day']; $year = $_REQUEST['year']; $this_day = date(d); $this_month = date(m); $this_year = date(Y); $day_val = $this_day - $day; $month_val = $this_month - $month; $year_val = $this_year - $year; if($year_val >= 19) { header('Location: <a rel="nofollow" class="t" href="http://www.URL.com/Tour/Tour1.html'" target="_blank">http://www.URL.com/Tour/Tour1.html'</a>); } if($month_val >= 0) { header('Location: <a rel="nofollow" class="t" href="http://www.URL.com/Tour/Tour1.html'" target="_blank">http://www.URL.com/Tour/Tour1.html'</a>); } if($day_val >= 0) { header('Location: <a rel="nofollow" class="t" href="http://www.URL.com/Tour/Tour1.html'" target="_blank">http://www.URL.com/Tour/Tour1.html'</a>); } else { header('Location: <a rel="nofollow" class="t" href="http://www.URL.com/notvalidbday.html'" target="_blank">http://www.URL.com/notvalidbday.html'</a>); } ?>
Last edited by happygeek; Aug 2nd, 2009 at 2:42 pm. Reason: removed vulgarities, snipped adult url
dude you should remove the three conditions and put em in one condition so the code should look something like this
PHP Syntax (Toggle Plain Text)
<?php $month = $_REQUEST['bmonth']; $day = $_REQUEST['day']; $year = $_REQUEST['year']; $this_day = date(d); $this_month = date(m); $this_year = date(Y); $day_val = $this_day - $day; $month_val = $this_month - $month; $year_val = $this_year - $year; if($year_val >= 19&&$month_val >= 0&&$day_val >= 0) { header('Location: http://www.URL.com/Tour/Tour1.html'); } else { header('Location: http://www.URL.com/notvalidbday.html'); } ?>
Last edited by happygeek; Aug 2nd, 2009 at 2:42 pm. Reason: snipped adult URLs in code
try this one
php Syntax (Toggle Plain Text)
<?php $allowed_age = 19; $bdate = strtotime($_REQUEST['y'].'-'.$_REQUEST['m']."-".$_REQUEST['d']); $age = (time()-$bdate)/31536000; if($age >= $allowed_age) { header('Location: http://www.URL.com/Tour/Tour1.html'); exit; } else { header('Location: http://www.URL.com/notvalidbday.html'); exit; } ?>
Last edited by happygeek; Aug 2nd, 2009 at 2:43 pm. Reason: Snipped adult URL in code
programming is an art ,only for those who can understand it.
- th3 php wr3nch -
- th3 php wr3nch -
![]() |
Similar Threads
- age advancing script? (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: Multiple Form Actions to same page
- Next Thread: Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource
Views: 7529 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





