Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Can't see any problem? what happens when you echo it?
  2. Do you have a link? perhaps its a really simple silly error?
  3. In this case perhaps, but die() does not redirect by normal... http://uk.php.net/die something has to be causing it to redirect in that circumstance.. perhaps on error or something?
  4. why doesn't it work in IE ? Sounds like a HTML/CSS issue in which case PHP isn't really the answer... try fixing the error? reckon the users would appreciate that more being as IE is a widely used browser...
  5. Going back to die() causing it to redirect, it doesn't .. die() basically kills the script and prints out an error message if ones passed. must be something in the rest of the script?? Can't imagine what, it's an odd one...
  6. didnt notice the double ?, why do you use it? why not just use like .. ?this=this&that=that ... but that wouldn't effect it as it's within a string. I personally can't see anything wrong with that line at all, but i would advise you switch the quotes. ie... echo '<option value="http://www.zerodefex.net/ccf/redo/pages/admin.php?user=true?UserID=' . $row['id'] . '">' . $row['username'] . '</option>'; .. notice now the HTML is correct and valid.
  7. Perhaps its using.. $string=md5(sha1(md5(sha1($string)))); can't imagine that's necessary anyway? md5 does the trick...
  8. Show us all the code, must be something causing it to redirect...
  9. Try looking at HTML symbols... http://www.w3schools.com/tags/ref_symbols.asp heart is represented as "♥" i believe..
  10. what happens in the "protect" function? Try printing out the username and password variables... What is actually printed out when you try and login? Need little bit more information..
  11. Say it didnt work one time though, he or the user won't know... Also the ()'s may not be required for it to work, but it's the right way to do it... as revraz says bad habbits...
  12. i was going to say pretty much what they said... try: $comment = $_POST['comment']; $query = mysql_query("INSERT INTO comments (comment) VALUES ('{$comment}')"); if (!$query) { print 'MySQL Error: ' . mysql_error(); } else { print 'Comment: <strong>"' .$comment. '"</strong> entered successfully...'; }
  13. try replacing the query line with this: mysql_query("INSERT INTO comments (comment) values ('{$comment}')") or die(mysql_error());
  14. What error do you get? And what version of PHP are you running on your local web server?
  15. Dont fully understand which bit you'd like help with? Adam
  16. Think it works pretty much the same, not 100% but... while ($row = odbc_fetch_array($query)) { print 'Field 1: ' .$row[0]. ' Field 2: ' .$row[1]. '<br />'; }
  17. By only checkin the username in the query you are still selecting that record, then having to do tests on the password field value to check if you actually needed the record. Quicker way round is to just add password to the query which then only returns records with the right username and password.. Making code neater, easier to understand and most likely saving some load time... If you've been getting an error did you try adding: mysql_query("...") or die( mysql_error() ); ??
  18. If oyu mean a sort of true/false return from the mysql_query function you can use: $query = mysql_query("..."); if ($query) { ... } But to be honest I've found it a little unreliable in the past... If you don't mean that, then I don't know what you mean...
  19. I'd say discomatt's ideas the best to go with.. Perhaps store the results in a database and then query it for files not matched to the original file list? So like a table called "original_filelist" and one called "used_files".... as you come across a reference to a file enter it into "used_files"... then obivouslly files in "original_filelist" without a match in "used_files" are unused files... Simple? Adam
  20. probs better off doing it more like this.. $resource2 = mysql_query("SELECT * FROM users WHERE username='{$_POST['username']}' && password='{$_POST['password']}'"); if (mysql_num_rows($resource2) > 0) { print 'correct password!'; } else { print 'incorrect password!'; }
  21. Ah yeah, to form an option of all the states.. foreach ($states['US'] as $state) print '<option value="' .$state. '">' .$states['US'][$state]. '</option>'; (Not checked) and to find the full title after selecting from database: $selectState = mysql_query("SELECT m_country, m_state FROM yourTable"); while ($stateRecord = mysql_fetch_assoc($selectState)) { if ($stateRecord['m_country'] == 'US') print 'US State: ' .$states['US'][ $stateRecord['m_state'] ]. '<br />'; } (Again not checked!) Adam
  22. Look into sitemaps...
  23. Well that can be quite complicated. Depends how you send the email in the script, would need to look into mail 'headers'... All email services like gmail and AOL have filters to try and filter out spam... I think sending a lot of emails at once probs won't help? Not sure, you'll probs learn from your experience... I don't know if gmail and that have limits... Adam
  24. No they'll send the data to the POST array with their script... If they had sent the data to the GET array then there would be added values to the URL in the form of something like.. receivedata.php?something=this&somethingelse=that If thats what you were tryin to ask? Adam
  25. Could try something like: $highestID = 0; foreach($page['array'] as $c) { if ($c['id'] > $highestID) $highestID = $c['id']; } foreach($page['array'] as $c) { if ($c['id'] == $highestID) { echo 'some stuff'; } else { echo 'some other stuff'; } } It's not that efficient as it needs two loops, I dare say there's another way but.. I dont know it... Adam
×
×
  • 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.