Jump to content

Recommended Posts

I have for my installation of my page where its the same index.php page for the entire set and the content of the page iwll change depending on if the cookies exist. I have the form input submit button and I have it so when the user clicks the button it will go to addcookie.php which contains this code

 

<?php
if(!isset($_COOKIE['step2'])
{
setcookie("step1", "bboardx", time()+3600);
header('Location:http://www.devwebsites.com/install/index.php');
}
?>

 

On my index.php file it will do an isset to see if cookie 1 exists and cookie 2 does not exist, then it will display the introduction and that sort of process alll the way until step 9. Now I have this code here but the error is

 

Parse error: syntax error, unexpected '{' in /home/ericr/public_html/forums/install/addcookie.php on line 3

 

But I thouight I was doing everything right. Any ideas why its not working?

Link to comment
https://forums.phpfreaks.com/topic/130074-display-different-html-if-cookies-exist/
Share on other sites

That worked and now I tried to take it a step further and I get the same error and Ive been looking and to me it seems like I got my parenthesis correct...can someone spot what I missed / misscounted?

 

<?php
setcookie("step1", "bboardx", time()+3600);
if((!isset($_COOKIE['step2']) && (isset($_COOKIE['step1']))
{
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>BBoardX Installation Guide- Step 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="icon" type="image/png" href="favicon.ico" />
<style type="text/css">
/*<![CDATA[*/
body {
        font-family: Verdana, Arial, sans-serif;
        font-size: 12px;
        background: #fff;
        color: #000000;
        margin: 0;
}

a {
        color: #035488;
        text-decoration: none;
}

a:hover {
        color: #444;
        text-decoration: underline;
}

.header{
float:left;
margin-left:90px;
width:70%;

}
.footer{
clear:both;
border:1px solid black;
width:100%;
height:24px;
}
table{
border:1px solid black;
float:left;
margin-left:90px;
width:80%
}
h2 {
font-size:27px;
height:34px;
}
.leftside{
float:left;
width:30%;
height:450px;
background: #EBEBEB url(images/background.gif) repeat scroll 0 0;
}
.leftside ul{
list-style-type:none;
padding:15px;
}
.rightside{
width:50%;
height:100%;
padding-left:10px;
margin-top:10px;
}
.bluestrip{
background:#016DB1 url(images/tophead.gif) repeat-x scroll left top;
border-bottom:1px solid #000000;
clear:both;
color:#FFFFFF;
font-weight:bold;
padding:5px;
width:79%;
height:20px;
float:left;
margin-left:90px;
}
.rightside h2{
margin-top:20px;
margin-left:10px;
float:right;
width:43%;
}
.rightside img{
display:inline;
}
.rightside p{
margin-left:10px;
}
.leftside li{
padding:0 0 3px;
}
.content{
padding:10px 0px 10px 19px;
width:75%;
}
.overlap{
margin-left:160px;
}
.button{
float:right;
margin-right:20px;
margin-top:20px;
/*]]>*/
</style>
</head>
<body>
<div class="header"><img src="images/logo.gif" alt="banner" width="700px" /></div>

<div class="bluestrip">BBoardX Installation Guide</div>
<table>
<tr>
<td>
<div class="leftside">
<ul>
<li><img src="images/greaterthen.gif" alt="bullet" /><strong>  Welcome</strong></li>
<li>View License</li>
<li>Meet Requirements</li>
<li>Configure DB</li>
<li>Create Tables</li>
<li>Insert Data</li>
<li>Install Themes</li>
<li>Configure Board</li>
<li>Create Admin</li>
<li>Finish Setup</li>
</ul>
</div>
<div class="overlap">
<div class="rightside"><img src="images/checkmark.jpeg" alt="check" style="display:block; width: 70px; height:70px; float:left;" /><h2 style="float:left;">  Welcome</h2></div>
<div class="content"><p><br /><br /><br /><br /><br /><br />Welcome to the first step to installing your very own BBoardX Forums! When you are done with this easy setup, you will have a BBoardX style forum on your website.
</p>
<p>
Now that you have uploaded all the required files into your forum directory lets start the installation process. On the left hand side is a list of the steps in the installation process.
<br />
</p>
<p>When you are done each step in the installation process click the "Next" button to proceed.
</p>
<p>Click the "Next" button to continue the installation process</p>
<div class="button">
<form action="addcookie.php" method="post"><div>
<input type="submit" value=">> Next" name="step1"  />
</div>
</form>
</div>
</div>
</div>
</td>
</tr>
</table>
</body>
</html>';
}
else {
echo 'You fail';
}
?>

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.