Jump to content

paulman888888

Members
  • Posts

    332
  • Joined

  • Last visited

    Never

Everything posted by paulman888888

  1. Below it my code. Please can you check it for errors as i am not very good. <?php $ourFileName = "games/$_POST[name].php"; $ourFileHandle = fopen($ourFileName, 'w') or die("Can't make file"); fclose($ourFileHandle); $myFile = "games/$_POST[name].php"; $fh = fopen($myFile, 'w') or die("There's an error!"); $stringData = "$_POST[main].php"; fwrite($fh, $stringData); fclose($fh); ?> This is what it's meant to do. Its meant to create a file in directory games. With the name from POST DATA NAME Then its meant to add the content from POST DATA MAIN Thank-you for all the help
  2. I can't do this. It's too hard for me. I know this will sound abit weird but can someone make a template for me please. I've tryed and now its (a word that am not going to say because were not allowed to swear on these forums but i think you can guess it. But i will say it's a 7 letter word, begging with p has two s's init, and ends in 'ing' ) Please help!
  3. I just don't want it to over right a file that is already there and i thought RANDOM would be a good way to prevent it. Am really sorry but when i couldn't do it I delete it of local on my server. Sorry
  4. As a noob i don't know how much there was left to do. I started with get post. And had loads of gos trying to get it to save the file. I got the random file name part done. As you can tell i am not very smart with PHP. Thankyou all ver much again.
  5. am stuck trying to get post data to be saved as a random file with the extension .php I have tryed to make my own but they all fail. Thankyou for all the help
  6. hi. I have a form that summits code useing the 'post' action and i would like a script that gets the post data and saves it as a new file in directory games. I would like the name to be anything.php i mean anything, number or what ever. thankyou
  7. The topic name is not clear. start a new tread or something because people don't know whats it about.
  8. I would like an onine editor that saves the file as a random name in folder games/. Abit like a WYSIWYG editor. I don't know how to include it in a page or save it as a random name, or how to save it in folder games/. Thankyou for all the help
  9. Hi, I want letter to be replaced with a number eg a -->> 1 b -->> 2 and so on. Can anyone tell me how to do it please. Thankyou very much
  10. Am not very good with PHP and i didn't make this script. But thankyou anyway for the help.
  11. i have my code that includes all pages in my directory but how do i get it to only show 10 on each page. This is my code <?php $moduleHandle = opendir('games/'); $x = 1; while(false !== ($moduleFile = readdir($moduleHandle))){ if($moduleFile == "." || $moduleFile == ".." || $moduleFile == "demo.html" || $moduleFile == "..." || $moduleFile == "navigation.php")continue; // replace unused with any files you dont want to be included include("games/$moduleFile"); $x++; } if($showBack == "process"){ echo"Files Loaded Successfully: <b>$x</b><br>"; } closedir($moduleHandle); ?> Thankyou for all the help One more thing if you don't mind how do i make a next page link / button. Thankyou all very much.
  12. What i want is a online editor that uses a set template and then can be saved as a different file name. abit like a WYSIWYG but i don't know how to intergrate them into my page and how to save them as a different file name. Thankyou for all the help
  13. this is my code so far <?php // open the current directory $dhandle = opendir('games/'); // define an array to hold the files $files = array(); if ($dhandle) { // loop through all of the files while (false !== ($fname = readdir($dhandle))) { // if the file is not this file, and does not start with a '.' or '..', // then store it for later display if (($fname != '.') && ($fname != '..') && ($fname != basename($_SERVER['PHP_SELF']))) { // store the filename $files[] = (is_dir( "./$fname" )) ? "(Dir) {$fname}" : $fname; } } // close the directory closedir($dhandle); } echo "<select name=\"file\">\n"; // Now loop through the files, echoing out a new select option for each one foreach( $files as $fname ) { echo "<option>{$fname}</option>\n"; } echo "</select>\n"; ?> I want to include each file into my page please help
  14. But the idea is that i dont have to.
  15. I would like to have a master page that includes all other php files in directory 'games/'. This way i don't have to update the master page. Can anyone help me make the master page please? i want it to include the php pages inside 'games/'. I have a games site and i want all games (10 at a time) in directory 'games/' to be include in the master page. Thankyou very much
  16. i want it to include the php pages inside 'games/'. I have a games site and i want all games (10 at a time) in directory 'games/' to be include in the master page. thankyou
  17. I would like to have a master page that includes all other php files in directory 'games/'. This way i don't have to update the master page. Can anyone help me make the master page please? Thankyou
  18. it doesn't work, it comes up with Warning: main(games/): failed to open stream: No such file or directory in /home/www/civage.com/games.php on line 89 Warning: main(games/): failed to open stream: No such file or directory in /home/www/civage.com/games.php on line 89 Warning: main(games/): failed to open stream: No such file or directory in /home/www/civage.com/games.php on line 89 Warning: main(): Failed opening 'games/' for inclusion (include_path='.:/usr/local/lib/php') in /home/www/civage.com/games.php on line 89 Please help Thankyou all
  19. One more thing. I would like to have a button when clicked picks out a random game. Thank-you for the help Paul
  20. Am trying to make a games page. Each game is on a diffecent page. I want to create a master page that includes all the sub pages and am trying to use an array to include them but I only want 10 shown at a time. The reason am useing an array is that i don't want to keep updateing the master page. Thankyou for the help
×
×
  • 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.