
MDCode
Members-
Posts
640 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MDCode
-
*mind blown* lol
-
Hmm I hope this was just a typing mistake. Your code at the top of the page I overlooked $query="SELECT * FROM leads WHERE `archive` = '0' ORDER by id DESC; You're missing the end quote
-
You said it's not displaying correctly? Anything that you're using to display it, queries, loops, etc.
-
Can you please post your code? Your sql seems legit
-
So it is still not being set as 0 when inserting into the database? Are there any errors?
-
Ok so say your archive column is right after where you are inserting '$referrer' Then you would put '0'
-
Dont use set in an insert query...it won't work just insert normally and where you would be inserting into archive just put a 0
-
You are not going to get php to work in an .htm file I guarantee it. As for your code I have never seen php like that so...
-
Php does not work unless the file has a .php extension
-
This can not be done with just php I'm afraid unless you want it to refresh every 5 minutes when a user goes to the page calculated by stored data, even then they would have to refresh the page a couple times for it to work, yada yada. Anyways, very messy. And this forum is for helping, please make an attempt first.
-
Need Help With Extracting An Image From Mysql To Store To File System.
MDCode replied to Slugger's topic in PHP Coding Help
Storing images in a database is tedious. You're better off uploading them to a directory and inserting the link to the image in the database instead -
<?php if($var == "1") { // execute 1 } elseif($var == "01") { // execute 01 } ?>
-
lol. I try to leave all code snippets unfinished so they can add on and edit what they need. Sometimes I go a little overboard
-
Just tried again, whatever you did fixed it. However, I never received my confirmation email (if there was one) Also the information I registered with is not letting me login
- 10 replies
-
- scrapll
- social network
-
(and 1 more)
Tagged with:
-
Submit the form with an id of what you're archiving in the url such as archive.php?id=id Just call it by using $id = mysql_real_escape_string($_GET['id']); Then use sql to update the information $sql = "UPDATE `table` SET `archive` = '1' WHERE `id` = '$id'"; To call all of them that aren't archived just use a while loop and a where clause as followed: $sql = "SELECT * FROM `table` WHERE `archive` = '0'"; $result = mysql_query($sql,$connection) or die("Error connecting to the database"); while($row = mysql_fetch_array($result)) { // How you want to display it here. Examples shown below $title = $row['title']; $info = $row['info']; $id = $row['id']; // Using so many echos to keep it easy to read echo "$title<br>"; echo "$info<br>"; echo "<form action='archive.php?id=$id' method='post'>"; echo "<input type='submit' value='Archive This'>"; echo "</form>"; }
-
First time I tried I couldn't see why the form didn't submit then saw it was just highlighting the field red which isn't much of a signal as to what your requirements are for registering and you may get a lot of complaints about that. Then when I got that working it would give the 403: forbidden page. So...idk.
- 10 replies
-
- scrapll
- social network
-
(and 1 more)
Tagged with:
-
Autopopulate Html Form Fields From Postgresql Database
MDCode replied to emmy's topic in PHP Coding Help
Wow...please organize your code first. -
First, the registration doesn't work. Second, having the footer links open in a new window is pretty annoying. Third, your login page is vulnerable to sql injection.
- 10 replies
-
- scrapll
- social network
-
(and 1 more)
Tagged with:
-
Still not very clear to me but you can limit results using LIMIT 3 in your query
-
Without a user being logged in makes it much more difficult and practically impossible unless you record all of their information, which, if you record ip those using the same isp could be mistaken as others.
-
Well seeing as you're echoing the message at the top of the page that would explain why you're getting it at the top although you're checking if it's set which is odd. Trying changing EDIT: Tried this on my site and it works fine other than you're echoing in two places which leads me to believe you are not showing everything
-
Oops, I get what you meant now...sorry
-
It looks pretty secure sql injection wise. I can't think of a way to bypass the filtering you're using