Jump to content

onthespot

Members
  • Posts

    424
  • Joined

  • Last visited

    Never

Posts posted by onthespot

  1. The error is stating I am redeclaring a class, but if I remove the require_once for that class, it gives me an error because it needs to use functions within.

     

    I just can't understand how I am going to get around this.

     

    Never come across anything like it before.

     

    It just WILL NOT work if I am not in the root directory.

     

    The issue is clearly when I am in a folder onto of the root directory.

     

    7 hours spent trying to fix this now and still no luck!

  2. Changed it to Session1 and same error but for Session1.

     

    What is really odd is that it seemed to work fine yesterday.

     

    Then i refreshed the page and this had happened.

     

    I made no changes, hmmmm.

     

    Could something have been changed by the host that could cause this?

     

    As I've said, it's really odd that the error only happens in the admin folder.

     

    If I move this same file into the root directory and change the links accordingly, it's fine.

  3. Fatal error: Cannot redeclare class Session in /home/content/63/8026363/html/include/session.php on line 7

     

    Line 7 is where the

     

    class Session {

     

    starts.

     

    So the claim now is that I am redeclaring that class, when I clearly am not!

  4. I have the following error

     

        Fatal error: Cannot redeclare class Database in /home/content/63/8026363/html/include/user_database.php on line 5

     

    That links to the line

     

        class Database

     

    But I have not redeclared this anywhere I can see.

     

    I've checked all the include files and still can't see it.

     

    I have now changed the name to user_database1.php which is DEFINITELY only included once in my WHOLE system and I am still getting the same message!

     

    This only occurs in my root/admin directory. When I moved the file it occurs into the root directory and updated the include files from ../file.php to just file.php, it worked perfectly.

     

    I can't understand why having the file.php in the /admin directory and using ../ to include files isn't working!

     

    Can anyone offer any experience of this? Or a potential fix.

     

    I'll provide some code from the top of the file in question..

     

    <?php
    
    include("../include/session.php");
    include("../include/admin_database.php");

     

    Clearly this is the problem but I can't understand why!

     

    Hope someone can help !

  5. Hi, I have done a similar thing before.

    I stored the images in a folder and then called the image something that would relate to the purpose.

    I'm not sure it's the best way to achieve it, but I had a user profile and I wanted to have a user profile picture.

    So i let users upload and the file was called $userid.jpg.

    That in itself is a link you see!

  6. Hey guys,

    My first problem is that i'm having trouble with a variable name.

     

    $comp_name = "$subformat_$subgame_$subname_$subseason";
            $_SESSION['comp_name'] = $comp_name;
    

     

    This seems to be returning just the value of $subseason?

    Is there a quick fix for this?

     

    Secondly, I am getting a undeclared function error.

     

    I have two functions in my class. One of the functions calls the other function.

     

    First function....

    	function flip($match) 
    {
    	$components = split('v', $match);
    	return $components[1] . "v" . $components[0];
    }

     

    Second function but only part of it (it's long!)....

     

    $s = flip($r);

     

    That is just a snippet of code from the second function.

    I am not sure if i should be declaring the function a different way?

     

    Thanks for reading  :D

  7. 
    <?php
    if(isset($_SESSION['leaguesuccess']))
    {
       if($_SESSION['leaguesuccess'])
       {
          echo "<h1>League creation successful, now add players and teams</h1>";
      
      echo "<form action='process.php' method='POST'>
      
    	<table cellspacing=\"10\">";
    	$u = $database->generateUserArray();
    	$t = $database->generateTeamArray();
    
    	for ($i = 0; $i < $_SESSION['players']; $i++) 
    	{
    		echo "
    		<tr>
    			<td>
    				User : <select name='user[$i]'>";
    				foreach ($u as $username) {
    				echo"<option value='$username'>$username</option>";
    				}
    				echo"
    				</select>
    			</td> 
    			<td>
    				Team : <select name='team[$i]'>
    				";
    				foreach ($t as $teams) {
    				echo"<option value='$teams'>$teams</option>";
    				}
    				echo"
    				</select>
    			</td>	
    		</tr>";
    	}
    
    	echo"
    
    	</table>
    	<input type='hidden' name='leagueusers' value="1">
    	<input type='submit' value='Submit'></form>";
          
      
       }
       else
       {
          echo "<h1>League creation failed</h1>";
          echo "<p>Sorry, try again.</p>";
       }
       unset($_SESSION['leaguesuccess']);
    
    }
    
    ?>
    

     

    Receiving the following error:

     

    Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';'

     

    I cant see whats wrong? Please help

  8. I have the following code

    if($form->num_errors > 0)
      {
             return 1;  //Errors with form
          }
          /* No errors, add the new account to the */
    	else if($database->addLeagueInformation($subname, $subplayers, $subformat, $subgame, $subseason, $subwindow, $subadmin, $subchampion, $subtype))
    	{
    		return 0;  //New user added succesfully
    	}
    	else
    	{
    	return 2;  //Registration attempt failed
    	}

     

    I want to add the following to it:

     

    $databases->addLeagueTable($name)

     

    Is needs to happen at the same time as the addLeagueInformation function does.

    Is this possible?

  9. So i came up with an idea of storing the information like the following

     

    Tournament

      Name

      Size

     

    Players

      Tournament

      Name

      Position (0 to (tournament.size - 1))

     

    Rounds

      Tournament

      Round

      Position (max halves for each round)

      Winner (player position)

     

    I cant think how I could move this on and make the players progress to the next round?

    Anyone got any further ideas for me?

     

     

  10. Very grateful for all the responses. It is something I really need to get to grips with.

    So the -> is the same as the . in C#? In that case, I understand what it does.

     

    The $this is one i have seen often, it there a reason to use the word this?

    I'll look on that link thankyou.

  11. So I have been looking code to understand it more.

    The following came up.

     

     $database->removeActiveUser($this->username);

     

    Could anyone point me in the right direction to working out what this means?

    I assume the $database is for the include page called database.

     

    Thanks

     

  12. Ok so I have a fixture list for a sports league table.

    I have an algorithm that produces the fixtures and puts them into a table in the DB called FIXTURES.

    How can I then order those fixtures by rounds and put dates on them.

    I cant think of a way.

  13. I'm very average at PHP and im looking to introduce time to something on my site.

    Its a sports site and everyone has fixtures.

    I have them so they are created and put into a table, what I now want to do is release one round of fixtures every 4 days automatically.

    Does anyone have any suggestions to carry this out?

  14. So the idea is that I will create a knockout style tournament bracket.

    Single elimination, im sure you know what i mean.

     

    How would i go about getting the winner of a round to go through to the next round?

    I suppose it would be someway of saying the winner goes into the next spot, any ideas?

    How could I make it look like a bracket?

    Thanks

×
×
  • 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.