Jump to content

gevans

Members
  • Posts

    2,648
  • Joined

  • Last visited

Contact Methods

  • MSN
    gevans001@hotmail.com
  • Website URL
    http://www.purplecoffee.co.uk

Profile Information

  • Gender
    Male
  • Location
    UK

gevans's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. It seems to me that he wants to use php to see if a URL actually exsist, not if the URL in question is hosted on a server running php.
  2. You could take a look at curl_init http://www.php.net/manual/en/function.curl-init.php
  3. In theory you are very right wordpress is... But the options are endless, I've used Wordpress to build fairly large websites with a CMS;
  4. I'm pretty sure that's the hat you had on when you wrote that right?
  5. I see, was not aware of that. Surely most users using the forum responsibly know that post count does not equal skill/competancy?
  6. There seem to be something wrong with user post numbers (I'm guessing this is an SMF issue, not phpf). If you take a look at http://www.phpfreaks.com/forums/profile/?area=summary;u=104066 you should see a total post count of 1, but if you look closer there are actually 5 or 6 posts made by this member. EDIT: it now looks like a count of 4 in his summary, and 9 in http://www.phpfreaks.com/forums/profile/?area=showposts;u=104066
  7. Also it looks like you're checking if a user is logged in, and if they are allowing them to login again, whereas users that are not logged in willnot be able to attempt as the session username will not be set; if(isset($_SESSION['username']))
  8. So there's an error in the SQL somewhere, I'm guessing you have errors turned off, add; ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); To the top of the script, just after the opening php tag and reply with your results!
  9. <?php $rated = $_POST['rated']; echo $rated; $rating = (int) $_POST['rating']; echo $rating; // Make a MySQL Connection mysql_connect("localhost", "********", "********") or die(mysql_error()); mysql_select_db("*********") or die(mysql_error()); $result = mysql_query("UPDATE `main` SET `rating` = `rating` + $rating WHERE `username` = '$rated'"); if($result) echo 'good'; else echo 'bad'; ?> Now if everything works you should get the username and rating printed, followed by either 'good' or 'bad'.
  10. So let me just get it clear. This page finds two varialbes (I'm assuming via $_POST) '$rated' and '$rating'. Then you want to update the db called 'main'. Update the 'rating' field by '$rating' where the username is equal to '$rated'?? If this is correct then a little change and you should have no problem.
  11. You may want to add isset as well so you don;'t get an error; if(!isset($_GET['id']) && empty($_GET['id']))
  12. If you really wanted to force it I guess you could open it in a new window using javascript, then refresh the new page instantly so the session has been created. I found this while doing a quick search, not tested; var mypopup = window.open('https://freida.ama-assn.org/Freida/user/programSearchDispatch.do?method=searchByPgmNbr&pgmNumber=3801166051'); mypopup.location.reload();
  13. The server you're using should make no difference if you're still using php and mysql (as I'm guessing you were before). Also an update query shouldn't attempt to return results, It would just return true or false. If you use phpmyadming try using the following query in the sql tab; UPDATE `main` SET `rating` = `rating` + 1 WHERE `username` = 'PUT A USERNAME IN HERE' Just replace 'PUT USERNAME IN HERE' with a username you know is in the db.
  14. It looks like the website sets a seesion when you visit the site, and later pages (such as the search) require that session to be set, so there's nothing you can do to get a direct link to a search page without getting the session expired error first.
  15. You should be able to do this with a single uery, something like this (please note the comments on the first few lines, I assumed $_POST data; <?php /** * $_REQUEST contains all od the data from $_POST, $_GET and $_COOKIE * * If you know where the data is coming from you should use the correct array * I've guessed $_POST */ $rated=$_POST['rated']; echo $rated; $rating=$_POST['rating']; echo $rating; // Make a MySQL Connection mysql_connect("localhost", "********", "********") or die(mysql_error()); mysql_select_db("*********") or die(mysql_error()); $result = mysql_query("UPDATE `main` SET `rating` = (`rating` + 1) WHERE `username` = '$rated'"); if($result) { echo 'good'; } else { echo 'bad'; } ?> I assumed that the field in the database that you're updating is `rating`. If this is called something different replace both instances of `rating` with the correct name.
×
×
  • 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.