Jump to content

justAnoob

Members
  • Posts

    561
  • Joined

  • Last visited

    Never

Everything posted by justAnoob

  1. sorry guys,, the line was correct,, a different line had an error... my bad...
  2. <?php if( (empty($row['imgpath4'])) and (!empty($row['imgpath3'])) and (!empty($row['imgpath2'])) ) ?> Can't seem to make this work...I'm sure I'm doing this wrong..Is there another way?
  3. Think I got it Ken2k7,, something similar to what you have just posted... Let you know in a while.
  4. I am including the connection.php which connects.
  5. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in something is wrong with the synyax in the print line yes,,, i changed to crazy looking single quotes to regular single quotes..
  6. trying to delete the image path from mysql..... It deletes it from the server directory but it won't delete the path from mysql... <?php //error_reporting(E_ALL); //ini_set('display_errors',1); session_start(); require 'connection.php'; $id_gone = $_SESSION['move_id']; //id of image $image5 = $_SESSION['path_5']; //path to image unlink($image5); mysql_query("DELETE imgpath5 FROM abcxyz WHERE id = '$id_gone'"); echo "image deleted."; echo "$id_gone"; //both variables echo,, so I know there working. echo "$image5"; ?> I tried using different variables(the 2 above) after the WHERE in the query to make it work,, but nothing.
  7. I have a table in mysql with a row called name and and row called description.... If I do my homework,, will I be able to create a simple search engine that will search the name and description row for whatever keywords were entered in the search. And then display all the records that had the keywords either in the name or description??? The only reason I ask,, is because I read that the database must be setup properly for a search engine.. Is that true,, or will I be able to do what I want??
  8. Why do all the PHP clock scripts I see are always 3 hours off??? I'm sure it is a time zone thing,, but are there any good ways to just show the time that is on the users pc???
  9. Would I pass the name of the category through the URL and then retrieve the name so I could use it in the mysql statement for pulling information?
  10. Hi..... I have a category box with categories listed in text like so Category Selection category 1 ---$category1 = cat1 category 2 ---$category2 = cat2 category 3 category 4 category 5 Each category pulls info from mysql and displays it. And each category has its own page.....category1.php category2.php, category3.php,,, and so on....What I'm looking to do is just have 1 php page that could display all the categories, depending which one the user clicks on... I guess my question is how do I create a variable off of some text that has a link attached to it...Look above at the categories to see what I mean.
  11. Notice: 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 '' at line 1 ............ the commented line below... Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in .....comment below also. <?php include "connection.php"; mysql_connect("$host", "$username", "$password") or die("Could not connect."); mysql_select_db("$db_name") or die("Could not find database"); $query = "SELECT id, user_id, category, imgpath, imgpath2, imgpath3, imgpath4, imgpath5, item_name, description, in_return FROM abcxyz WHERE id = ".$_GET['id']; $result = mysql_query($query) or trigger_error(mysql_error()); ///////// echo "<table width='954' border='0' align='center' cellpadding='0' cellspacing='0' bordercolor='#000000' bgcolor='#BBD4E1'>"; while($row = mysql_fetch_assoc($result)) ///////// second error { echo "<table width='954' border='0' align='center' cellpadding='0' cellspacing='0' bordercolor='#000000' bgcolor='#BBD4E1'>"; echo "<tr><td width='188' height='180'><div align='center'>"; echo '<img src="' . $row['imgpath'] . '" width="125" alt="" /><font color="red"> X'; ?>
  12. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in D:\Hosting\3388298\html\viewitem.php on line 175 <?php include "connection.php"; mysql_connect("$host", "$username", "$password") or die("Could not connect."); mysql_select_db("$db_name") or die("Could not find database"); $found_id_main = mysql_real_escape_string($_GET['id']); $query = "SELECT id, user_id, category, imgpath, imgpath2, imgpath3, imgpath4, imgpath5, item_name, description, in_return FROM abcxyz WHERE id = '$found_id_main'"; $result = mysql_query($query); echo "<table width='954' border='0' align='center' cellpadding='0' cellspacing='0' bordercolor='#000000' bgcolor='#BBD4E1'>"; while($row = mysql_fetch_assoc($result)) { echo "<table width='954' border='0' align='center' cellpadding='0' cellspacing='0' bordercolor='#000000' bgcolor='#BBD4E1'>"; echo "<tr><td width='188' height='180'><div align='center'>"; echo '<img src="' . $row['imgpath'] . '" width="125" alt="" /><font color="red"> X'; // continue echoing of table........... ?>
  13. Still getting error with this line while($row = mysql_fetch_assoc($result))
  14. I know I'm missing something somewhere??? What is it??? No info is displayed from mysql. <?php include "connection.php"; mysql_connect("$host", "$username", "$password") or die("Could not connect."); mysql_select_db("$db_name") or die("Could not find database"); $query = "SELECT id, user_id, category, imgpath, imgpath2, imgpath3, imgpath4, imgpath5, item_name, description, in_return FROM abcxyz WHERE id = ".$_GET['id']; $row = mysql_query($query); echo "<table width='954' border='0' align='center' cellpadding='0' cellspacing='0' bordercolor='#000000' bgcolor='#BBD4E1'>"; echo "<tr><td width='188' height='180'><div align='center'>"; echo '<img src="' . $row['imgpath'] . '" width="125" alt="" /><font color="red"> X'; ////// TABLE CONTINUES ON,,NO NEED TO SHOW ALL... ?> The script is inside a form.
  15. This is really strange, or maybe it is something I do not know about... Here is the link on my homepage that takes my to the page that I'm having problems with. <?php echo substr($row['description'],0,50).'<a href="http://------.com/viewitem.php?id_main='.$row['id'].'"> ...View</a>'; ?> With the code above,,, even when I'm signed in and click on the link,, it takes me to the page but as I mentioned earlier in this thread,,, it still shows the log in form... Now check out the code below.... <?php echo '<a href="viewitem.php"><img src="images/my_btn.png" width="91" height="20" border="0">'; ?> Now if I just put in a picture with a link to replace the original code above,, it takes me to the page just fine with no problems.. What is causing the problems with the first line of code???
  16. Here is the problem page form. <form id="form1" name="form1" method="post" action="login.php"> <div align="center"> <div align="center"> <?php if(!isset($_SESSION['auth'])) { echo ($_SESSION['message']); } ?> <?php if(isset($_SESSION['goodreg'])) { unset($_SESSION['message']); echo ($_SESSION['goodreg']); } ?> <br> <?php if(isset($_SESSION['auth'])) { unset($_SESSION['message']); sleep(3); echo ($_SESSION['goodlog'] . '<a href="logout.php">Log out'); } else { echo '<form name="form1" method="post" action="login.php"> <input name="username" type="text" id="username" /> <input name="password" type="password" id="password" /> <input type="submit" name="submit" id="submit" value="Login"> </form>'; } ?> <br /> </div> </div> </form> And here is the form from the homepage and all the other pages that work fine. <form id="form1" name="form1" method="post" action="login.php"> <div align="center"> <div align="center"> <?php if(!isset($_SESSION['auth'])) { echo ($_SESSION['message']); } ?> <?php if(isset($_SESSION['goodreg'])) { unset($_SESSION['message']); echo ($_SESSION['goodreg']); } ?> <br> <?php if(isset($_SESSION['auth'])) { unset($_SESSION['message']); sleep(3); echo ($_SESSION['goodlog'] . '<a href="logout.php">Log out'); } else { echo '<form name="form1" method="post" action="login.php"> <input name="username" type="text" id="username" /> <input name="password" type="password" id="password" /> <input type="submit" name="submit" id="submit" value="Login"> </form>'; } ?> <br /> </div> </div> </form>
  17. That is the problem,, there really isn't one,, the code is identical....The strange thing is that the log in form appears on the page that is having the problem, so I sign in again and it returns me to the homepage. Then if I click on the link again to go back to the problem page, everything is ok... So the scripts only work when I sign in from the problem page.
  18. It always shows the log in form(on my problem page) even if I signed in back at the hompage. But all the other pages have this exact same code and they function just fine.
  19. This script works on all my pages on the site I'm working on....except for 1 page... I don't understand why... Yes,, I have session_start(); at the top of the page. I know this is not in detail,, but maybe someone has had the same prob.. <?php if(isset($_SESSION['auth'])) { unset($_SESSION['message']); sleep(3); echo ($_SESSION['goodlog'] . '<a href="logout.php">Log out'); } else { echo '<form name="form1" method="post" action="login.php"> <input name="username" type="text" id="username" /> <input name="password" type="password" id="password" /> <input type="submit" name="submit" id="submit" value="Login"> </form>'; } ?>
  20. <?php $sql = "DELETE * FROM xxxxxx WHERE id = '$variable'"; $result = mysql_query($sql); ?> If a user has the ability to click on a button to delete a record, is there such a thing as having an unsecure php file that does the deletion??? What should I look for???
  21. UPDATE works out good... Any downside to using it???
×
×
  • 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.