Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Most of the extensions that come with PHP come with the external modules, yes. For example mysql library (and mysql improved library) depend upon an external library called libmysql.dll (this comes with PHP and is in the root of the PHP folder). When you enble the mysql extension you should copy this file to the WINDOWS folder otherwise PHP wont be able to load the mysql extension. NOTE: It is a good idea to add the PHP folder to the Windows PATH variable. This eliminates having to move PHP's files around as well as help with extensions loading correctly.
  2. Just turn of mod_rewrite in the board directory by adding a .htaccess file in board/ with the following [code]rewriteEngine Off[/code]
  3. YOu will want to the Zipped package and thats it. The extensions you want come with PHP by default. In order to use them once PHP is installed and setup you will need to enable them in the php.ini, by removing the semi-colon from the start of [tt]extension=bla blah[/tt], example to enable the mysql extension you change this line: [tt];extension=php_mysql.dll[/tt] to this: [tt]extension=php_mysql.dll[/tt] When you have done that your save the php.ini (and now the important step) and then restart Apache.
  4. From looking at the code you don;t need to type anything in there. That script properly including a configuration file which has the necessary bit to edit.
  5. [quote author=Nameless12 link=topic=124015.msg516344#msg516344 date=1170100682] [quote author=wildteen88 link=topic=124015.msg513454#msg513454 date=1169755493] You cannot run .php files by "double clicking" them, like you can with .html or .exe files for example. You have to move it to you servers document root and then go to http://localhost/ to run the php file. PHP is a server side programming language and thus requires to be run in a server setup. Or you can run then via the command line. You can install Apache (the server) and PHP on your PC locally. Read [url=http://www.phpfreaks.com/forums/index.php/topic,120152.msg492660.html#msg492660]this[/url] post of mine to do so. Or you can go the lazy root and install one of those horrid all-in-one installations over at wampserver.com or xampp.com [/quote] that is not true. php comes with an executable that can execute php files [/quote] Yeah if you like to use the command line!
  6. You have auto sessions enabled. Disable this setting in the php.ini when you do restart Apache. There is nothing wrong with your code. However what I recommend you to do is to search for the following in the php.ini: [tt]display_errors = Off[/tt] and change it to [tt][tt]display_errors = Onn[/tt] - save php.ini and restart Apache. You should always enable this setting when you get problems with your scripts. It will show any errors that occur to you on screen.
  7. When you run your html and PHP files you are going to http://localhost in your browser first right? You are not double clicking them. I don't understand that last bit either just ignore it. Also I noticed the book said to add this line to the httpd.conf: [code]Action application/x-httpd-php "/php/php.exe"[/code] Remove it that lines not needed.
  8. [quote author=tarun link=topic=124015.msg515497#msg515497 date=1170007113] thanks for your help but im afraid im only 12 so im not sure my Dad would approve thanks anyway your help was greatly appreciated and valued [/quote] If you want to run your PHP files on your PC then you need to install Apache and PHP! There is no other way.
  9. To un-install PHP just delete the PHP folder - thats it. However once PHP is un-installed you will need to de-configure your http server to stop it loading PHP If you have IIS and Apache installed only enable one you cannot run both at same time (best to unistall IIS IMO - you can install IIS again if you wish via Add/Remove programs in the Control Panel). I prefer Apache myself.
  10. You need to edit the php.ini and configure the SMTP mail settings. Try your ISP's mail server settings (smtpt.myISPdomain.com) once you have set up the Mail settings restart XAMPP.
  11. Completely uninstall MySQL. When MySQL is uninstalled go to where MySQL was installed and delete any leftover files/folders (delete the main mysql folder). Now reinstall MySQL. Mack sure you run the MySQL Server Instance Config Wizard to configure the MySQL server (this may not come with MySQL4).
  12. I forgot to mention to change the following: [code]$txt = @$_POST['txt']; if( $txt == NULL ){[/code] to this: [code]if(isset($_POST['txt']) {     $msg = $_POST['txt'];[/code] Always use isset when checking $_POST and $_GET variables.
  13. I just don't get how you managed to phuge WAMP up! Just do a reinstall don't jump from package to another either and always remove any traces of a package you have installed. If it helps watch this vid tutorial [url=http://www.phpvideotutorials.com/lesson01/]here[/url] for installing WAMP. To enable different extensions for PHP just edit the php.ini - most common extensions (should) come with PHP. If they don't just go to php.net download php (make sure its the same version) again (make sure its not the installer! Get the zipped binaries) and the just extract the extension folder out of the zip to PHP's installation folder. However IMO depending on how well you are with computers I prefer a manual install of Apache, PHP and MySQL. if you do that you will get a much better understanding on how these work.
  14. Are you using IIS? How is PHP setup with the server (software)?  You need to provide more info than that
  15. I'm not sure what you mean by this: [quote]when I open a html file that should call php one[/quote] Could you provide more info please. Does this happen to any php file you go to? If it does then you havn't configured Apache (or whatever server you are using) properly
  16. [quote author=Orio link=topic=124276.msg514800#msg514800 date=1169916450] @wildteen88- Correct me if I a wrong, but as far as I know a persistent connection cannot be closed. From the manual: [i]"the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect())."[/i] It seems like it's closed automatically somehow.... EDIT- after some reading, it appears that persistent connection just don't close. @Anidazen- Try increasing the mysql.connect_timeout directive and see if the connection still times-out. Orio. [/quote] mmm... I swear you could use mysql_close to close a persistent connection before. I guess they have changed that now.
  17. Try a non persistent connection instead (mysql_connect not mysql_pconnect). When ever you use persistent connections make sure you are closing the connection at the end of your script or when you are finished using mysql.
  18. Thats the code Dreamweaver generates when you use its built in database query tools.
  19. Does the file (that has the PHP code in) have a file extension that ends in .php?
  20. [quote author=tarun link=topic=124015.msg514728#msg514728 date=1169905354] [quote author=jvrothjr link=topic=124015.msg513448#msg513448 date=1169755194] Are you looking to view the CODE or the output of the code [/quote] The Output Thanks To View The CODE Ive Got My Trusty Old EditPlus TextEditor [/quote] Then read my post I made above. Which was this: [quote author=wildteen88 link=topic=124015.msg513454#msg513454 date=1169755493] You cannot run .php files by "double clicking" them, like you can with .html or .exe files for example. You have to move it to you servers document root and then go to http://localhost/ to run the php file. PHP is a server side programming language and thus requires to be run in a server setup. Or you can run then via the command line. You can install Apache (the server) and PHP on your PC locally. Read [url=http://www.phpfreaks.com/forums/index.php/topic,120152.msg492660.html#msg492660]this[/url] post of mine to do so. Or you can go the lazy root and install one of those horrid all-in-one installations over at wampserver.com or xampp.com [/quote]
  21. Its mainly the way you parse your code BBCodes. What you are doing is parsing them as "static" text, want to do is parse them dynamically - meaning give each code box there own unique id. In order to do that you need to change the way you are parsing your code BBcodes slightly. Here intructions in doing so. Change the following: [code]'/\[align=justified\](.*?)\[\/align\]/is', '/\[code\](.*?)\[\/code\]/is' );[/code] To this: [code]'/\[align=justified\](.*?)\[\/align\]/is' );[/code] Now change this: [code] '<div style="text-align: justified;">$1</div>', '<div style="border:1px solid #000000;display:table;width:350;margin:0px auto;"> <div style="background-image:url(code_top.png);background-repeat:repeat-x;"> &nbsp;<a href="javascript:menu(\'code1\',\'expand1\',\'collapse1\');" title="Show Or Hide This Code"><span id="expand1" style="display:none;"><img src="expand.gif" width="9" height="9" alt="[-]" border="0"/></span><span id="collapse1" display="inline"><img src="collapse.gif" width="9" height="9" alt="[-]" border="0"/></span></a> Code :: <a href="javascript:code_select(\'code1\');" title="Highlight The Code">Select Code</a> </div> <div id="code1"> <div style="background-color:#000000;height:1px;width:100%;font-size:0;"></div> <div style="background-color:#5A2323;height:1px;width:100%;font-size:0;"></div> <div style="background-color:#470A0A;"><code>$1</code></div> </div> </div>' );[/code] To this: [code] '<div style="text-align: justified;">$1</div>' );[/code] The final change is to change this: [code]    $msg = htmlentities($txt);     $msg = stripslashes($txt); $msg = nl2br($msg); $msg = preg_replace($bbsearch, $bbreplace, $msg); echo "Why Did You Write $msg?"; }[/code] to this: [code]    function makeCodeBox($code, $cID)     {         $code = str_replace(array("[", "]"), array("&#91", "&#93"), $code);         $html = <<<HTML <div style="border:1px solid #000000;display:table;width:350;margin:0px auto;">   <div style="background-image:url(code_top.png);background-repeat:repeat-x;">     <a href="javascript:menu('code{$cID}','expand{$cID}','collapse{$cID}');" title="Show Or Hide This Code">       <span id="expand{$cID}" style="display:none;"><img src="expand.gif" width="9" height="9" alt="[-]" border="0"/></span>       <span id="collapse{$cID}" display="inline"><img src="collapse.gif" width="9" height="9" alt="[-]" border="0"/></span>     </a>     Code :: <a href="javascript:code_select('code{$cID}');" title="Highlight The Code">Select Code</a>   </div>   <div id="code{$cID}">     <div style="background-color:#000000;height:1px;width:100%;font-size:0;"></div> <div style="background-color:#5A2323;height:1px;width:100%;font-size:0;"></div> <div style="background-color:#470A0A;"><code>{$code}</code></div>   </div> </div> HTML;         return $html;     }     $msg = htmlentities($msg); $msg = stripslashes($msg);     $msg = nl2br($msg);     $i = 0;     while(preg_match("/\[code\](.*?)\[\/code\]/ise", $msg, $matches)) {         $i++; $msg = str_replace($matches[0], makeCodeBox($matches[1], $i), $msg); } $msg = preg_replace($bbsearch, $bbreplace, $msg); echo "Why Did You Write $msg?"; }[/code]
  22. Is this your own forum you made or is this a forum script you downloaded? If its a forum you downloaded then this thread belongs in the [url=http://www.phpfreaks.com/forums/index.php/board,34.0.html]Third Party PHP Scripts forum[/url]. Also can you tell us what forum you are using too.
  23. If you used the forums search feature you should of come across [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]this FAQ[/url]. It should help you. the mysql library (and mysql improved library (php_mysqli.dll)) depend upon another file called libmysql.dll - this file should be located in the root of your PHP folder (C:\php). It is best to add PHP to the Windows PATH variable. This saves having to move PHP's files around the file system. If you don't add PHP to the Windows PATH then copy libmysql.dll to C:/WINDOWS Restart Apache (or whatever your server is). The MySQL library should now be loaded*. * Make sure you have enabled the extension in the php.ini and that you have setup the extension_dir directive correctly too.
  24. If you are echo'ing large amounts of HTML (including Javascript and CSS) use [url=http://uk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc]herdoc syntax[/url] Also rather than alerti'ing one error message at a time, show all the errors on big alert box. I have done this for you. [code]<?php echo <<<HTML <html> <head> <script type="text/javascript"> function check() {     var error = new Array();     var error_msg = "";     var frm = document.getElementById("form");     if(frm.name.value == "") {         error[0] = "Eenter your Name";     }     if(frm.card_no.value.length < 16) {         error[1] = "Card No. left blank or is invalid";     }     if(frm.exp_date.value == ""){         error[2] = "Card expirary date left blank";     }     if(error.length > 0) {         for(i = 0; i <= (error.length)-1; i++) {             if(error[i] && error[i] != "") {                 error_msg += "\\t- " + error[i] + "\\n";             }         }         alert("Please fix the following errors:\\n\\n" + error_msg);         return false;     } else {         return true;     } } </script> </head> <body> <form id="form" method="POST" action="?passed=true" onSubmit="return check();">   Name: &nbsp; <input type="text" name="name" size="20"><br />   Card No.: &nbsp; <input type="text" name="card_no" size="16"><br />   Expiry Date: &nbsp; <input type="text" name="exp_date" size="20"><br />   CVV: &nbsp; <input type="text" name="cvv" size="20"><br />   Amount: &nbsp; <input type="text" name="amt" size="20"><br />   <input type="submit" name="confirm" value="Confirm"> &nbsp;   <input type="reset" name="reset"> </form> </body> </html> HTML; ?>[/code]
  25. Sooo... Whats wrong? What the code supposed to do, what is happening etc. Do not just post code post an explanation aswell. Also post any errors you are getting in full here too.
×
×
  • 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.