Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML Formular redirects to XAMPP localhost Home-Page
    text
    copied!<p>So, here I am again with another Problem -.-'</p> <p>I programmed my own php/html script to give in and pass data from a form to a database. At the beginning it worked. Somehow, some days later it started redirecting me to the XAMPP localhost homepage (http://localhost/xampp/). I've got no idea why :/</p> <p>Here's how my website looks like:</p> <ul> <li>index.php <ul> <li>all other scripts (via Switch-case)</li> <li>including my guestbook-scripts (no switch-case!) It's always there!</li> </ul></li> </ul> <p>Here's how my "addguestbook.php" looks like:</p> <pre><code> &lt;?php ...database stuff... if ($_SERVER['REQUEST_METHOD'] == 'POST'){ $name = $_POST['name']; $email = $_POST['email']; $website = $_POST['website']; $comment = $_POST['comment']; $datetime = date("l, jS M Y, g:i a"); //date time // Connect to server and select database. mysql_connect($host, $username, $password)or die("cannot connect server: ".mysql_error()); mysql_select_db($db_name)or die("cannot select DB: ".mysql_error()); $sql="INSERT INTO ".$tbl_name."(id, name, email, website, comment, datetime)VALUES('".$post_id."', '".$name."', '".$email."', '".$website."', '".$comment."', '".$datetime."')"; $result=mysql_query($sql); mysql_close(); header('Location: http://'.$hostname.$path.'/index.php' . $get, true, 303); }?&gt; &lt;form action="index.php&lt;? echo $get; ?&gt;" method="post"&gt; &lt;table border="0" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td class="guestbookFormCell" colspan='2'&gt;&lt;input class="guestbookInputFieldText" name="name" type="text" value="Name *" size="40" maxlength="30" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="guestbookFormCell" colspan='2'&gt;&lt;input class="guestbookInputFieldText" name="email" type="text" value="E-Mail (won't become displayed)" size="40" maxlength="40" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="guestbookFormCell" colspan='2'&gt;&lt;input class="guestbookInputFieldText" name="website" type="text" value="Website" size="40" maxlength="50" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="guestbookFormCell" colspan='2'&gt;&lt;textarea class="guestbookInputFieldText" name="comment" cols="37" rows="5"&gt;Comment *&lt;/textarea&gt; &lt;/td&gt; &lt;/tr&gt; &lt;!-- &lt;tr&gt; &lt;td&gt;CAPTCHA&lt;/td&gt; &lt;/tr&gt; --&gt; &lt;tr&gt; &lt;td&gt;&lt;button class="guestbookFormCell guestbookButton" type="submit" name="submit"&gt; &lt;span class='guestbookButtonText'&gt;Send&lt;/span&gt; &lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;button class="guestbookFormCell guestbookButton" style="float:right;"type="reset" name="reset"&gt; &lt;span class='guestbookButtonText'&gt;Reset&lt;/span&gt; &lt;/button&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>in index.php:</p> <pre><code> $get = "?mod=home"; </code></pre> <p>This script is used for several stuff: overall gueastbook of the page and for comments on single posts &amp; pictures/albums.</p> <p>PS: i couldN't write hello at the beginning of the thread, for some reason :/ If that came over rude, i'm sorry!</p> <p>PSS: Got the error.</p> <p>Pretty dumb :)</p> <p>I simply forgot that the forum is actually redirecting to (in this case) index.php in the root-directory. That means to Xampp/htdocs/index.php.</p> <p>I just gotta fix the link and I'm fine -.-'</p>
 

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