Jump to content

[SOLVED] session and syntax questions with @


johlwiler

Recommended Posts

Hey,

I have a page that the session_start() statement does not work unless I put a @ in front of it. I have seen in some tutorials where people do this not just in sessions but also in mysql calls. I have never had to use this in my code before and have just seen it around in a few other code. Does anyone the purpose of the @ symbol, or why it makes a difference? I couldn't really find an answer anywhere else so I am just straight up asking.

Link to comment
Share on other sites

so does that function still work. My sessions still seem to work, and I can't figure out why the session_start() the header could be sent before the session_start(); is this a common problem with session? is that why a lot if people using sessions do that.

 

Here is my code

 

<?php @session_start(); ?>



<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>World Properties Online</title>

<meta name="keywords" content="glossary,property,real estate,rental,commercial,sale,by owner" />
<meta name="description" content="Welcome to World Properties Online, your guide to property for sale around the world." />
<link href="wpo.css" rel="stylesheet" type="text/css" />


</head>
<body>
<div id="container">
  <div id="header">  </div>
  <div id="navigation">
     <ul id="navigation">   <li><a href="index.php">Home</a></li>
       <li><a href="listproperty.php">List Property</a></li>
       <li><a href="searchform.php">Search Properties</a></li>
       <li><a href="http://www.towd.com" target="_blank">Tourism Info</a></li>
       <li><a href="http://www.onlinenewspapers.com/" target="_blank">Newspapers</a></li>
       <li><a href="faq.php">FAQs</a></li>
       <li><a href="prices.php">Prices</a></li>
        <li><a href="glossary.php">Glossary</a></li>
        <li><a href="contactus.php">Contact Us</a></li>
        <li><a href="/blog/index.php">Blog</a></li>
    </ul>
  </div>
<?php
if(!isset($_SESSION['username'])){
  echo ("<div id='column'>

<form action='login.php' method='post' name='login' class='cmxform'>
<fieldset class='login'>
<legend>User Login</legend>

<ol>
<li>
<label for='username'>Username</label>
<input id='userName' name='userName' type='text' />
</li>
<li>
<label for='PW'>Password</label>
<input id='PW' name='PW' type='password' />
</li>
<input type='submit' class='submit'  value='Submit'/>
</ol>
</fieldset>
</form>");

}else{
echo("
<div id='column'>

<fieldset class='login'>
<legend>User Login</legend>
<ul>
<li>
<label for='username'>Logged in as ".$_SESSION['username']." </label>
</li>
<li>
<a href='logout.php'>Log Out</a>
</li>
<li ><a class='control' href='control/editprofile.php'>Edit Your Profile</a><br />
<a class='control' href='control/properties.php'>Manage Your Listings</a><br />
<a class='control'href='control/payment.php'>Pay For Listings</a></li>
</ul></fieldset>");

}

?>
   <ul id="related">   <li><a href="https://www.worldpropertiesonline.net/searches.php?cont=1"> 	

Africa</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=2">Asia</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=3">North 

America</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=4">South 

America</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=5">Cental 

America</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=6">Pacific 

Islands</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=7">Europe</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=8">Australia</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=9">Caribbean</a>
<li><a href="https://www.worldpropertiesonline.net/searches.php?cont=10">Other</a>

    </ul>
  </div>     
<div id="area">
    <div class="content"><h2>Welcome to World Properties</h2><a href="listproperty.php"><img class="float" src="images/getstarted.jpg" alt="" /></a>
<p>Welcome to World Properties Online, your virtual classifieds guide to property for sale, rent or lease around the world.  Our site is designed to provide property the widest possible exposure on the American and International market, in an effective and professional format.</p>

<p>Listing with us makes your property more accessible to individuals looking to buy, rent or lease property throughout the world.  It  also complements any local advertising campaigns you have, and for Real Estate Professionals, it provides greater exposure of the property worldwide.</p> 
<p>Together, we can achieve the results you desire!</p>
<a class="greylink" href="listproperty.php">Click here to get started listing your property...</a>

    </div>
  </div>
</div>
</body>
</html>


Link to comment
Share on other sites

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.