Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. You are misisng a semi-colon after $team
  2. It would work if she has a static IP address. Many ISPs uses dynamic IP addresses where a new IP address is automatically assigned on either everytime she connects to the internet, each time she loads a webpage, every couple of hours etc. So Storing here IP address isnt such a good idea. Also take into account whether she is behind a proxy. If she is $_SERVER['REMOTE_ADDR'] will not get her IP address but the Proxies IP Address. To get her IP address you want to use $_SERVER['HTTP_X_FORWARDED_FOR'] or any of the other forwarded_for server variables to get her true IP Address rather than the proxy servers.
  3. You can get the last item in the array using the [url=http://www.php.net/end]end[/url] function. You can also manually navigate an array using the [url=http://www.php.net/prev]prev[/url]/[url=http://www.php.net/next]next[/url] functions.
  4. It does however the cache server does sort itself out after a couple of days and everythinks back to normal again.
  5. No. Tinyint can only hold an Integer that is between -128 and 127 when it is signed. If its unsigned it can hold an integer between 0 and 255 Have a look at the Data Types column in this [url=http://www.ilovejackdaniels.com/mysql_cheat_sheet.png]cheat sheat[/url] to see what each data type can hold
  6. I think he ment last night. Last night about (10PM UK (GMT) Time) any page I went to the page kept loading and loading and loading. I get this from time to time, I dont think its to do with phpfreaks.com but to do with my ISP (which is NTL:). They use cache servers and transparent proxies and from time to time I get timeouts trying to connect to any freaks.com domain, the only one I can connect to is hostfreaks.com. I can solve this manually by changing to a different proxy, however it becomes the luck of the draw to find an NTL proxy that'll work. When this happends I use trace route to ping phpfreaks.com and I see it sometimes timesout around serverpowered.com.
  7. [quote author=Caesar link=topic=103344.msg411458#msg411458 date=1154996521] [quote author=tomfmason link=topic=103344.msg411456#msg411456 date=1154995955] Also * means and. [/quote] I must be misreading this because, "*" definitely does not mean "and". It means "all". [/quote] If you are using it in a mysql query then yes, but not in PHP. Read thropes post for the meaning of the * operator in PHP.
  8. Much neater to use a swtch: [code=php:0]// check that $_GET['act'] exists, if it does use its value, else set a defualt value $act = isset($_GET['act']) ? $_GET['act'] : 'home'; // now we check the value of act switch($act) {     // think of this as an if statement that says if $act is equal to home, or info or pruducts include $act.php     case 'home':     case 'info':     case 'products':         include $act . '.php';     break;     // and this as the else bit     case defualt:         die("Invalid value for act");     break; }[/code] however the page will still reload to get the new content
  9. When you specifiy the length it means the length of the number, so if its 4 it'll accept upto a 4 digit number, where as 10 will allows upto a 10 digit number.
  10. First what is the servers OS your site is hosted off of, you can check this by creating a file called info.php and put this init: [code=php:0]<?php phpinfo(); ?>[/code] Now upload it to your site and run info.php. When you run that it generates a page full of info about php and your server. Look for the System row, it should be the first line. To the right of the System row text it should state the server OS. IF it states windows you dont have to worry about CHMOD permissions, as windows doesnt have CHMOD permissions. However if its *unix then you may need to chmod the text file. To CHMOD the file you'll want to use FTP. You can use FTP with ripway by reading [url=http://ripway.com/help/kbase.asp?category_id=1&article_id=15]this FAQ[/url]. Once you have your FTP client logged in you need to navigate to your txt file then right click it and select Properties and there should be a CHMOD/File Permissions somewhere. Just tick all 9 boxes and click OK. You have just changed the permission of your file! Additionally you can chnage file permissions with PHP with the chmod function. Just do this: [code=php:0]chmod('filename.txt', 0777);[/code] That will attempt to change the permissions of the file/folder specified.
  11. You wont be coding in cgi. CGI beens the way PHP talks to the server basically.
  12. How are you reviewing RockingGroudons site when theres no link! Post the god damn link.
  13. To write a file on the server you can use fopen, fwrite and and fclose. All these functions are explained over at http://www.php.net/fopen I'll post a simple example in a minute
  14. Does your host use PHP4? You can check the version of PHP your host has by creating a file called info.php and put this in it: [code]<?php echo phpversion(); ?>[/code] Now upload that to your site and run it. What does it retrun. If its returns 5.x.x then you are running PHP5. If its PHP4.x.x or less then those version dont support try/catch. try/catch is for PHP5 and above
  15. You are using font tags which are depreciated. No CSS what so ever, a few inline styles, with absolute positioning which is not really recommended. Using tables. CSS layouts are better for SEO as there is far less HTML for the crawler to go through and can index the content much faster. You should look into using a stylesheet for your designs. Dont use attributes within the body tag, as this also depriciated (well I class it as depreciated). dont use the font tag, leave it to CSS. Surely typing <font face="blah">blah blah</font> must get tedious? You can style all the font on you page with just few lines of CSS. [code]body {   font-family: Verdana, Arial, san-serif;   font-size: 12px; }[/code] For me you code is not standard HTML, if it was standard HTML your page would [url=http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.gewebsitedevelopment.com%2F]validate[/url].
  16. Looks fine for me in IE7 and FF however. Why i get this in FF: [quote]Error ! The current browser is either too old or too modern (usind DOM document structure). [some calander here][/quote] You browser detection script appears to be maltfunctioning.
  17. [b]edit[/b] I made a complete tit of myself. Going through your code and indenting it I found your  { and } brakets where unbalanced. Try this: [code=php:0]<?php $file = "testpage.txt"; if (file_exists ($file)) {     // The Error is occuring here     try     {         if ($readfile = fopen ($file, "r"))         {             $curvalue = fread ($readfile, filesize($file));             $curvalue++;             if (is_writable ($file))             {                 try                 {                     if ($writefile = fopen ($file, "w"))                     {                         fwrite ($writefile, $curvalue);                         echo "Wrote $curvalue to file.";                     }                     else                     {                         throw new exception ("Sorry, the file could not be opened");                     }                 }                 catch (exception $e)                 {                     echo $e->getmessage();                 }             }             else             {                 echo "File could not be opened for writing";             }         }         else         {             throw new exception ("Sorry, the file could not be opened.");         }     }     catch (exception $e)     {         echo $e->getmessage();     } } else {     echo "File does not exist."; } ?>[/code]
  18. You sorted the error then with the aid of mysql_error()?
  19. Yes you can call a function within a function. However if you have a function defined within a function you first have to call the function that has the embeded function. Then you can call the emebed function. Like so: [code=php:0]// define the function within a function function foo() {     function bar() {         echo "foobar";     } } //call foo first foo(); // now you can use bar function bar();[/code]
  20. Use mysql_error() function within your or die clause: [code]$query = mysql_query("UPDATE projects SET name = '$name', domain = '$domain', designers = '$designer', developer = '$developer', deadline = '$deadline', webhosting = '$webhosting', projecturl = '$projecturl', phase = '$phase', status = '$status' WHERE name = '$name'") or die ("Unable to run query: " . mysql_errro());[/code] This will now return an error from mysql itself which will help you why your query is failing.
  21. In most cases yes.
  22. If you are exporting a MySQL5 database in phpMyAdmin to MYSQL4. Make sure when you are in the export page (by clicking the Export tab at top of the page for your database). That the [b]SQL export compatibility[/b] option is set to MySQL40 and that the [b]Add AUTO_INCREMENT value[/b] checkbox is checked.
  23. <? $PHP_SELF ; ?> should be <?php echo $_SERVER['PHP_SELF']; ?>
  24. Cookies/Sessions should work on localhost. Just make sure your browser accepts cookies and that PHP the sessions settings are setup correctly,the defualt settings defined in php.ini are fine.
  25. [quote author=spfoonnewb link=topic=103293.msg411262#msg411262 date=1154963079] [quote]SELECT * FROM details [/quote] [/quote] Thats not what orio ment,m that code doesnt select the database but queries the details table. He ment selecting mysql database using mysql_select_db('dbname_here'); stevens I'd suggest you use: [code]$connection = mysql_connect($hostname, $user, $pass) or die ("Unable to connect!"); mysql_select_db($db, $connection); $query = "SELECT * FROM details WHERE order_no != 0"; $result = mysql_query($query, $connection) or die ("Could not execute query: $query. " . mysql_error());[/code]
×
×
  • 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.