Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. You forgot your die() on this line $result = mysql_query($sql);
  2. Why would you want to suppress the errors instead of fixing them? Add a die statement to the end of each query EX $imgResult = mysql_db_query($db,$imgSQL,$cid)or die(mysql_error());
  3. The second query isn't right. So change this mysql_query($sql2 = "insert into `old` (`name`, `Continent`, `country`, `town`, `type`, `alltype`, `Email`, `Title`, `Abstract`, `Article`, `photo`) values ('$name', '$Continent', '$country', '$town', '$type', '$alltype', '$Email', '$Title', '$Abstract', '$Article', '$photo')"); To $sql2 = "insert into `old` (`name`, `Continent`, `country`, `town`, `type`, `alltype`, `Email`, `Title`, `Abstract`, `Article`, `photo`) values ('$name', '$Continent', '$country', '$town', '$type', '$alltype', '$Email', '$Title', '$Abstract', '$Article', '$photo')"; $query2 = mysql_query($sql2)or die(mysql_error()); Add die() statements to the end of all your queries $sql = "SELECT * FROM test WHERE id = '$abc'"; $result = mysql_query($sql)or die(mysql_error());
  4. Are you calling session_start() at the top of each page?
  5. You could sacrifice the personal touch using their username, and just put "Welcome Back!"...but that all depends on where exactly you use the $page_header variable. I'm not sure if there is another way to do it other than the ways you listed, and I'm not really liking either way. You could store their username in a cookie?
  6. Edit: Beat to it You need to change your clicking part to this <TR><TD WIDTH="225"><a href='editpost.php?id=<?PHP echo $row[0]; ?>'><?PHP echo $row[1]; ?>[/url]</TD><TD WIDTH="460"><?PHP echo $row[2]; ?></TD><TD WIDTH="70" align="center"><?PHP echo $row[3]; ?></TD></TR> Now on the page where you grabbing the information to edit, you would simply do this <?php $id = $_GET['id']; $query1 = "SELECT * FROM table WHERE commid = $id"; ?>
  7. If you remove the GROUP BY it's going to return the last 3 property_name's regardless if it has already displayed that property name already. Don't forget to press solved if you have it working how you want
  8. The reason I was avoiding sessions was that if they closed the browser, the session would be lost and there goes the download link. I guess they could set a cookie, although I'm not quite sure how secure that would be. Why change the download link? Just have the link become inactive after 5 minutes, no need to change it. Then the cron job can come through and delete all the entries that are 5 minutes+ old. They wouldn't even have to run the cron every 5 minutes, they could code the page to just give an error if it is more than 5 minutes old.
  9. So basically you want help figuring out how to make the links expire? Make a table in the database like this TABLE links ----------- linkID - Auto-increment, primary key key - this will be a unique ID for the url generated by the function uniqid() time_created - the time the link was created Now have your links look something like this www.domain.com/download.php?key=121w21e When the user clicks on that link, you need to check the database to check if there is a link that exists with that key and is less than 5 minutes old. Hopefully you get the idea. Just let me know if you need more explaining on something.
  10. Give this query a try SELECT propety_name, property_desc FROM property WHERE property_name= 'raffles' OR property_name='macao' OR property_name='zayed' ORDER BY date_created DESC GROUP BY property_name LIMIT 3
  11. And what's going to stop them from using multiple email addresses? I don't think so...
  12. Ah, just use a hidden form input. <input type="hidden" name="secret_key" value="something"> Then on the process page, check if they have it. <?php If (!isset($_POST['secret_key'])){ //They are cheating } else { //They used the form. } ?>
  13. Don't worry, it's hard for everyone to grasp things like this at first. Just keep practicing your PHP and it will all start becoming second nature to you. I remember being completely confused about the simplest things at first. So just keep pushing and it will start to click.
  14. Add something to the url that tells you if they were referred by the link. So make your link look like this <a href="test.php?link=yes"> Now on the page the link is to, do this <?php if (isset($_GET['link'])){ //set session } ?>
  15. Then you will want an UPDATE query instead of an INSERT one. You are going to have to add an auto-increment field though, or else you won't know the condition to update the table by. So add a field into that table called "friendID" or soemething, and make it an auto-increment and primary key. Now change your code to this: <?php header( 'refresh: 5; url=******' ); // Connects to your Database mysql_connect("localhost", "*****", "*****") or die(mysql_error()); mysql_select_db("*****") or die(mysql_error()); // Collects data from "friends" table $data = mysql_query("SELECT * FROM friends ORDER BY friendID DESC") or die(mysql_error()); // puts the "friends" info into the $info array $info = mysql_fetch_assoc($data); Print "Message: ".$info['name']; ?>
  16. Oh, okay...I see. Change the file you are reading it with to this <?php header( 'refresh: 5; url=******' ); // Connects to your Database mysql_connect("localhost", "*****", "*****") or die(mysql_error()); mysql_select_db("*****") or die(mysql_error()); // Collects data from "friends" table $data = mysql_query("SELECT * FROM friends") or die(mysql_error()); // puts the "friends" info into the $info array while ($info = mysql_fetch_array($data)){ // Print out the contents of the entry Print "Message: ".$info['name']."<p>"; } ?>
  17. Are you sure the php page is called "process.php"? What exactly is happening, are you getting a blank page, error, or what?
  18. You still didn't change this line Message: <input message="message" type="text" /> To Message: <input name="message" type="text" />
  19. You have a comma after your $name var in the query, shouldn't be there. You should also you mysql_real_escape_string() on all variables before insertion. Lastly, you should put a die error at the end of the query to catch errors. <?php // Open database connection mysql_connect("localhost", "*********", "**********") or die(mysql_error()); mysql_select_db("*******8") or die(mysql_error()); $name = mysql_real_escape_string($_POST['message']); // Insert data $query = "INSERT INTO friends (name) VALUES ('$name')"; $result = mysql_query($query)or die(mysql_error()); print "updated"; ?>
  20. It's because they change the HTML to entities before inserting the information into the database. So when they printed it to the screen straight out of the database, it was still in entity form. So all they had to do was use the function I showed them to decode the entities back to HTML tags.
  21. You need to decode the html entities. You can use this function when displaying it html_entity_decode() - http://us2.php.net/html_entity_decode Sorry if I misunderstood your question, hopefully that is what you want.
  22. Try $query = 'SELECT * FROM phpbb_users WHERE price != "" OR image != "" OR description != ""';
  23. From what I know, there is no way to uniquely identify a clients computer. The closest thing your going to get is their IP, which obviously isn't very reliable. So tracking their IP and possibly setting a cookie is the best way to go and as good as it's going to get.
  24. Nope, I never wrote on the desks...I did enjoy reading what others wrote/carved though
  25. It thought you were trying to concat the string when you used double quotes. You also had two brackets for $row['images'], you had it like $row[['images'] <?php while ($row = mysql_fetch_array ($r)) { print "<p>{$row['title']} <br /> {$row['address']} <br /> {$row['description']} <br /> {$row['price']} <br /> <img src='/uploads/images{$row['images']}'> <br /> {$row['contact']} <br /> {$row['phone']} </p>"; ?>
×
×
  • 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.