Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Well, you could use the O or Z format characters to get a differance between your timezone and GMT and work with that. www.php.net/date
  2. Just wondering if anyone has any suggestions for any particularly good books on anything in and around the subject of computing. Obviously i appreciate this is a huge field, but im not too fussy. Im looking to do some background reading during my last year before university, which'll also help with the application process. Being able to talk about things you know and have read will help with the interview quite a lot. So far ive read a couple books on artificial intelligence, which i think were good introductions to the field as they weren't too technical: On intelligence - Jeff Hawkins Creation: Life and how to make it - Steve Grand And ive just ordered "The Emperor's New Mind" by Roger Penrose, which looks rather more complicated, but its got to be worth a try. So yeah, any suggestions would be very welcome.
  3. Take a look at this article here: http://code.jalenack.com/categories/ajax/ There are 5 "states" that the request can be in. You can therefore change the display of your element dependant on which state it is in. So whilst it is loading, you might change the contents of your div tag to simply say "Loading...", and then show whatever you want to show once the request has been complete.
  4. So you're trying to bypass a captcha type authentication? Good luck. I think you'll need it. The whole point of these image verifications is to prevent any automated, computer use of the form.
  5. You just need to order your query by the display field: "SELECT * FROM table ORDER BY display ASC" You will then need to add an if statement inside your while loop to only show the particular results: <?php if($row['display'] == 'full'){ //show full results }else{ //show limited results } ?>
  6. Personally, i completely disagree. The tutorial is aimed at helping people make a php based login system. You cannot spend time explainging the things which are not suppoed to be covered. Not only is there the problem that you will alienate the target audience who would quickly get bored with the level the tutorial is at, but where do you stop? Someone, somewhere, will not understand everything covered by the tutorial on forms. Do you then explain this is more and more detail?
  7. Flat files are a pain. The whole point of databases is to store data; use the right tool for the job.
  8. Im now slightly relieved. 5 As. Can't complain about that! And i dont care if A Levels have got easier
  9. Apparently thats not an article, although this is: http://en.wikipedia.org/wiki/A_level Anyways, A Levels are the exams you sit at the end of 6th form/college at 17/18 years old - the last thing before university. AS Levels are the first year of that(which is what im waiting for) but are still a qualification in their own right. Im not sure of the US equivilent, but they are roughly equivilant to the International Baccalaureat if you've heard of that one. University applications are pretty much dependant on these. If i dont get decent results this year, then there wont be any point in me applying to the best universities.
  10. Anyone else awaiting theirs? Im more than a bit nervous at the moment...
  11. The reason for your error is because you were using the assignment operator (=) rather than the comparison operator (==) in your if statement: <? if ($gender='F') { ?> Should be: <? if ($gender=='F') { ?>
  12. Its always helpful to highlight the line of the error. However, this particular error came from your query. It should be: $storedata = mysql_query('INSERT INTO liam_database(Username, Password, Email,Favourite Sport,IP,date); VALUES ( "'.addslashes($user).'" "'.md5($pass).'" "'.addslashes($email).'" "'.addslashes($sport).'" "'.addslashes($IP).'" "'.addslashes($date).'" ') or die(mysql_error()); You had single quotes around your list of fields. You dont need them, and it causes an error because all of your query is surrounded with single quotes. However, your still going to get an error. Your logic is flawed somewhere, since you have: if(something){ }else{ }else{ } Which doesn't make sense. It might simply be a case of a misplaced brace (}), i dont know.
  13. Last time i checked, i wasn't actually psychic. You kinda need to post the actual code. You've given us 31 lines. The error occurs on 41. It would also be useful for you to particularly highlight the line in question. However, i suspect that there is an error in your mysql query. Try adding an or die statement: mysql_query($sql) or die(mysql_error().'<br />'.$sql);
  14. I would do this with a subquery to select the number of rows where dvd_id = udvd_id. Then bold the records depending on if this is 1 or 0: <?php include('test_db_connection.php'); $sql = "SELECT `dvd_title`,`dvd_id`, (SELECT COUNT(*) FROM `userdvds` WHERE`udvd_id`=`dvd_id`) as `count` FROM `dvds` ORDER BY `dvd_title` ASC"; $result = mysql_query($sql) or die(mysql_error()); echo '<table><tr><td>DVD ID</td><td>DVD TITLE</td></tr>'; while($row = mysql_fetch_assoc($result)){ if($row['count'] == 1){ $id = '<b>'.$row['dvd_id'].'</b>'; $title = '<b>'.$row['dvd_title'].'</b>'; }else{ $id = $row['dvd_id']; $title = $row['dvd_title']; } echo '<tr><td>'.$id.'</td><td>'.$title.'</td></tr>'; } ?> </table> Produces: <table><tr><td>DVD ID</td><td>DVD TITLE</td></tr> <tr><td><b>1</b></td><td><b>title 1</b></td></tr> <tr><td>2</td><td>title 2</td></tr> <tr><td><b>3</b></td><td><b>title 3</b></td></tr> </table> I think thats what you're after.
  15. NArc0t1c: It'll need to be this: <?php $user = $_GET['userid']; include 'config.php'; include 'opendb.php'; $query = "select * from users WHERE user_id LIKE '$user'"; $result = mysql_db_query("servicemgmt", $query . mysql_error()); $r = mysql_fetch_array($result) $firstname = $r['user_fname']; $lastname = $r['user_lname']; $ext = $r['user_ext']; $bleep = $r['user_bleep']; $exttel = $r['user_extno']; $email = $r['user_email']; echo '<table style="width: 80%">'; echo '<tr><td>First Name</td><td><input type="text" value="'.$firstname.'" name="firstname" id="firstname" style="width: 160px "/></td><td>Last Name</td><td> <input type="text" value="'.$lastname.'" name="lastname" id="lastname" style="width: 160px" /></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Extension</td><td> <input type="text" value="'.$ext.'" name="ext" id="ext" style="width: 160px" /></td><td>Bleep No.</td><td> <input type="text" value="'.$bleep.'" name="bleep" id="bleep" style="width: 160px"/></td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>External Tel.</td><td><input type="text" value="'.$exttel.'" name="exttel" id="exttel" style="width: 160px"/></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td>Email</td><td><input type="text" value="'.$email.'" name="email" id="email" style="width: 200px" /></td><td> </td><td> </td></tr>'; echo '<tr><td> </td><td> </td><td> </td><td> </td></tr>'; echo '<tr><td><input name="updateuser" type="submit" id="updateuser" value="Update User Details" /></td><td> </td><td> </td><td><input name="reset1" type="reset" value="Clear Form" /></td></tr>'; echo '</table>'; ?> Otherwise your variables wont get evaluated.
  16. I suppose it would help if you were actually putting the right variable into your url string wouldn't it? Try: <a href=\"index.php?id=$_rw->requestId&m=del\">DELETE </a></td> Call me old fashioned but i thought you might have noticed a blank in the URL
  17. i have no idea what lmga means. all i could find was "Location Managers Guild of America" and "Louisiana Meat Goat Association." Haha, i wasn't the only one to google. Even urbandictionary.com doesn't have any suggestions. I thought it had gotten to the stage where you could put any 3/4 letter combination in and someone had come up with a meaning
  18. The problem is you have a lot of unescaped double quote. You can't place a double quote inside the string you are echoing wihtout escaping it with a backslash if you are using double quotes so surround the string. The reason why you get a blank page is because you have the display_errors directive set to off. If you were to add: error_reporting(E_ALL); ini_set('display_errors','On'); To to top of your page, you would get some error messages. To fix, go through and escape all of the double quotes inside your string, or use single quotes to surround the attribtues of your html tags/your string. Beaten to it - but thought id post anyways. Might add something with the explanation of display errors.
  19. Well, how about getting rid of the javascript rediect so that we would actually if there was a mysql error?
  20. Did you try removing the error suppressant(@) and adding an or die statement? Try: $sql = 'INSERT INTO jos_content (title, title_alias, introtext, state, sectionid, mask, catid, created, created_by, created_by_alias, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parentid, ordering, metakey, metadesc, access, hits) VALUES (\'' . $title .'\',\'' . $title .'\',\'<object type="application/x-shockwave-flash" data="player.swf" ' . ' width="320" height="262" id="FlowPlayer">' . ' <param name="allowScriptAccess" value="sameDomain" />' . ' <param name="movie" value="http://tvloser.com/videos/' . $md5 . '.flv">' . ' <param name="quality" value="high">' . ' <param name="scale" value="noScale">' . ' <param name="wmode" value="transparent">' . ' <param name="flashvars" value="config={\'videoFile:"http://tvloser.com/videos/' . $md5 . '.flv",autoPlay: true\'}">' . ' </object></textarea>' . ' </div>\', \'1\', \'2\', \'0\', \'3\', \'2007-08-10 11:54:06\', \'62\', \'\', \'0000-00-00 00:00:00\', \'62\', \'0\', \'0000-00-00 00:00:00\', \'2007-08-10 11:54:06\', \'0000-00-00 00:00:00\', \'\', \'\', \'pageclass_sfx=' . ' back_button=' . ' item_title=1' . ' link_titles=' . ' introtext=1' . ' section=0' . ' section_link=0' . ' category=0' . ' category_link=0' . ' rating=' . ' author=' . ' createdate=' . ' modifydate=' . ' pdf=' . ' print=' . ' email=' . ' keyref=' . ' docbook_type=' . ' html_title=$title' . ' robots=-1' . ' google_cache=1' . ' google_snippet=1\', \'2\', \'0\', \'1\', \'METAKEY FIELD\', \'META DESC FIELD\', \'0\', \'0\')'; mysql_query($sql) or die(mysql_error().'<br /><br />Query:'.$sql); Ive assigned the query string to a variable so we can see the actual query if there is an error.
  21. What does "not lining up nicely" mean? It would help most if you could show us the output.
  22. The 'something' bit is just an example of the name of your key within the GET array. So, on editSearcheduser.php, you could do something like: <?php $user = $_GET['something']; echo $user; ?>
  23. Firstly, the data is in the GET array, not the POST array. Second, you dont define $requestId. Try: <?php include 'config.php';// this has my database connection stuff if($_GET['m'] == 'del' ) { $requestId = $_GET['id']; $query ="DELETE FROM timeoff WHERE requestId = '$requestId'"; mysql_query($query) or die(mysql_error()); echo "<script language=\"javascript\"> location.href=index.php</script>"; } ?>
  24. Escaped single quotes: . ' <param name="flashvars" value="config={\'videoFile:"http://tvloser.com/videos/' . $md5 . '.flv",autoPlay: true\'}">' You cant use single quotes without escaping them, because single quotes are being used to enclose the query.
  25. Well, which part is it that you are struggling with? Are you able to create a form and store the information in a database - is it just the process of splitting the form across multiple pages that you are unsure of? If so, i guess what i would do is: 1.) Once the form on page is submitted, check the data, and create a new record in the database. Store their session id and set a field such as `complete` to 0/false/no 2.) Redirect to second form 3.) Once that is submitted, update the relevant row, which you will be able to do with the session id 4.) Redirect to third 5.) Lastly, after the third is submitted adequately, update the `complete` field to 1/true/yes You would then only "deal" with records where the whole form has been completed, and could routinely delete records that are only partially complete.
×
×
  • 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.