Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Are you sure there is an ID with an ID of $ID? Everything else looks OK... Is this the whole script?
-
Kindly dont spoil my site but try to find flaws and report to me
Maq replied to om's topic in Beta Test Your Stuff!
Dear om, I wasn't saying anything towards religion... All I mean was that religion is a very sensitive subject. So, if a hacker finds your site who doesn't believe in what you do, most likely he'll try to do harm to your site. -
There must be an external factor. Does $_GET have a value? I just tried: setcookie("lastViewedTEST", 45,time()+3600); echo $_COOKIE["lastViewedTEST"]; ?> And it echoed out 45... Maybe you should post all the relevant code.
-
You do something like: if (isset($_COOKIE["lastViewed"])) echo "Last product_id viewed: " . $_COOKIE["lastViewed"] . "! "; else echo "You have never viewed a product! "; ?> ?
-
Put this at the top of your script: ini_set ("display_errors", "1"); error_reporting(E_ALL);
-
example: cookie will expire in 1 hour: setcookie("lastViewed", $_GET['prodId'], time()+3600); Make sure you set the cookie before the tag.
-
I wouldn't call it a 'waste of time'. 1) Someone may have a different answer then you. 2) You may have the wrong answer. 3) Even if you have the same exact answer, so what, you wasted a couple minutes, tops. Sometimes I will check to see if someone else has already posted an answer. If they do then I just CnP my response (cause sometimes it doesn't show you what the other person has posted yet) and check to see what they posted, if mine is the same as theirs I will disregard mine, if mine is different I will post. I don't really think it's that big of a deal, it's not like we're working on enterprise projects here...
-
$string="doom"; echo encrypter($string); function encrypter($string) { $string = md5(sha1($string)); return $string; } ?>
-
great, no prob mark as solved pls
-
lol md5(sha1($string)); // error line close your functions!
-
1) Please use either the COUNT method or the mysql_num_rows method. 2) Where does $table come from? 3) Is submission_id the ACTUAL topic id and topic_id is what topic the reply is associated with? If so, you want to match the topic id with the submission_id. Your query should look like: $sql = "SELECT * FROM $table WHERE topic_id = " . $row['submission_id']; (You don't need single quotes around integers.)
-
Try this: $comments = mysql_query($sql) or die("Error ". mysql_error(). " with query ". $sql); $row2 = mysql_fetch_array($comments); echo ""; echo ''.$row['col_1'].''; echo $row2['COUNT(replies)']; echo " "; echo date("l M dS, Y", $row['submission_date']); echo "";
-
Reinstatement of post based ranking system
Maq replied to Daniel0's topic in PHPFreaks.com Website Feedback
I like CV's suggestion. The one liners are too long, IMO. -
You can dump your DB in a .sql file using: -h[host] -u"username" -p"password" "dbname" > /[dir]/file_name.sql
-
Problem with include, variables and if statements
Maq replied to boedromios's topic in PHP Coding Help
Why do you get your presents before everyone else? -
Can you just show the table structure? I'm not sure what exactly you mean here, anyway... Why can't you just use a simple query...? $sql = "SELECT replies FROM table WHERE topic_id = '$topic_id'"; $result = mysql_query($sql); $num_replies = mysql_num_rows($result); echo "Replies: " . $num_replies;
-
1) All of the values for the attributes you use (type=password, name=pword) should have " " around the values (type="password", name="pword"). 2) $_POST['username'] $_POST['pass'] $_POST['login'] are supposed to be $_POST['uname'] $_POST['pword'] $_POST['submit'] 3) You need to start debugging. A good way is to use echos in different spots in your logic to see if you get there. Make these modifications and let me know what happens.
-
How do I get things to show up at certain times only?
Maq replied to Riseykins's topic in PHP Coding Help
You don't need a cron job. The only time someone is going to see it is when they get to the site. So all you need to do is modify ngreenwood's code to fit your needs. Why don't you try it, and if you still can't get it to work, come back with more questions? Usually if you show some effort we're willing to help a lot more. -
Kindly dont spoil my site but try to find flaws and report to me
Maq replied to om's topic in Beta Test Your Stuff!
Good point. Especially anything to do with religion... -
You can do: SELECT * FROM * = everything.
-
How do I get things to show up at certain times only?
Maq replied to Riseykins's topic in PHP Coding Help
You need to manipulate the date() function. G 24-hour format of an hour without leading zeros 0 through 23 This may be helpful as well to check to see if it's day or night: A Uppercase Ante meridiem and Post meridiem AM or PM And a numerical representation of the day of the week: w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday) -
lol missing a ')'
-
You can start out by reading this tutorial on how to extract data from a data base, SELECT. Read further, there are examples of HTML inputs.
-
need someone to help me on a peace of code for a php script
Maq replied to gene4848's topic in PHP Coding Help
Add this to the top of your script and see if there are any errors. You should be debugging, echoing things out to figure out what is wrong. ini_set ("display_errors", "1"); error_reporting(E_ALL); BTW, it's "piece" not "peace"... -
Do this: Home | Logout | Forums Character