| SitePoint Sponsor |



well, i get this for localhost/index.php
array (size=0)
empty
SESSION ID IS EMPTY
and the normal displays for login.php, pass.ph, and reset.php, and finally when i entered passwords on reset.php (with the var-dumps) i got this
array (size=1)
'id' => null
SESSION ID IS EMPTY


can you show me your current reset.php file? I'm assuming it has a require("../includes/config.php"); in it and that is above the session usage.

well, i copied some of the contents of config.php as follows on top....
Code:<?php // display errors, warnings, and notices ini_set("display_errors", true); error_reporting(E_ALL); // configuration require("../includes/constants.php"); require("../includes/functions.php"); session_start(); // if form was submitted if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["password"])) apologize("Please enter password."); if ($_POST["password"] != $_POST["confirmation"]) apologize("Passwords do not match!"); $result = query("UPDATE users SET hash = ? WHERE id = ?", crypt($_POST["password"]), $_SESSION["resetmemberid"]); unset($_SESSION["resetmemberid"]); if($result===false) { apologize("Could not register. Please retry."); } else { $rows = query("SELECT id FROM users WHERE hash = ?", crypt($_POST["password"])); $id = $rows[0]["id"]; // remember that user's now logged in by storing user's ID in session $_SESSION["id"]= $rows[0]["id"]; // redirect to portfolio redirect("index.php"); // require authentication for most pages if (!preg_match("{(?:login|logout|register)\.php$}", $_SERVER["PHP_SELF"])) { if (empty($_SESSION["id"])) { die("SESSION ID IS EMPTY"); redirect("login.php"); } } } } else { // else render form render("reset_form.php", ["title" => "Register"]); } ?>

Hello! you there?? i screwed up in my html validation from http://validator.w3.org/, it says
Line 46, Column 6: Stray end tag div.
</div>
Line 46, Column 6: Stray end tag div.
</div>
Line 47, Column 5: Start tag div seen in table.
<div>
Line 47, Column 5: Cannot recover after last error. Any further errors will be ignored.
<div>
can you please take a look??
Code:<!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet"/> <link href="css/bootstrap-responsive.css" rel="stylesheet"/> <link href="css/styles.css" rel="stylesheet"/> <title>C$50 Finance: Portfolio</title> <script src="js/jquery-1.8.2.js"></script> <script src="js/bootstrap.js"></script> <script src="js/scripts.js"></script> </head> <body> <div class="container-fluid"> <div id="top"> <a href="/"><img alt="C$50 Finance" src="img/logo.gif"/></a> </div> <div id="middle"> <div> <table class="table table-striped"> <thead> <tr> <th>Symbol</th> <th>Name</th> <th>Shares</th> <th>Price</th> <th>TOTAL</th> </tr> </thead> <tbody> </tbody> </div> <div> ////////////////////////////////////////////////////////////////////lLINE 46 <a href="quote.php">Quote</a> //////////////////////////////////////////LINE 47 <a href="buy.php">Buy</a> <a href="sell.php">Sell</a> <a href="history.php">History</a> <a href="logout.php">Log Out</a> </div> </div> <div id="bottom"> Copyright © John Harvard </div> </div> </body> </html>


You are missing your closing table tag (right after the closing </tbody> tag.

Thanks budd, all green...i was wondering if there are any websites out there, that display their php codes, or even java or html so that people can like learn from them, and build something similar??


You can always host it on SourceForge, GIT, CodePlex, and other repo related sites.

thanks, i knew of source forge, and i visited it once, but it looked more like a software website where people shared their softwares, but couldnt find any websites...


Bookmarks