Jump to content

Recommended Posts

Good morning, given that I don't know how to program in php, I'll tell you what I'm looking for. I have a web space where I uploaded a php script, it's an adult site, currently in maintenance mode. I searched on the internet for a code that allows me to display a popup or in any case a pre-entry page in which the user is asked to accept or not the contents of the site, but I have not succeeded in the enterprise. Had it been a Wordpress site, I would have solved it with a plugin, but it isn't. If anyone knew a script or code to implement on the site, could you suggest it to me? Thanks a lot to everyone. (Google Translator)

I had found this by browsing the internet, but it doesn't work well, or rather, it shows me the age verification page and makes me enter or exit the site based on the choice, but then it creates problems with the links of the admin panel of the site for example, they don't work. I entered this in the site index:

//Start the session
session_start();

/*
* If they haven't passed the age test
* then the age_verified session will not
* be set, since it is only set if they
* say they are 21 years of age.
*/
if(!isset($_SESSION['age_verified'])){
header("Location: verify.php");
exit;
}

This is the verification page:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nuova pagina 1</title>
</head>
<body style="background-attachment: fixed" text="#FFFFFF" bgcolor="#CC0099">
<h2 style="text-align: center;"></h2>
<h2 style="text-align: center;">&nbsp;</h2>
<h2 style="text-align: center;">&nbsp;</h2>
<h2 style="text-align: center;">
<font color="#FFFFFF" face="Cooper Std Black" size="6"><strong>ATTENZIONE!!</strong></font></h2>
<h3 style="text-align: center;">
<font color="#FFFFFF" face="Calibri Light" style="font-size: 16pt"><strong>Questo sito contiene immagini e contenuti rivolti ad un pubblico adulto ed &egrave; accessibile solo a persone che abbiano raggiunto la maggiore et&agrave;&nbsp; prevista dalla legge dal Paese dal quale si accede al sito.</strong></font></h3>
<h3 style="text-align: center;">
<font color="#FFFFFF" face="Calibri Light" style="font-size: 16pt"><strong>Gli inserzionisti devono rispettare i nostri standard di et&agrave;&nbsp; e contenuti nei propri annunci.</strong></font></h3>
<h3 style="text-align: center;">
<font color="#FFFFFF" face="Calibri Light" style="font-size: 16pt"><strong>MioSito ha una politica di tolleranza zero nei confronti della pornografia infantile, della pedofilia e nei confronti dei minori che tentassero di pubblicizzarsi attraverso il nostro sito. Qualsiasi attivit&agrave;&nbsp; riguardante tali reati verr&agrave;&nbsp; denunciata alle autorit&agrave;&nbsp; competenti.</strong></font></h3>
<h3 style="text-align: center;">
<font color="#FFFFFF" face="Calibri Light" style="font-size: 16pt"><strong>Accedendo a questo sito Web, dichiari di essere maggiorenne e di accettare le Condizioni d'uso e di esonerare MioSito da qualsiasi responsabilit&agrave;&nbsp; derivante dall'uso del sito.</strong></font></h3>
<h3 style="text-align: center;">
<center><form method="POST" action="/ageCheck.php">
<input type="submit" name="valid_age" value="HO 18 ANNI" />
<input type="submit" name="invalid_age" value="Ho Meno di 18 Anni" />
</form></center>
</body>
</html>

Questo è ageCheck.php:

<?php
//Start session
session_start();

/*
* First, we want to make sure they came to this ageCheck.php via a form.
* Then we can check to see if $_POST['valid_age'] is set, since it will only
* be set if they pressed the "I'm 21" button.
*/
if(isset($_POST)){
if(isset($_POST['valid_age'])){
/*
* Since they got here, it means they are of the right age.
* Now we set the session value.
*/
$_SESSION['age_verified'] = true;
header("Location: index.php");
exit;
}else{
/*
* To young! Just re-direct them to Google.
*/
header("Location: http://www.google.com");
exit;
}
}else{
die("Trying to sneak in are we?");
}

?>

Edited by requinix
less spammy title
  • requinix changed the title to Adult Content acceptance popup before viewing the site

So you know, titling your thread "Adult Content" is a great way to get an admin's immediate attention - and not in a good way. So I've edited in something for you that's a little more specific.

 

43 minutes ago, elena71pa said:

I had found this by browsing the internet, but it doesn't work well, or rather, it shows me the age verification page and makes me enter or exit the site based on the choice, but then it creates problems with the links of the admin panel of the site for example, they don't work.

What kind of problems?

the first part of the code I have inserted in the index.php of the script, the other two files, verification and ageCheck are all on the server together with the other files of the script. When I log in to my site, the age selection screen appears, but then I can no longer navigate the site. The site is currently not online but under maintenance.

""An extra thing for the moderators, why don't I receive notifications of replies in my email, even though I have set up to receive them?""

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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