ober
Staff Alumni-
Posts
5,327 -
Joined
-
Last visited
Everything posted by ober
-
Sorry, I meant to put UPDATE, not INSERT. My syntax is correct otherwise... see corrections above.
-
if ($num != 0) { // A matching row found (thus the name/pass found) - authenticated session_start(); list($efirst_name) = mysql_fetch_row($result); $_SESSION['user'] = $eemail; header("Location: calendar.php?msg=Logged In"); } else header("Location: login.php?msg=Invalid Login");
-
http://www.phpfreaks.com/tutorial/php-basic-database-handling
-
<?php if (isset($_GET['msg'])) { echo "<div class=\"msg\">".$_GET['msg']."</div>"; } ?> When they get redirected, do you at least see the error message in the URL?
-
Please show us more of the code so we can understand it better.
-
You can't do "AND" in an insert. $sql = "UPDATE tablexyz SET value1 = '$x', value2 = '$y' WHERE id = '{$mem['id']}' or die(mysql_error());
-
1) Don't use short tags, maybe your server doesn't recognize them. Short tags are <? anything ?>. Use <?php whatever ?> 2) If this is truly an HTML file, file.html or file.htm will not process PHP unless the server is setup to do so (not likely). Make sure the file is called "file.php".
-
There has to be more to it than that. Your array is $ddiArray2, but you are trying to sort "$dataArray"... ???
-
You're joking... right? Tell me you're joking. Please. I don't want to delete this thread only because it's really the most ridiculous question ever.
-
nah man, don't be seduced by that line of reasoning. After nuclear fallout, there'll be zombies everywhere. You can't be running from them when you're all fat and shit. They'll just catch you and eat you and take forever to do it and you'll just have to sit there all that much longer. BWHAHAHAHA... I should read the misc board more often. QUOTED!
-
I'm surprised that one even works. You should have single quotes around 'yes'. Don't use empty, it is generally bad practice. Did you know that the string "0" is considered empty? Use: if($weight != '') { // whatever } And for God's sakes, clean your data!
-
Store a "logged in" variable in your session or cookie (wherever you store you login info). If the user is not logged in, redirect (header) the user to the login page and store the link they were going to in a field on the login form. When they login, redirect them again to the page they were going to.
-
Well, you don't have to echo the variable per-se... just set it to a class variable and then: print_r(get_object_vars($class), true); After the class is initiated.
-
Is it not doing that right now? What you have looks ok to me.
-
So if you take the quotes out, does it work? Can you echo the contents of what is passed to see if it is actually getting anything?
-
You are probably opening the new site "within" the old site. Make sure that you either break out of the frame or open the new site in a completely new page. Also keep in mind that frames are completely client-side and should not affect session handling. The only problem would be is if you include or open a page within a page where sessions are already started.
-
That is perfectly legit.
-
One more thing... move session_start out of the constructor. SESSION is a global array. I would never start my session inside a class, but that's just me.
-
The value is being passed to the constructor.
-
if(!include("$settings_file")) Should be: if(!include($settings_file)) No quotes... it's a variable, not a string.
-
2 things: 1) Why can't you use if-else? 2) If you're going to use LIKE in your SQL statement, surround the value with %: $query = "SELECT * FROM $table WHERE student_number LIKE '%".$_POST['txtSearch']."%'"; If this is a school assignment and you can't use if-else, you're probably looking for the ternary operator: http://us.php.net/operators.comparison
-
You'll want to look at the count function to determine how many elements are in the array which will then allow you to determine which links to show. You'll also need to read $_GET['art'] to determine the page you are on.
-
It is impossible to go from the form with the right value to the processing with the wrong value, so you are obviously passing the wrong ID.
-
".$board0['posts']." Why is there a 0 in there?