Jump to content

justAnoob

Members
  • Posts

    561
  • Joined

  • Last visited

    Never

Everything posted by justAnoob

  1. Does anyone know of any good tutorials or examples to learn how to create a php mysql search engine.. Just something simple(I hope).. I have 2 columns in 1 table that I want to search...The search would take whatever words entered in the search box,, and then it would display any of the rows that had those keywoards in the 2 columns that I want to search... Is that simple or no?
  2. That was a joke kind of.... I was just stating that the PHP section gets more attention... Sorry for the misunderstanding.
  3. Thanks,, I'll never get a reply in the javascript board.
  4. the code below works,, except for the size of the window that opens... It opens as a full screen browser window,,,I don't want that. <?php echo '<a href="' . $row['imgpath'] . '" onClick="window.open("'.$row['imgpath'].'", width=350, height=350); return false"> <img src="' . $row['imgpath'] . '" width="150" alt="" border="0"></a>'; ?>
  5. ok,,, i can click the empty picture to now see my picture in another window... but the empty picture should be my picture that I'm clicking on.
  6. alright,, i got this to work,, but my width and height of my page is not working.
  7. <?php echo '<a href="' . $row['imgpath'] . '" //197 onClick="window.open(\'".$row['imgpath']."\', width=350, height=350); return false"> //198 <img src="' . $row['imgpath'] . '" width="150" alt="" border="0"></a>'; //199 ?> error on line 198 expecting , or ; this is what I got before.
  8. <?php echo '<a href="' . $row['imgpath'] . '" onClick="window.open(' . $row['imgpath'] . '', width=350, height=350); return false"> <img src="' . $row['imgpath'] . '" width="150" alt="" border="0"></a>'; ?> These quotes and double quotes really get to me sometimes... Can someone help out?
  9. anyway to do this with php, I'm not good with javascript.
  10. I have an echo statement that displays a picture. <?php echo '<img src="' . $row['imgpath2'] . '" width="150" alt="" />'; ?> What I would like to is have the picture clickable(no problem there) and then open itself up a new popup window with a bigger size of the picture. How would I go about opening the new window. I do not want it to be a new full size browser window, just like an alert window that is big enough for the picture. Maybe a width of 600 or so.
  11. Will you be on tomorrow?,, maybe so we can figure this out.. Need to put my kid to sleep.
  12. Wow,, that is a new one for me,, never seen anything like that before. I'll give it a shot.. Could you explain what that does,, I mean I get the idea,, but what the characters mean (m)
  13. did you get my last post where i said i messed up.. I'm working with 2 tables
  14. Ok,,, this is what I got now,, and it keeps returning a "1",,, when I know that now I have "2" NEW messages. <?php session_start(); include "connection.php"; $krazycool = intval($_SESSION['id']); $sql_1="SELECT id FROM members WHERE username = '$krazycool'"; $result_1=mysql_query($sql_1) or die(mysql_error()); $go_cavs = $result_1; $sql="SELECT COUNT(*) as count FROM member_messages WHERE user_id = '$go_cavs'"; $result=mysql_query($sql) or die(mysql_error()); $count = mysql_num_rows($result); if($count >= 1) { echo $count; } else { echo "Not yet."; } mysql_close(); ?>
  15. crap,, i messed up,, session id is the username not the id of the username
  16. string(65) "SELECT COUNT(*) as count FROM member_messages WHERE user_id = '0'" string(1) "0"
  17. I put it back the way you had it and the result is the same from what I last posted... How does yours work without the curly brackets? I though you needed them. <?php session_start(); include "connection.php"; $krazycool = intval($_SESSION['id']); $sql="SELECT COUNT(*) as count FROM member_messages WHERE user_id = '$krazycool' AND status='NEW'"; $result=mysql_query($sql) or die(mysql_error()); if($row = mysql_fetch_assoc($result)) var_dump($row['count']); // no curly's around var_dump???? else echo 'no results'; //no curly brackets around the echo ??? mysql_close(); ?>
  18. ////////////// this is what I get now string(1) "0" <?php session_start(); include "connection.php"; $krazycool = intval($_SESSION['id']); $sql="SELECT COUNT(*) as count FROM member_messages WHERE user_id = '$krazycool' AND status='NEW'"; $result=mysql_query($sql) or die(mysql_error()); if($row = mysql_fetch_assoc($result)) { var_dump($row['count']); } else { echo 'no results'; } mysql_close(); ?>
  19. lol,, that is the change that I made also.. give me a couple minutes.
  20. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE status='NEW'' at line 1
  21. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource on line 271 no results
  22. string(3) "NEW" string(0) "" is what is says.... I checked mysql and right now I have 2 messages in my table,, and one of them is marked as NEW
  23. i echoed out both variables,,, $count and $krazycool.... my count keeps coming back as 0... I know that there is 1 new message in the inbox.... in mysql table the column called status keeps the record called "NEW" in it if the message is new... So what is going on? <?php // it is not reading the status column correctly for some reason $sql="SELECT id FROM member_messages WHERE user_id = '$krazycool' and status = 'NEW'"; ?>
  24. The echo messages explains what I'm trying to do. Why are the simple things so difficult for me.... I think I over think them. <?php error_reporting(E_ALL); ini_set('display_errors',1); include "connection.php"; $krazycool = $_SESSION['id']; $sql='SELECT id FROM member_messages WHERE user_id = "$krazycool" and status = "NEW"'; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count >= 1) { echo "You have " . $count . " new messages."; } mysql_close(); ?>
  25. Is this secure enough for a registration script??? Or should I do more to it??? I'm new to the whole security thing and not really sure what I should be looking for. <?php session_start(); include ("connection.php"); $username = mysql_real_escape_string($_POST["username"]); $sql="SELECT * FROM $tbl_name WHERE username = '$username'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count > 0) { $_SESSION['duplicate'] = "<font color=red> This username is already registered. Please try again."; header("location: http://www.--------.com/----------.php"); exit(); } else { $username = mysql_real_escape_string($_POST["username"]); $password = md5($_POST["password"]); $email = mysql_real_escape_string($_POST["email"]); $fname = mysql_real_escape_string($_POST["fname"]); $lname = mysql_real_escape_string($_POST["lname"]); $address = mysql_real_escape_string($_POST["address"]); $city = mysql_real_escape_string($_POST["city"]); $state = mysql_real_escape_string($_POST["state"]); $zipcode = mysql_real_escape_string($_POST["zipcode"]); $country = mysql_real_escape_string($_POST["country"]); $sql = "INSERT INTO $tbl_name(username, password, email)VALUES('$username','$password','$email')"; mysql_query($sql) or die(mysql_error()); $_SESSION['goodreg'] = "<font color=white>Thank you for registering $username. You may now log in."; sleep(3); header("location: http://www.--------.com/--------.php"); exit(); mysql_close(); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.