Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. Think of it this way. Without the use of crontabs, it would be no different that having someone go run the same errand for you over and over and do nothing about it until midnight.... and then continue to run the fake errand again until the next midnight. It's really a waste of effort, energy and time. Especially when you have the option, all the while, to send this errand person out ONLY at midnight.
  2. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333152.0
  3. does member.php have session_start() at the beginning. How are you checking for authentication in member.php
  4. I don't believe you can have an autoupdating column... unless you make a cron job to update the database everyday. But there is a MYSQL function called DATEDIFF that allows you to get this info on the fly
  5. Yes, if you structure your form like this </pre> <form action="'somescript.php?getvariable=something'" method="'post'"> </form The GET variable is in the form action, although the method is to POST, the GET var will still show up on somescript.php
  6. you've binded click to the live() function, I don't see why it should be a problem. You really only need the live function for dynamic input's.. i.e. inputs that weren't originally in the HTML. display:none only means it's not displayed, but it still appears in the source code. If you use a function like append of prepend or something to place another input on the page.. then you would use live() to access that input's click function.
  7. You want your query to say something like SELECT * FROM `Members` WHERE id='45' or something with a number. You may not need to single quotes either.
  8. Post your "empty result" query here. You should notice that there is no id being compared.
  9. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333153.0
  10. try using $('#freetext').text() or $('#freetext').html(), because textarea is a tag with no value... only innerHTML or innerText if you will.
  11. alright then, so if the Query is returning empty, it most likely means either: - the id doesn't exist - or the id hasn't been set. $_SESSION['id'] has no value. Which makes me wonder how it gets past that first IF statement in the first place.
  12. couldn't you just create a new Action object within your NewsController instead. class News_Controller extends Action { public function articles() { $action = new Action(); $action->title = "New Title"; } } ?>
  13. Ok, I just decided to restructure your code rather than tell you everything wrong with it, I put a few comments in there to explain a few things. session_start(); ini_set ("display_errors", "1"); error_reporting(E_ALL); ?> Welcome <br /> .background {color: #B56AFF;<br /> }<br /> if (isset($_SESSION['id'])) { // Set the users session ID include_once ("Connections/connect_to_mysql.php"); $id=$_SESSION['id']; //Formulate Query //This is the best way to perform an SQL query $query = "SELECT id, firstname FROM `Members` WHERE id='$id'"; $result = mysql_query($query); $numrows = mysql_num_rows($result); //Check result //This shows the actual query sent to MySQL and the error. Useful for debugging. if(!$result){ $message = 'Invalid query:' . mysql_error() . "\n"; $message .= 'Whole query:' . $query; die($message); } /// Since the script die()'s if the query fails, you don't need an else statement. /// We can assume from here on out that the query passed and the SESSION id was set. $row = mysql_fetch_assoc($result); mysql_free_result($result); echo " Welcome, " . $row['firstname'] . ""; } ?> Your new Member accounts lets you enter the members only section of our web site. You'll find special discounts, a profile of matches, live advise from experts, and much more. Your new Member ID and password were emailed to you. Store them carefully for future use. Glad you could join us!
  14. Yes, this technique is meant to be used with GET, otherwise you just have another POST variable hanging out. Also, $r is undefined because you're not checking it's existence with isset. If you change you post action to include this GET variable .... it might just work.
  15. http://forums.theplanet.com/index.php?showtopic=59910
  16. yes, it's a PHP function called include
  17. $_REQUEST['tab'] does not yet exist. You must check if it exists or you will get a Notice. if(isset($_REQUEST['tab'])) $tab = $_REQUEST['tab']; else $tab = null;
  18. The problem is that you're trying to put an Array into the url, which you can't do.. because the URL is string based. If you really want to pass the errors through the URL like that you'll have to - serialize the array - base64_encode it Then on the other page just - base64_decode it - and unserialize it
  19. The only reason I can't think of it not showing anything is that nothing was checked. It would probably help more to print_r the entire $_POST array and see what's coming through. Also, put it inside tags when you print_r, it's much easier to read. [code]echo "" . print_r($_POST) . "";[/code]
  20. Adding microtime to the end of a file...as a querystring will guarentee that it is a new reference every time. Much like the way a few people setup their stylesheets so others won't have to clear their cache every time a change is made... meaning it's a NEW stylesheet every time. This may or may not work like I'm thinking for POST reloads, but it's worth a shot to see. One last thing. Your markup isn't right. INPUT tags are self-closing.. and even though you didn't "self-close" them all, you forgot to close the last one... the submit button.
  21. do you still have this alert(data[0]) That zero shouldn't be there anymore... nor the brackets. Well...maybe try alert(data.0) since it's json encoded. Or you might have to eval it. alert(eval(data))
  22. I'm just going to repeat myself and Nightslyr, you should not be doing this with JS, especially since you have this stuff in a database already. It sounds to me like you could very easily fix whatever issue it is that you're having with a few JOINs and some HTML to make it look cool.
  23. Ok, so you've got thousands of rows already.. you've got the random part finished. You just don't want duplicates to appear.... or rather, you only want the row to appear once in it's lifetime. Am I on the right tract? Creating a column and deleting it over and over again could be cumbersome and it's probably the wrong way to go. You could just as easily change that columns value to 0 and be done with it. I don't quite understand what you mean by "old information floating around".... do you want to delete this data of yours? I'm confused. If it's duplicates that is bothering you right now, then you'll have to figure out a way to get rid of them entirely, through a mass SQL statement or just manually.
  24. Ok, if I'm right on this one, you want to do something like this.. in which everything is ... congruent. In which the bolded fields are all mashed together somehow and make a complete message or something. Now my question is... why did you create this data in Javascript? It shouldn't be that hard to create 5 arrays and merge them with PHP.
  25. I too am totally lost.
×
×
  • 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.