Need Small Php Hack - Simple Job - Probably Few Lines Of Code And A Couple Of Hours.

Discussion in 'Programming' started by Trey Brister KindHOST.com, Jun 21, 2008.

  1. #1
    i need a price quote and keep in mind i have done 95 percent of the job already

    The URL to access this code is.

    
    http://kindhost.com/clients/engdisc/engdisc.php
    
    Code (markup):
    NEED USER GENERATE FUNCTION SO THAT THE LOWEST NUMBER STARTING AT 1 ENDING AT 9999 IS USED FOR USERNAME - DONE
    i mean i cannot have multiple users using a single login each browser session should increment up the username to the lowest of the next available number

    ERROR IF NOT INTERNET EXPLORER - DONE
    the error is Must Use Internet Explorer (that is supposed to be there.)

    PASSWORD IS ALWAYS 12345 - DONE

    JAVASCRIPT FOR BODY UNLOAD TO CALL THE LOGOUT PHP WHICH WILL FREE THE USERNAME FOR REUSE
    exiting the browser window or visiting the URL with a non IE browser should have the same effect as clicking the logout button
    You just click the logout button to access this code. The URL to access this code is.

    
    http://kindhost.com/clients/engdisc/logout.php?user_name=14
    
    Code (markup):

    Here is some sample php code to get you started.
    
    $redirect="http://www.redirecturlgoeshere.net";
    if(preg_match('/MSIE/',$_SERVER['HTTP_USER_AGENT']))!=1) header("Location: ".$redirect);
    
    Code (markup):
    NEED ADMIN BUTTON TO ERASE THE XML FILE OR RESET ALL LOGINS THIS CAN BE A SEPERATE SCRIPT OR A FUNCTION OF LOGOUT.PHP
    i need a reset function for the teacher to logout everyone and start over
    
    for the reset you can use something like
    http://kindhost.com/clients/engdisc/logout.php?user_name=all
    
    or
    
    http://kindhost.com/clients/engdisc/logout.php?reset=all
    
    Code (markup):

    NEED TO CREATE XML IF FILE DOES NOT EXIST
    need error is XML file does not exist or is not writable you can use php code if fileexist {} to test for existance and writability of

    file prior to loading XML

    This is what the blank XML file should look like when created to avoid errors.

    
    
    <?xml version="1.0"?>
    <mynotes>
    
    </mynotes>
    
    Code (markup):

    This is what the XML file looks like with one login.


    
    <?xml version="1.0"?>
    <mynotes>
      <note>
        <username>1</username>
        <password>12345</password>
      </note>
    </mynotes>
    
    Code (markup):
     
  2. Trey Brister KindHOST.com

    Trey Brister KindHOST.com Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Thanks for considering this request.
     
  3. Trey Brister KindHOST.com

    Trey Brister KindHOST.com Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    anybody want to give this a try?
     
  4. Trey Brister KindHOST.com

    Trey Brister KindHOST.com Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Need Admin Button To Erase The Xml File Or Reset All Logins This Can Be A Seperate Script Or A Function Of Logout.php - Done

    Javascript For Body Unload To Call The Logout Php Which Will Free The Username For Reuse - Done


    Need To Create Xml If File Does Not Exist - Done
     
  5. Trey Brister KindHOST.com

    Trey Brister KindHOST.com Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    Only one more issue. When user 1 2 and 3 login like normal and user 1 logs out. The next user assigned is 4. This is incorrect. user 1 should be the next one assigned because the lowest number available for use should be the next assigned user. I really need this issue fixed can someone give me a price for this. This is a really small php script.

    from previous description:
    NEED USER GENERATE FUNCTION SO THAT THE LOWEST NUMBER STARTING AT 1 ENDING AT 9999 IS USED FOR USERNAME
    i mean i cannot have multiple users using a single login each browser session should increment up the username to the lowest of the next available number
     
  6. Trey Brister KindHOST.com

    Trey Brister KindHOST.com Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    OK I have isolated the area of the error. This should simplify the fix somewhat.

    http://kindhost.com/clients/engdisc/

    
    
    $objDOM = new DOMDocument();
    $objDOM->load("test.xml"); //make sure path is correct
    $note = $objDOM->getElementsByTagName("note");
    // for each note tag, parse the document and get values for
    // tasks and details tag.
    $lownum=1;
    foreach( $note as $value )
    {
    	$tasks = $value->getElementsByTagName("username");
    	$username  = $tasks->item(0)->nodeValue;
    	if($lownum="$username")
    	{	
    	$lownum++;	// THIS IS THE PART CAUSING THE ERROR PROBABLY NEEDS A WHILE LOOP INSTEAD OF $lownum++
    	/*
    
    
    When user 1 2 and 3 login like normal and user 1 logs out.  The next user assigned is 4.  This is incorrect. user 1 should be the next one assigned because the lowest number available for use should be the next assigned user.  I really need this issue fixed can someone give me a price for this.   This is a really small php script.
    
    from previous description:
    NEED USER GENERATE FUNCTION SO THAT THE LOWEST NUMBER STARTING AT 1 ENDING AT 9999 IS USED FOR USERNAME 
    i mean i cannot have multiple users using a single login each browser session should increment up the username to the lowest of the next available number
    
    Here is a sample datafile.
    
    <?xml version="1.0"?>
    <mynotes>
      <note>
        <username>1</username>
        <password>12345</password>
      </note>
      <note>
        <username>2</username>
        <password>12345</password>
      </note>
      <note>
        <username>3</username>
        <password>12345</password>
      </note>
      <note>
        <username>4</username>
        <password>12345</password>
      </note>
    
    </mynotes>
    
    
    
    	*/
    	}
    	
    
    
    Code (markup):
     
  7. Trey Brister KindHOST.com

    Trey Brister KindHOST.com Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    When user 1 2 and 3 login like normal and user 1 logs out. The next user assigned is 4. This is incorrect. user 1 should be the next one assigned because the lowest number available for use should be the next assigned user. I really need this issue fixed can someone give me a price for this. This is a really small php script.

    from previous description:
    NEED USER GENERATE FUNCTION SO THAT THE LOWEST NUMBER STARTING AT 1 ENDING AT 9999 IS USED FOR USERNAME
    i mean i cannot have multiple users using a single login each browser session should increment up the username to the lowest of the next available number
     
  8. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    Add me on MSN, I'll take a look.

     
    Danltn, Jun 24, 2008 IP