Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Just uncommenting the mysql extension in the php.ini doesnt mean the extension will load. You need to also setup the extension_dir directive in the php.ini. This should point to PHP's extension directory (C:/PHP/ext if you installed PHP in C:/PHP). Also copy a file called libmysql.dll to C:/WINDOWS too. Save the php.ini and restart the server. Also this FAQ thread will be able to help you too.
  2. If you include that .dwt file into a .php file then the PHP code in the .dwf will be processed. If you go to the .dwt file then the PHP code wont be processed, unless your server is setup to parse .dwt files as PHP.
  3. You can just use MySQL to that for you in a query for that. Look into DROP TABLE IF EXISTS
  4. no you cannot override that restriction. However I believe you are including the file incorrectly. Try adding a period before /settings.php so its ./setting.php if you don't add that period you are telling php to include a file called settings.php in the root of file system. Wjen you add the period you tell php to include settings.php in the CWD (current working directory).
  5. make sure you connect to MySQL in your second code block. If you are not connected to MySQL the query will fail to work as there is no connection. What you should do is save your mysql connection code in a file called db.inc.php. Then include this file when you need to connect to the database like so: include 'db.inc.php';
  6. YOu cannot delete cookies of off the clients computer. Also when you destroy the session the cookie will be invalid as its tied to the session. If the session is invalid so is the session id in the cookie, this the cookie is invalid
  7. Its the same here too: echo "hello world"; yeilds: echo "hello world"; <?php echo "hello world"; ?> yeilds: <?php echo "hello world"; ?> Except SMF doesn't have HTML highlighting. However I'll try: <table><tr><td>balh</td></tr></table> yeilds: <table><tr><td>balh</td></tr></table> Yep SMF doesnt have html code highlighting. Prehaps ask SMF team (not us) to add it in for the next version.
  8. photobucket is a free image host. You can upload images/videos to photobucket.com for free. However it has nothing to do with what you are aksing. But what JP meant to say is thats the javascript photobucket uses to copy text to the clipboard
  9. You need to turn display_errors on too. EDIT: Hang on just re-read your first post. It not show_errors but display_errors to turn on error reporting
  10. Yeah I use speedtest.net all the time. I sometimes piss about doing speedtests on servers all around the world. Heres UK - New Zeland speed results lol : but my usual is this:
  11. Thats for red hat linux! However it does tell pretty much the same as what my FAQ tells you to do and what I said above.
  12. no need to change log_errors if you want errors to display to the screen. But yeah you will need to set the correct error_reporting level in order to for PHP to report you the correct type of errors, E_ALL is best for development/debugging purposes.
  13. Change it t On or 1 should do it. True may work as well.
  14. It is bescause you are passing it with unmodified value for the file variable. But then later on you modify the value on the variable to remove the extension. Simple change this: echo ' <option value="' . $file . '" onClick="form1.Title.value += \'' . $file . '\'">' . htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file))) . "</option>\n"; to this: $f = htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file))); echo ' <option value="' . $file . '" onClick="form1.Title.value += \'' . $f . '\'">' . $f . "</option>\n";
  15. You will want to add it to the select tag. So if you do this: echo "<form name=\"file\"> <select name=\"Files\" onchange=\"document.file.submit();\">\n"; When you choose an option it will submit the form.
  16. OK. Test to see if PHP is using the correct php.ini you are using. Simply create a file called test.php and add this to it: <?php phpinfo(); ?> Now run that file, look for the line beginning with Configuration File (php.ini) Path. Next that it should state the full path to the php.ini file PHP is using, if it is set to C:/WINDOWS on its own then php is not using the php.ini you are editing so any changes you make to the php.ini will not affect PHP. To insure PHP is using the php.ini you are editing, copy the php.ini to the WINDOWS folder (C:/WINDOWS NOTE: If you don't have a WINDOWS folder move to the WINNT folder instead). Now restart IIS. Does the Configuration File (php.ini) Path line now show the correct path to the php.ini? If it is scroll down until you find the MySQL Heading. If you find the MySQL heading then the MySQL extension is now enabled. If you cant find the MySQL heading then check that you have set the extension_dir directive to point PHP extension folder (C:/PHP/ext) and make sure you have copied a file called libmysql.dll from the PHP folder to the C:/WINDOWS folder. Now restart IIS and run phpinfo again. Check to see if there is a MySQL heading. If there is then the extension is loaded. If you make any changes to the php.ini you must save it and the restart the server.
  17. From looking at what you posted. PHP is running the script fine. However its your mysql configuration that is at fault when you connect. Make sure the username and password credentials you use on the mysql_connect function are correct.
  18. Rety my code again. I had major problems with it. I recoded and tested and you script works fine. <?php echo "<form> <select name=\"Files\">\n"; $dirpath = "./"; $dh = opendir($dirpath); while (false !== ($file = readdir($dh))) { if(substr($file, -4, 4) == '.txt') { if (!is_dir($dirpath . '/' . $file)) { echo ' <option value="' . $file . '">' . htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file))) . "</option>\n"; } } } closedir($dh); echo "</select> </form>"; ?>
  19. See if changing: while (false !== ($file = readdir($dh))) { if (!is_dir("$dirpath/$file")) { echo "<option value='$file'>" . htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file))) . '</option>'; } to this works: while (false !== ($file = readdir($dh))) { echo substr($file, -4, 4) . "<br />\n"; if(substr($file, -4, 4) == '.txt') { if (!is_dir($dirpath . '/' . $file)) { echo ' <option value="' . $file . '">' . htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file))) . "</option>\n"; } } }
  20. Why are you echo'ing the $x variable when you are setting it? Remove the echo. You cant echo a variable when you are creating it.
  21. Its called a query string. A query string is just a collection of variables that hold temporary data which will be used for the page you are currently on. You can access the variables in the query string in the url by using the $_GET variable.
  22. Agree'd and as of this. Locking this thread. Tips: Look in the Editor Help board, misc board and the Polls board.
  23. Thread locked. Please do not double post. You already posted this in the MySQL Help board.
  24. SO this doesn't work: <?php if(isset($_GET['keyword'])) { $keyword = $_GET['keyword']; $txt = 'Hello world how are you today?'; $txt = eregi_replace('(' . $keyword. ')', "<b style=\"color: red;\">\\0</b>", $txt); echo $txt; } ?> <form action="" method="get"> Keyworld: <input type="text" name="keyword" value="hello"><br /> <input type="submit" value="Highlight Keyword"> </form> When you use ereg you are using regular expressions. So you're best of reading up on the basics of regular expressions in or der to understand. Also you're best of readin up on how the ereg function works too, before I linked you to the eregi function which doesnt explain how ereg works.
  25. Thats javascript errors. Not PHP errors. This belongs in the javascript forum. Your PHP is error free, however you could do with making you PHP code better, by loosing the if statements and converting them into a switch statement. ALso for much smaller code you're probably better of implementing a database, not a MySQL database but a flat file database.
×
×
  • 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.