Jump to content

gevans

Members
  • Posts

    2,648
  • Joined

  • Last visited

Everything posted by gevans

  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.
  16. Can you show an example of this? Is it online? Difficult to offer any help with no information to work from.
  17. No one is going to write you a script unless you go through the freelancer forum. You'd be better off coming back with specific problems with the scripts you've tried.
  18. You are right, it is *possible* but... I somehow doubt someone versed enough to make their own webmail client would be asking a question like this. On a side note... dunno how active you are about reading posts in various forums around here, but this seems to be a recurring topic lately. I would almost tentatively call "homework!" but it does seem kind of an odd assignment to be giving....probably just a coincidence. I completely agree, just thought I'd give an obvious example as a point. Haven't been around the forums for a while, it is a very random "homework" assignment, I hope people understand where this sort of functionality "should" be used.
  19. You're missing a closing bracket on line 4 if (strlen($_POST['newmsg'] > 2) should be if (strlen($_POST['newmsg'] > 2)) Syntax errors are usually triggered by something on the previous line. Easy problem to fix when you take a look at the code! Also a good text editor would pick this up for you.
  20. Just a thought, he may be making his own webmail client and wants an onunload event to warn the user that their closing their browser window without sending or saving a draft of an email their writting..... I know, I don' think so either, but you never know, there might be a good reason behind it!
  21. Ahh ok, I thought you were referring to the TOS on LinuxForum.com. I've updated the full path to the Rules & TOS here and the link should work properly now. I did an update last night on PHPFreaks to enable Pretty / Friendly URLs and it seems to have broken some of the menu items - all fixed. Good work. I'd just like to re-iterate my main point. I don't want my details and login to be migrated across to the linux forum.
  22. FF 3.6.12 I also just tried in Chrome and get the same issue. The link is http://www.phpfreaks.com/forums//page/rules-and-terms-of-service Obviously the extra forward slash shouldnt (doesnt) matter, but still no cigar
  23. That sounds like a great idea.. i'll see what it takes to link the two together. I'll check into the login thing and see what's going on there. Thanks for the ideas! Personally I would not like my login to be carried over to the Linux forum. I'm pretty sure this is outside the scope of the Terms of Service and Rules. On that note I'm unable to see the Rules and TOS page via the main nav. It just shows me the forum index?
  24. All sorted; I had the .so for apache 2 instead of apache 2.2
  25. I've also tried the following; LoadModule gzip_module modules/ApacheModuleGzip.dll <IfModule mod_gzip> mod_gzip_on Yes mod_gzip_item_include file \.htm$ mod_gzip_item_include mime text/.* mod_gzip_item_exclude file error/.* mod_gzip_item_exclude mime ^image/.* mod_gzip_temp_dir "/tmp" mod_gzip_command_version mod_gzip_version CustomLog logs/gzip.log mod_gzip_info2 </IfModule> and get the following; httpd.exe: Syntax error on line 141 of C:/xampp/apache/conf/httpd.conf: Cannot load C:/xampp/apache/modules/ApacheModuleGzip.dll into server: The specified module could not be found. and the file exists.
×
×
  • 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.