curbsy
-
Posts
10 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by curbsy
-
-
Login Check.
in PHP
does it really have to be that? why can't I have 'http://www.rl6.org/~curbsy/include/session.php'?As I said before, it will always return as the error. Even if I'm logged in it says I'm not."./include/session.php" -
Login Check.
in PHP
<?phpinclude("http://www.rl6.org/~curbsy/include/session.php");if($session->logged_in){?>*content*<?php} else {?>*error message*<?php}?>I'm using this to decided whether or not a user is logged in and to display the proper results. It always returns as the error message though. Does anybody know why...?
-
It didn't work. Anybody else have ideas?
-
index.php
action.php<?php$username = 'curbsy';$password = 'Removed';$hostname = 'localhost';$dbh = mysql_connect($hostname, $username, $password) or die('Unable to connect to MySQL');print 'Connected to MySQL<br><br>';$selected = mysql_select_db('curbsy',$dbh) or die('Could not select to selected database');$result = mysql_query( "SELECT * FROM people" )or die("SELECT Error: ".mysql_error());$num_rows = mysql_num_rows($result);print "There are $num_rows records.<P>";print "<table width=200 border=1>\n<tr><td><font face=arial size=1/>Edit Number:</font></td><td><font face=arial size=1/>First Name:</font></td><td><font face=arial size=1/>Last Name:</font></td><td><font face=arial size=1/>Age:</font></td></tr>";while ($get_info = mysql_fetch_row($result)){ print "<tr>\n";foreach ($get_info as $field) print "\t<td><font face=arial size=1/>$field</font></td>\n";print "</tr>\n";}print "</table>\n";mysql_close();?><html><head><title>People Database</title></head><body><br /><br />Edit The Database<form action='action.php' method='post'>Edit Number: <input type='text' name='num' /><br />First Name: <input type='text' name='fname' /><br />Last Name: <input type='text' name='lname' /><br />Age: <input type='text' name='age' /><br />Password <input type='password' name='pword' /><br /><input type='submit' value='Submit' /></form></body></html>
Can anybody tell me why this doesn't update properly?<?php// Variables$num = $_POST['num'];$fname = $_POST['fname'];$lname = $_POST['lname'];$age = $_POST['age'];$username = 'curbsy';$pass = $_POST['pword'];$hostname = 'localhost';$dbh = mysql_connect($hostname, $username, $pass) or die('Unable to connect to MySQL');print 'Connected to MySQL<br><br>';$selected = mysql_select_db('curbsy',$dbh) or die('Could not select to selected database');// Add Person To Database$result = mysql_query("UPDATE people SET fname = '$fname', lname = '$lname', age = '$age' WHERE num = '$num'");mysql_close();echo "<a href='http://www.rl6.org/~curbsy/db/index.php'>Back To Database</a>";?> -
Sessions...
in PHP
Ok, I'm having some troubles with sessions. I don't really understand how they work at all. Can somebody help me on this?
-
-
I didn't know there was anything other than *.php...
-
I did happen to get this fixed:<?php//Importinclude ("dbhndl.php");//Re-assign$name=$_POST['uname'];$pass=$_POST['pword'];$db="curbsy";$link = mysql_connect("localhost", "curbsy", "emerson");if (! $link)die("Couldn't connect to MySQL");mysql_select_db($db , $link)or die("Couldn't open $db: ".mysql_error());mysql_query ("INSERT INTO users (u_id, u_name, u_pswd, u_ses_id) VALUES (NULL, '$name', '$pass', NULL)");mysql_close($link);?>
-
regproc.php:
(01) <?php(02) //Import(03) include ("dbhndl.php");(04)(05) //Make user(06) mysql_query(INSERT INTO "users" (07) ("u_id", (08) "u_name", (09) "u_pswd", (10) "u_ses_id") (11) VALUES ("null", (12) "$_POST['uname']", (13) "$_POST['pword']", (14) "null"));(15)(16) echo "<meta http-equiv='refresh' content=1;URL=index.php>";(17) ?>
Error: Parse error: parse error, unexpected T_STRING in /home/users/curbsy/public_html/login/regproc.php on line 6
Login Check.
in PHP
Posted
...and help with this? I really want this to work.