Jump to content

gevans

Members
  • Posts

    2,648
  • Joined

  • Last visited

Posts posted by gevans

  1. Seeing as php is server side, the only way to really check is by grabbing the data in the URL and checking the data to see if the pattern "php" was anywhere in the URL.

     

    But there is a flaw in the logic, because if the site has friendly urls, then that patentially means as there would be no means of checking.

     

    Not sure why you would want to be doing this though...

     

    Rw

     

     

    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. On that a CMS is a Content-Management-System. My rememberence does not remind me that WORDPRESS is one, too. In my point of view WORDPRESS is more a WEBLOG (Web-Blog).

     

    In theory you are very right wordpress is...

     

    WordPress is web software you can use to create a beautiful website or blog

     

    But the options are endless, I've used Wordpress to build fairly large websites with a CMS;

     

    WordPress started as just a blogging system, but has evolved to be used as full content management system and so much more...

  3. 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

  4. 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']))
    

  5. <?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'.

  6. not sure if I understand your question fully but you might do this.

     

    if (empty($_GET['id'])){
      echo 'this';  //this will be shown when someone types in  [url=http://lalalaala.com/index.php?id=monkeys]http://lalalaala.com/index.php?id=monkeys[/url]
    }else{
      echo 'that';
    }

     

    You may want to add isset as well so you don;'t get an error;

     

    if(!isset($_GET['id']) && empty($_GET['id']))
    

  7. 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();
    

  8. Im already not liking my new hosting company, now I can't get a sing query to work, Gevans, your query makes it return "Your query did not return any results. (0.0004 seconds)"

     

    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.

  9. 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.

  10. 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!

     

    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.

  11. 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.

  12. 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

     

    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.

  13. hmmm...so I went there and...

     

    First off, I wonder if it makes sense to link phpfreaks smf with linuxforum smf so we don't have to register a separate account over there?

     

    2nd...I can't seem to even register there...I click the register button and it displays the ToS and when I click to agree to it...it just keeps refreshing the same ToS page, can't move beyond that.

     

    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?

  14. 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.