Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Try to use full paths eg: http://localhost/path/to/various/files rather than relative paths.
  2. Yes download the binaries. NOTE: Before installing Apache remove the files left over from uninstalling Apache2.2.x.
  3. Dont use .* it is greedy, instead use a-zA-Z for (case insensitve) strings 0-9 for integers. Prehaps have a good read on regular expressions. [code]RewriteEngine On RewriteBase /htdocs/shoping/ RewriteRule ^([a-zA-Z]+)/([0-9]+).html$ index.php?kategoria=$1&id=$2[/code] I dont know if this is a tupo but shoping is spelt shopping (note 2 p's)
  4. [b]THREAD CLOSED. ADVERTISMENTS ARE FORBIDDEN ON THESE FORUMS UNLESS YOU ARE POSTING WORK IN THE FREELANCING FORUM[/B]
  5. I see youre using apache2.2.x. PHP is not compatible with this version of Apache. See if downgrading Apache to Apache2.0.x solves this. If you want to use Apache2.2.x you'll want to download the third party php5Apache2.dll file from apachelounge.com
  6. Use text-align and not align align does not exist in CSS.
  7. 1em is about 16pixels.
  8. Blimmy! How old is this! Any way please [url=http://www.phpfreaks.com/forums/index.php/topic,95867.0.html]read this FAQ[/url] Thread closed.
  9. Prehaps use this as the query for $main: [code]SELECT m.id, m.name, m.email, me.icq_number FROM ibf_members as m, ibf_members_extra as me WHERE m.mgroup=4, m.id = me.id ORDER BY m.id[/code] It is untested however it should work.
  10. Whats the query used before the while loop. You shoud use a join instead if the two tables you are querying relate. If you use a join you dont need to do another (uneeded) query in the while loop.
  11. Use the [url=http://php.net/nl2br]nl2br[/url] function. Umm, redarrow beat me :)
  12. No. You cannot enable the mod_rewrite in a htaccess file. All Apache modules have to be enabled via the server configuration (httpd.conf) file. Ask your host whether they can enable the mod_rewrite module. If they will not enable the module then you'll either have to find a new host, or upgrade your hosting plan to one where you can control the Apache configuration yourself (most probably  a dedicated server plan) or dont use mod_rewrite.
  13. Try this instead: [code]RewriteRule ^alice.html$ bob.html[/code]
  14. I guess what they mean by "old syntax" is the use of register_globals. For example if your PHP setup has register_globals enabled, instead of using $_GET['url_var_here'] you used $url_var_here The "new syntax" is to disable register_gloabls (which is off by default as of PHP4.2.x) and use the new superglobals which are $_GET, $_POST, $_SESSION, $_COOKIE etc Another new sytax change is the old superglobals which are the $HTTP_*_VARS. For example instead of using $HTTP_GET_VARS you use $_GET instead for accessing vars in the URL. Or instead of $HTTP_POST_VARS your use $_POST etc.
  15. Oh. I know what it may be. You may have not had the correct file parmissions when you extracted PMA files and thus you got the 403 fobbiden error.
  16. Yeah I saw this a few weeks ago on youtube. Made me laugh.
  17. Yeah the following: [code]$message.="Country $country_name";[/code] Should work fine.
  18. Rather than using echo in the country function use a variable and retrun the variable: [code]function country() {     global $step3_country1;     switch ($step3_country1)     {       case '1':           $c = 'Brazil';           break;       case '2':           $c = 'China';           break;       case '3':           $c = 'Costa Rica';           break;       case '4':           $c = 'India';           break;       case '5':           $c = 'Ghana';           break;       case '6':           $c = 'Kenya';           break;       case '7':           $c = 'Nepal';           break;       case '8':           $c = 'Peru';           break;       case '9':           $c = 'South Africa';           break;       case '10':           $c = 'Tanzania';           break;       case '11':           $c = 'Thailand';           break;       case '12':           $c = 'Sri Lanka';           break;       case '1':           $c = 'Brazil';           break;       default:           $c = 'No Country Selected';     }     return $c; } $country_name = country(); ?>[/code] The code used is an adaptation of Kens code.
  19. You had a few badf syntax errors. Using echo within  variable is not allowed and thus why you got the parse error. I have corrected this issue and tidy'd up your code a little too: [code]<?php $con = mysql_connect("localhost","ZackBabtkis","") or die('Could not connect: ' . mysql_error()); mysql_select_db("test", $con); $result = mysql_query("SELECT * FROM messages WHERE ID=" . $_GET['id']); while($row = mysql_fetch_array($result)) {     $the_text = '<table border="10" width="400" cellpadding="0" cellspacing="3">     <tr>         <td background="table.jpg">             <h1 align="center">Message:</h1>' . $row['Message'];     $smilies = array( // code => image         'Smiley' => '<img src=smilies/smile.gif>',     );     $codes = array_keys($smilies);     $the_text = str_replace($codes,$smilies,$the_text);     echo $the_text; } echo "      </td>     </tr> </table>"; mysql_close($con); ?>[/code]
  20. From looking at the code the variable $step3_country1 is set outside of the country function variables within in a function do no have global scope, meaning they can only be used within the function and not outside of the function. In order for your country function to use the $step3_country1 variable, you'll either have to pass it as a parameter [code]function country($step3_country1) {   // your code here for the function } $country_name = country($step3_country1); echo $country_name;[/code] Or define the $step3_country1 variable as global within your function: [code]function country() {     global $step3_country1;     // your code here for the function }[/code]
  21. You need to either setup an SMTP server on the computer that has PHP installed on. Or point PHP to an existing (public) SMTP mail server, such as your ISPs email server (if they do not require authentication for emails to be sent). You need to open up the php.ini and find the the following lines: [code]; For Win32 only. SMTP = localhost smtp_port = 25[/code] Change localhost to your ISPs SMTP mail servers addresss, eg: smtp.hostname.com the smtp_port is fine.
  22. Whats your rewrite rules. Post your rewrite rulese here. You need to setup some rewrite rules in a htaccess file in order for http://domainname/john to work. Fo example. You have a file called profile.php and you use a url parameter called user, which profile.php uses to grab the details of that user. Instead having to type http://domainname/profile.php?user=user_here You want to use http://domainname/user_here In order to do that a rewrite rule needs to be setup for modRewrite to use. So your rewrite rule will be something like this: [code]# Tell Apache you want to use mod_rewrite RewriteEngine On # Setup the rewrite rul RewriteRule ^([a-zA-z]+)$ profile.php?user=$1[/code] You cannot just uncomment the mod_rewrite module and expect it to work just like that.
  23. Wheres the question? You've done the intro. Now the questions needs to be there.
  24. You can redirect with a delay with PHP. Use a header refresh: [code=php:0]header("Refresh: 5; URL=http://www.google.com");[/code]
  25. You dont need to use cgi-script. PHP is more than capable of doing what you want to do. If you are unsure on what to do, then prehaps it'll be handy for you tot goto [url=http://www.php-mysql-tutorial.com/]php-mysql-tutorial.com/[/url]. I suggest you read through tutorials 3 throught to 7. If you are new to pHP and dont quite get the PHP syntax then start with tutorial number 2.
×
×
  • 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.