Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Yes, you need to set up a cron job in your crontab. Here's how to do it: Crontab - Reference
-
$string = print_r($my_obj, return=TRUE);
-
Can you echo out the query to see if it's correct? $sql = "SELECT * FROM fritidsdagen WHERE namn = '$namn'"; //ADDED echo "QUERY=> " . $sql; $result = mysql_query($sql) or die(mysql_error()); //ADDED Pleas use tags. (The # sign)
-
Making a Login with PHP for a website... help?
Maq replied to newbie-ghozt's topic in PHP Coding Help
What have you done so far? P.S. - Your link gives me an "Address Not Found" error. -
First, I recommend you to download: RCLI. This can analyze your system and keep track of everything for you. Yes. No, I definitely would not use telnet, very insecure. But yes if you type in "top" or "ps -ef" you will see the processes pop up with, time, CPU usage, etc... Current, that's why if you write a script or use the tool I suggested then you can store this information somewhere. Hope this answers your question and fixes your problem.
-
Do a SELECT statement and see if it returns anything. Try this, I also cleaned up your code a bit: //namn = name if(empty($_POST['namn'])) $namn = "not set"; if(empty($_POST['kurs'])) $kurs = "not set"; if(empty($_POST['first_time'])) $first_time = "not set"; if(empty($_POST['more'])) $more = "not set"; if(!empty($_POST['namn'])) { $namn = $_POST['namn']; $kurs = $_POST['kurs']; $first_time = $_POST['first_time']; $more = $_POST['more']; $connection = mysql_connect("localhost", "dape0015", "ruroangu" , "dape0015") or die("Could not connect!"); mysql_select_db("dape0015") or die("Couls not choose database"); $sql = "SELECT * FROM fritidsdagen WHERE namn = '$namn'"; //ADDED $result = mysql_query($sql) or die(mysql_error()); //ADDED if(mysql_num_rows($result) == 0) { //ADDED echo "You've already regisereted for this trip."; //ADDED } else { //ADDED $laggTill = "INSERT INTO fritidsdagen (id , namn, kurs, first_time, more) VALUES ('$id' ,'$namn', '$kurs', '$first_time', '$more')"; mysql_query($laggTill) or die("Colud not add information!"); header('Location:tack.html'); exit(); } //ADDED mysql_close($connection); } ?>
-
Stickies are meant to be read before you post, to prevent instances like this, sigh... EDIT: Mark as [sOLVED] if so.
-
Making a Login with PHP for a website... help?
Maq replied to newbie-ghozt's topic in PHP Coding Help
Install WAMP (windows) or LAMP (linux), Google it, you will find the install. -
"top" or "ps -ef"
-
You should use DOM and XPath, it would make things a hell of a lot easier. This is what they're made for anyway, XML.
-
Don't go anywhere, I'm almost done.
-
Have you tried it? When you left join you have to join on common fields, such as 'id' and specify what tables each field comes from. Why are you using LIKE? I will leave it that way, but it seems weird. Try this: $sql = "SELECT u.name FROM user u LEFT JOIN votes v ON u.id = v.user_id WHERE u.id LIKE '$id' AND v.id LIKE '$voteuserid'";
-
So, to answer your question, use single quotes inside the associative array, unless it's an index (number).
-
You can call the script in a small pop up window. Would that work?
-
How doesn't it work? What happens? Use tags whenever posting code.
-
Good question, like this: $sql = "SELECT `id`, `link`, `topic`, `copy` FROM `newsletter_copy` WHERE `newsletter` = '{$_REQUEST['newsletter']}' ORDER BY `order` ASC"; EDIT: Although, the way you had it should still work.
-
Sounds right to me, makes sense too, thanks for the info
-
They will all return the same thing, I believe the standard, and what I've always used, is $arr['name'];
-
I don't think it will redirect before the PHP, cause it's interpreted and then served as HTML. Try it out.
-
I suggest you use DOM and XPath. These features are made for reading and parsing XML.
-
can anyone show me a good example of a class / object map?
Maq replied to jonaofarc's topic in PHP Coding Help
Is this what you're looking for? -
I know you put that in your post, I was just stating what it said in the manual, I wasn't implying you had Second, that's not how I had my code. This line should throw an error, or maybe return FALSE, idk, but it wont' work properly: if (strtotime($date == FALSE){ Can you post sample data where the code doesn't work as expected? And the exact code that you're using.
-
can anyone show me a good example of a class / object map?
Maq replied to jonaofarc's topic in PHP Coding Help
Not sure what you mean by object map? Maybe a UML diagram? This link should answer most of your questions: PHP OOP -
An HTML redirect or JS redirect should work.
-
Didn't mysql_error() tell you something similar?