-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
your query syntax is a little off: $query="INSERT INTO sections (name) VALUES (".$name.") WHERE id= ".$idnum."; also append your $results line so it reads: $result = mysql_query($query) or die (mysql_error); remember and keep an eye on your line terminators ( ; )
-
This would work better: <?php echo "<tr>" while ($row_cart = mysql_fetch_assoc($cart)) { echo "<td>".$row_cart['id']."</td>" echo "<td>".$row_cart['photo_id']."</td>" echo "<td>".$row_cart['sess_id']."</td>" echo "<td>".$row_cart['photo_name']."</td>" echo "<td>".$row_cart['photo_price']."</td>" $total = $total + $row_cart['photo_price']; } echo "</tr>" ?> the syntax error you had was a ; in the while line that shouldn't be there : <?php }while ($row_cart = mysql_fetch_assoc($cart)); {
-
try this for the connection.php error: if($result = mysql_query('SELECT uname, forums, rights FROM '.$prefix.'users WHERE uname=\''.$_SESSION['user']}'\')'); if the connection doesn't work, your user authentication will perma-fail. index.html: <?php session_start(); include "includes/connect.php"; echo "Test"; if(isset($_SESSION['user'])){ echo "Logged In User"; } else { echo "<br><br><b>You have to be logged in..</b><br><br>"; } ?> try to avoid chopping in and out of <?php?> tags as much as possibe, it just ends up confusing things later on. Keep the updates comming
-
Yes, yours the HTML was fine, but i changed the javascript as well. showoff
-
you also need to delete the closing } from the while as well (line 51 I think)
-
ok, try this : <?php session_start(); if(!isset($_SESSION['username'])) { header("location:main_login.php"); } ?> <table width="800" border="0" align="center"> <tr> <td colspan="2" bgcolor="#402E16"> </td> </tr> <tr> <td width="200" bgcolor="#402E16"><img src="images/Header-redo3.jpg" width="200" height="100" alt="Header" /></td> <td width="590" bgcolor="#402E16"><?php $con = mysql_connect("127.0.0.1","xxxx","xxxxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("SNO1", $con); $result = mysql_query("SELECT shinobi FROM Basic WHERE id = ".$_SESSION['id']) or die (mysql_error()); $row = mysql_fetch_assoc($result); if ($row['shinobi'] > 0) { echo "<strong>Congratulations ".$_SESSION['username'].". You still have ".$row['shinobi']." days left as Shinobi</strong>"; } else { echo "[".$_SESSION['id']."] ".$_SESSION['username']; } ?></td> </tr> </table>
-
can you give us an example of the code you have?
-
right then, In your connect.php you have the lines DEFINE ('DB_NAME', 't');// Insert your actual database name in the quotes. $con = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); //$con = mysql_connect(':/tmp/mysql', $dbuser, $dbpass); if (!$con) { header("Location: install/install.php"); } mysql_select_db($db ,$con); now you deffine your database to DB_NAME but never assign DB_NAME tothe $db in your database selection. See what happens when you try this: DEFINE ('DB_NAME', 't');// Insert your actual database name in the quotes. $con = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); //$con = mysql_connect(':/tmp/mysql', $dbuser, $dbpass); if (!$con) { header("Location: install/install.php"); } mysql_select_db(DB_NAME ,$con);
-
ok, my bad. When I said you don't need to select * I should have said to specify the columns that you do need: $r = mysql_query('SELECT username, password, id, mail FROM sitelist WHERE username=\'' . realEscape($_POST['username']) . '\' AND password=\'' . md5($_POST['password']) . '\'') or die(mysql_error()) ; that should get us back to the original problem. Let us know what you get this time.
-
what values are stored in the "Basic.shinobi" column in the database?
-
So you have the login and authentication already done some place else?
-
before I re-code this, what is your obgective here? is this a login script that shows a different output for those that are "Shinobi" or is it simply to identify if an already authenticated user is a "Shinobi"?
-
Error check your query by adding or die (mysql_error) at the end of your mysql_query line (but before the , remove the while loop unless you plan on having users with the same name on your forum, don't select * you don't need to, put an else befor the { here { echo "Username or Password is incorect!"; let us know what the SQL error is.
-
Your welcome and it's often easy to over complicate things in cases like this (unless your simple like me )
-
Assuming the permissions are right on the htaccess file, then theory would dictate yes. However you are talking about a major security vulnrability if you set the httpd account with that permission level on your htaccess file.
-
Reverse your principle. Make a new column and call it "Parent"...assign the single executor ID to each of the children rather than multiple child ID's to the executor.
-
Ahhh...no, not the case. as php is server side it defaults to running with the same permissions that your httpd account has on a given directory. I thought that you weere looking to have php modify the htaccess file at run time to allow said user to upload and then re-apply viewing restrictions afterwords. p.s. Retreving images from a database is just as efficient than using flat files. Just so you know
-
weird problem with two strings being equal
Muddy_Funster replied to jeff5656's topic in PHP Coding Help
likely extra whitespace and/or special characters returned from the database. -
so the code I posted didn't work then?
-
weird problem with two strings being equal
Muddy_Funster replied to jeff5656's topic in PHP Coding Help
what do you get if you use if(trim($result['t3']) == trim($_POST['t3'])) { -
try this: echo ' <input type="image" src="../b_drop.png" onclick="disp_confirm(\''.$companyid.'\')"> \n';
-
Cant get PHP form script to work Please Help
Muddy_Funster replied to simon71's topic in PHP Coding Help
the submit button took me to the desired page, did you refresh your browser? However the page is still blank, can you turn error reporting to E_all? -
That will do it most every time. Especialy if it's 2007/2010. test some non c&p messages and see what happens
-
Cant get PHP form script to work Please Help
Muddy_Funster replied to simon71's topic in PHP Coding Help
I can navigate directly to http://www.iter-research.co.uk/form/sendmail.php and it loads (blank page but that's to be expected). have you tried: action="../form/sendmail.php"