Jump to content

Yesideez

Members
  • Posts

    2,342
  • Joined

  • Last visited

Everything posted by Yesideez

  1. Have a look at this: http://www.webreference.com/programming/phpanth2/
  2. I've done a phpinfo() to get the full server path and have set up a cron job to execute every minute of every hour to send me an email. Its been running for about 20 minutes so far and nothign has come through - this is what I've entered as the command line: [code]/usr/bin/php /home/randgigs/public_html/relocate.php > /dev/null 2>&1[/code] Any idea what is wrong? I know the script works as I typed it into IE and the email came through straight away!
  3. Browsers will automatically remove multiple spaces and replace them with one single space. What you need to do is replace the two spaces with   (non-break space) if you want those two spaces to appear. Browsers treat the non-break space as text even though you can't see it so you can do this: [code]echo $info.' ';[/code] That way the browser will replace the two spaces with one single space and the non-break space will be tagged onto the end giving the illusion of two spaces.
  4. Thanks, just been reading up on it and discovered that if a folder is set to "execute" it doesn't mean files in that folder can be executed (as I thought) but means that the folder can be searched/browsed. Now just got to add a small index.html file in each folder to stop people browsing them...
  5. Top job, works a treat! Many thanks :D
  6. I've got this code at the start of each page: [code]header('Cache-Control: no-cache');   header('Pragma: no-cache');[/code] Users upload their profile pic and it is stored on the server always as profile.jpg in their own folder. Its viewing perfectly fine but when they upload a new one the previous image is shown as its cached - how can I tell the browser to reload the image without using a different filename for the image? I've even tried placing a full URL to the image including http:// to no avail and I've spent ages searching on Google for a solution also to no avail.
  7. Try using phpinfo() to see if PHP is enabled - I have only ever used my own web space and know nothing of geocities although I do know there are some free web space providers who do have PHP enabled. [code]<?php   phpinfo(); ?>[/code] That should display a large page if successful. When it comes to web space you get what you pay for. If you can afford a bit more it might be worth getting some web space from a proper supplier. The only one I use for all my sites is www.webhost-nation.com and its a UK-based company but I believe the servers are in the US - not sure. Its a relatively new company and is owned by a friend.
  8. Have you checked the junk inbox of your hotmail account its being sent to? I've found emails generated by my scripts often end up there.
  9. Hi, PHP is a great start and is good that you have an understanding of HTML and I'd also say CSS would be a good thing to learn as it'll be a great help with keeping your pages looking good as well as being able to manage them easier. PHP can look confusing at the beginning as can any scripting/programming language. Can you remember what you thought of HTML when you first set eyes on it? How does it look now? When I started learning PHP and MySQL I downloaded loads of sample scripts, followed through tutorials and took it slowly. The first tutorials I followed were at http://www.w3schools.com - click "Learn PHP" in the left menu. If you ever need in-depth instructions on a particular function in PHP then fire up Google and type [b]php <function>[/b] and 99.9% the first entry returned will be what you need.  For example, type [b]php mysql_query[/b] into Google and you'll get a link to www.php.net http://www.pictureinthesky.net/lealta.zip (1.5MB) Download this and have a play - its a game I started writing but didn't quite finish due to other commitments but should give you a bit of a head start. Do what you want with this zip (same goes for anyone else as well) its a shame to have this sat on my PC doing nothing wasting away. Here are two screenshots of what it is: http://www.pictureinthesky.net/02.jpg http://www.pictureinthesky.net/03.jpg I'm sure others will be able to post some other great places to start.
  10. I seem to have a case of "post a question then find the answer yourself"... :S Change 666 to 0666 for octal and it works. Only problem is, any picture I upload into profiles/oliveri/ gives me a 403 (Forbidden) when I try and display them. Any idea of what permissions I have to set the "oliveri" folder to allow anyone access to it without letting the general public delete files contained within these folders?
  11. I've created a folder using FTP and this: [code]mkdir("profiles",666);[/code] Both times the folder is created no problem. I need my script to create extra folders inside "profiles" on the fly as users register yet when I try this: [code]mkdir("profiles/oliveri",666);[/code] I get this error message: [code]Warning: mkdir(profiles/oliveri): Permission denied in /home/randgigs/public_html/profile.php on line 8[/code] The value 666 in mkdir() is for read & write access. Can someone tell me where I'm going wrong please? Many thanks.
  12. Many thanks - will go off and hunt some down now :)
  13. I use tables everywhere and I'm not new to CSS but i rarely use <div> because I've found it such a pain in the past. Know any sites I can look at to see how they can be used?
  14. Can I ask how you can make tables with <div>s? Aren't <div>s just horizontals?
  15. Hi guys, I'm still in need of help here if anyone can help... When users register on my site (they're limited to only a-z characters) they have a folder made in a "profiles" folder which is their username. All their profile images are uploaded here. When viewing their profile even if logged in I keep getting a 403 (Forbidden) and can't figure out why - anyone have any ideas?
  16. I fixed it by removing the first "/" in $targetfile - weird!!! Only problem is: the folder "zeb" keeps resetting back to chmod(read+exec) - any idea why?
  17. Here's my code: [code]  if ($_POST['subuploadpic']) {       if (move_uploaded_file($_FILES['picfilename']['tmp_name'],$targetfile)) {         $msg="File uploaded";       } else {         $msg="File upload failed: $targetfile";       }   }[/code] $targetfile is set to "/profiles/zeb/profile.jpg" If I upload "derek.jpg" it fails. If I set $targetfile to "/profiles/zeb/" it fails. If I leave $targetfile empty it works but uploads the file into the root folder. I've tried setting both folders "profiles" and "zeb" to maximum rights (read+write+exec) and still it fails. I've tried every possible combination of folder names even having $targetfile set to "a.jpg" and it will upload derek.jpg into the root folder as a.jpg but I just cannot get it into that folder located at "/profiles/zeb/" Can anyone see where I'm going wrong? This is the error message I get: [code]Warning: move_uploaded_file(/profiles/zeb/profile.jpg): failed to open stream: No such file or directory in /home/randgigs/public_html/profile.php on line 39 Warning: move_uploaded_file(): Unable to move '/tmp/phpLsVGHr' to '/profiles/zeb/profile.jpg' in /home/randgigs/public_html/profile.php on line 39 [/code]
  18. How would I check for that? All I've done in the past is make sites and I've not really got in too deep with anything else? I noticed at the bottom of phpinfo() it seems I might have it installed as I get this with var_dump(gd_info()): array(11) { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }
  19. gd_info() doesn't give any output so I presume its not installed. I've checked the output of phpinfo() and I've no idea what I'm looking for. How would I install php_gd.dll? All I have is the usual phpMyAdmin and cPanel with the server.
  20. How can I check if this is installed on the server and if not, where can I get it and install it? I need to be able to check whether a file is a valid image file (JPEG/GIF) and to possibly check its dimensions and to maybe even resize it. Come to think of it, I can't remember what the extension is called!
  21. I'm creating a site where users can upload three pics for their profiles. In the past I've made it so they supply a link to an image stored elsewhere and the site links to it. What I'd like to do instead is have it so they store their images on the server instead. Should they be uploaded into the database or uploaded into a folder on the server instead? I have written a script to allow users to upload files in the past but I need to be able to check that the file is in fact a valid image (JPEG or GIF) and not a script. If anyone can post some code on how to do this or even link me to a script that does it I'd be extremely grateful. I'm also interested to know any security precautions I should take when allowing users to upload to the server as I've heard some stories of hackers getting in and erasing all the images - what CHMOD access should the folders be set to? I'm considering having the users upload into their own folders which my scripts would create when they create their accounts. Many thanks.
  22. Yesideez

    Box help?

    You're telling the tables how high the cells are by using height="xx" If the contents of a neighbouring cell gets too much making the cell taller then the specified background color will stay set to height="xx" even though the cell itself has actually got taller. One way around this is to remove height="xx" but instead place loads of line breaks to make the cells taller. Before: [code]      <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">         <tr>           <td width="266" height="153">&nbsp;</td>         </tr>       </table> [/code] After: [code]      <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">         <tr>           <td width="266"><br /><br /><br /><br /><br /><br /><br /><br /></td>         </tr>       </table> [/code]
  23. I managed to fix it... [code]<form ..... style="margin-top: 0px; margin-bottom: 0px;">[/code] I also managed to remove it with ordered and unordered lists (<ul> and <ol>) by using the same idea but also added the left margin to make the gap smaller on the left. I've added this into my CSS include and the site looks exactly the same in FF and is does in IE.
  24. I've noticed that when using forms in IE I get a blank line inserted with the <form... and with </form> but in FF I don't - how would I get around this? I've never had this problem before due to page layout but now I'm using a different design for a new site I'm making and its causing me a complete headache. Any ideas?
  25. Yesideez

    Box help?

    Without posting code its difficult to give an answer, if not impossible.
×
×
  • 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.