Note that there are some explanatory texts on larger screens.

plurals
  1. POMy PHP is working locally, but not on 1and1 server
    primarykey
    data
    text
    <p>I have tested the following script locally on my machine and everything works perfectly the way I want it. However, when I upload my files to my server at 1and1, on the log-in script when I click the "submit" button, it just stays on the log-in screen.</p> <p>I'm also not sure, but perhapes the problem isn't with sessions, but with use of my header function.</p> <pre><code>&lt;?php session_start(); require ("login.php"); include ("header.php"); include ("subnav.php"); if ((isset($_SESSION['user'])) &amp;&amp; (isset($_SESSION['admin']))) header('Location: admin/index.php' ); if ((isset($_SESSION['user'])) &amp;&amp; (!isset($_SESSION['admin']))) header('Location: customer/index.php' ); if ((isset($_GET['logout'])) == 1) { session_destroy(); header('Location: index.php'); } if (isset($_POST['submit'])) if($_POST['username'] == 'jay') { $_SESSION['user'] = 'jay'; $_SESSION['admin'] = 1; header('Location: admin/index.php' ); } else if ($_POST['username'] == 'william'){ $_SESSION['user'] = 'william'; header('Location: customer/index.php' ); } else { header('Location: http://www.google.com' ); } ?&gt; &lt;h2&gt;System Log-In&lt;/h2&gt; &lt;form action="" method="post"&gt; &lt;ul id="login"&gt; &lt;li&gt; Username: &lt;br&gt; &lt;input type="text" name="username"&gt;&lt;/li&gt; &lt;li&gt; Password: &lt;br&gt; &lt;input type="password" name="password"&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="submit" value="Log-In" name ="submit" id="submit"&gt; &lt;/li&gt; &lt;li&gt; &lt;br&gt;&lt;a href=#&gt;Register Here.&lt;/a&gt; &lt;/li&gt; &lt;li&gt; If you are having problems with the log-in process, please send us an &lt;a href="mailto:here@here.us"&gt;e-mail&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt; &lt;/form&gt; &lt;?php include ("footer.php"); ?&gt; </code></pre> <p><img src="https://i.stack.imgur.com/2bhDq.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload