| | |
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
| Thread Tools | Search this Thread |
# 5.2.10 alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions simple sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube





