Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. [quote author=lszanto link=topic=121111.msg498089#msg498089 date=1168080121] If your trying to install it all so it runs together just download wamp which can be found at http://wampserver.com/ just download it and it has php, mysql and apache all set and configured for each other. [/quote] How does that help! I hate it when people post s*** like that. Its the same when someone has a problem with IE. Instead helping getting IE sorted they say go get FF or some other browser. Now how to configure Apache and PHP follow these steps: Open the httpd.conf for Apache and the following lines at the bottom of the file: [code]LoadModule php5_module "C:/php/php5apache2_2.dll" PHPIniDir "C:/php" AddType application/x-httpd-php .php AddType application/x-httpd-phps .phps[/code] Save the httpd.conf and restart Apache server. Create a test file in the htdocs (in the root of Apache install folder) folder, call it test.php and add the following code to it: [code=php:0]<?php phpinfo(); ?>[/code] Save the file. Now go to http://localhost/test.php and you should get a page full of information about PHP and its environment. If you do PHP is now setup with Apache!
  2. It is most probably a problem with the MySQL server. It shouldn't be your ISP at fault. However what I recommend you to do is to install MySQL locally while you are developing your script. When you are finished just do a mysql dump on your local database and then upload the dump to your remote MySQL database. Also I do not recommend you to use Dreamweaver's generated code from the wizards. Whenever coding in PHP do it by hand, don't use the automated tools.
  3. If you are on a shared host then I would save the sessions to a private directory in your webspace. The best place would be outside of your web root (the web root is the directory in which you upload you files to). That way it is inaccessable from people browsing your website. Only you can read that directory (via FTP).
  4. You will want to create a function say call it getPlayer. You will then call this function from your regex when a patch is found. When a match is found you will give the getPlayer function the id for the player. The function will then query the databases for the player id and return the player name. When the player name is returned it will then create the link and return the link back. You will want to modify your player regex slightly to this: [tt]/\[player\](.*?)\[\/player\]/ise[/tt] You may note the addition of the [b]e[/b] modifier at the end of the regex. The e modifier is used so you can execute PHP code in the replacement parameter. So this is what you'll want to do. Change [tt]'<strong>$1</strong>',[/tt] from the smple_replace array to this: [code]"getPlayer('$1')"[/code] Now add the following function to your script: [code=php:0]function getPlayer($playerID) {     $qry = "SELECT username FROM unc_users WHERE user_id='$playerID' LIMIT 1";     $result = mysql_query($qry);     $player = mysql_fetch_assoc($result);     $playerLink = '<a href="player.php?pid=' . $playerID . '">' . $player['username'] . '</a>';     return $playerLink; }[/code] You may need to change the query ($qry) to your needs and modify the player link too.
  5. This will require regex. You will want to write a regular expression (regex) to phish out URL's within a string and then warp the anchor tags around it to be converted to a line. I believe there may already be a thread like this in the regex forum. Search the regex forum and see.
  6. Yeah this sounds like a register_globals problem. When register global's is enabled it allows you to use the key to the super_global array as the name for the variable. For example you can use $name or $_SESSION['name'] to write/read to the session named name. Regsiter globals is now set to off by default as of PHP4.2 as it can cause security exploits within your code. regsiter_globals will soon be gone for good as of PHP6 (thank god). If your host allows you to use .htaccess files then I would recommend you add the following to a .htaccess file in your document root (the place where you upload your files to) with the following code in it: [tt]php_flag register_globals off[/tt] That should turn register_globals off throughout your website. For more information on register globals please read [url=http://uk2.php.net/register_globals]this page[/url]
  7. as taith stated this is for getting help with your website/script you are developing (not get us to do it for you). If you want someone to do something for you post in the freelancing forum. Not here. Also learn to walk before you can run! You are a classic example of many PHP noobs. Dont understand.. cant be bothered.. get someone else to do it for me. You will not pickup PHP straight away. PHP is a programming language. It takes time to understand it. When starting out with PHP create something extremely basic such as form with an input field and then show what ever was entered in the browser. Then build on that basic script with the skills/knowledge you build as you learn PHP. From that simple script you might be able to convert it into a guestbook or somethin, and then that guestbook into a forum/blog. You will not stop learning PHP.
  8. http://www.php.net/documentation If you wish to download it, you can get it from [url=http://www.php.net/download-docs.php]here[/url]. If you are on Windows I'd recommend you to download the manual in chm formation.
  9. Redo the whole lot. You dont need to style every single tag on your page. Alot of the time you are repeating your self. Such as here: [code]table, tr, td{background-color:transparent; border-style:none; } table table table, table table table td{ background-color:transparent; }[/code] Above you telling the browser to give table, tr and td tags a transparent background. Then on the next line you say give any td tag within table table table a transparent background. There is no need for that as you've already done it above! I ahve not seen your HTML source but looking at the CSS you are using them far too often. Cut down on the use of tables and try to go for a CSS layout instead. You will have far less html and have smaller file space (which can help to save bandwidth).
  10. Delete the installer and get the zipped binaries (PHP 5.2.0 zip package) instead. The installer isn't needed. Once you have download right click and select Extract All... Extract the zip contents to C:/PHP PHP is installed! Now all you need to do now is configure Apache to parse PHP files with the PHP interpreter. The installer does the same thing as what you have just done. It also attempts to configure the server you using too.
  11. Your php.ini is fine. I don't know what to suggest sorry. Could you post the code that you use to connect to MySQL here.
  12. For mbstring error you just need to enable the mbstring extension. uncomment the following line: [tt];extension=php_mbstring.dll[/tt] To uncomment remove the semi-colon (;) at the beginning of the line. Save the php.ini and restart Apache. Not sure what you mean for your second question. Need more info really.
  13. You dont need it in program files. I prefer to install everything in the root of the hard drive in a folder called server. SO my server directory will be like this: C:/server +-- Apache2 +-- PHP +-- MySQL I assumed you had PHP installed in C:/PHP looking at this line [tt]#LoadModule php5_module C:/php/php5apache2.dll[/tt] Umm, hangon youb have that commented out. You need to uncomment that line and change it to this@ [tt]LoadModule php5_module C:/Program Files/php/php5apache2.dll[/tt]
  14. I forgot to mention this earlier - make sure you are restarting Apache when you make the changes. If you dont restart Apache the changes will not take affect until you do.
  15. If its on for locally then it must be being changed from an .htaccess file.
  16. That is fine. However this is wrong: [tt]Addtype PHPIniDir "C:/Program Files/php/"[/tt] It should just be: [tt]PHPIniDir "C:/php"[/tt] Place the php.ini in the C:/php where you have PHP installed or in the WINDOWS folder.
  17. No as you need to compile PHP in order to install it, you can not just place it on the server and pray it will work just like that. However I would seriously hammer on to your uni's IT dept. to upgrade Apache and PHP as they are seriously outdated!
  18. Did you login to MySQL via the command line okay? PHPs configuration is fine. I just dont get why it is trying to connect to MySQL with the username SYSTEM!
  19. By default PMA's (phpMyAdmin) uses the username/password defined in the configuration file (config.inc.php). If you wish to get a login box when you go to phpMyAdmin you will need change PMA's configuration. So go to phpMyAdmin find the following file named config.inc.php Open that file up for editing and find the following line: [code=php:0]$cfg['Servers'][$i]['auth_type']    = 'config';    // Authentication method (config, http or cookie based)?[/code] change 'config' to 'http' instead. Save the config.inc.php file and relaunch PMA in the browser. You should now get a login window appear. Enter the username and password in to login to PMA
  20. WTF! OK try this: Go to Start > Run > cmd Type in the following: mysql -u root -p press enter. Enter the password for the root user and then press enter. Do you get logged in to MySQL now? You now when you get logged in to MySQL as you will get a Welcome to MySQL blah blah blah... message and the C:/Documents and Settings/UserName> changes to mysql> If you get that then type in exit press enter and exit again and press enter. This will log you out of MySQL and close the command window. Ok so MySQL is fine and you can log in via command line. There must something wrong with PHP. Create a new file called test.php and add the following code to it: [code]<?php phpinfo(); ?>[/code] and go to http://locahost/test.php Scroll down to the section headed [b]mysql[/b]. Copy whats after that heading here.
  21. Find and open the php.ini and find [tt]display_errors = Off[/tt] to [tt]display_errors = On[/tt] Save the php.ini and restart the server. You should now get errors onscreen when they occur. Also make sure the error reporting level is set to E_ALL. it usually is by default. But always check.
  22. Copy the one from default folder to the conf folder instead.
  23. Where are you editing the httpd.conf from? You should be editing the httpd.conf located in the conf folder (C:/[path to apache2.2]/conf/httpd.conf).
  24. You are editing the httpd.conf file from Apache aren't you? What version of Apache are you using? You can add [tt]AddType application/x-httpd-php .php[/tt] anywhere in the httpd.conf. However it is best to keep it in order. Just search for AddType and add [tt]AddType application/x-httpd-php .php[/tt] after it.
  25. What error message are you getting.
×
×
  • 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.