Jump to content

dozure

Members
  • Posts

    52
  • Joined

  • Last visited

Posts posted by dozure

  1. ugh... I remembered how to do it, but i have the problem that it obviously cant access www.dozure.net/509.html because I've exceeded my bandwidth limits... is there a way around this? I tried putting it outside my public_html folder and referencing it directly with ErrorDocument 509 /home/my_user_name/509.html but that didn't work. Am I missing something here, or can it just not be done? I'm thinking that it won't even look inside my folder on the server to read my .htaccess file because I've exceeded my bandwidth limit... Head Bash

  2. Is it possible to make a custom 509 (bandwidth exceeded) error page? It's not in the list in CPanel, and I SSHed in to my server thinking i would make one in vi, but i can't find where the custom error pages are stored. A little help?

  3. not sure exactly how to do it, but you could have the script, before it stores the file, get a list of all the files in the directory, use a reg exp to cut off all but the end of the newest file name, increment the number by 1 and stick the filename back together, then proceed to store the file.

     

    For Example:

    if you wanted them to be named

    • image001.jpg
    • image002.jpg
    • image003.jpg

    and so on, have the script strip off the image and the .jpg from the filename, increment the number by 1 and then stick the filename back together.

     

    so if image0010.jpg was the newest file in the directory, take image0010.jpg, take off the image and the .jpg so you're left with only 0010 then increment 0010 by 1 so you get 0011, then stick it back together as image0011.jpg, give image0011.jpg as the filename, and proceed to store the file.

     

    I'll sit down later and see if I can bring this theory to life, but no promises. I'm still trying to figure out this regular expression stuff.

  4. I recently came across a problem using mail() for the first time, and thought I would share this with you guys. When you use the mail() function, by default it sends the email as Apache on your server, which is the user Nobody, so the from and reply-to addresses are nobody@serverXX.totalchoicehosting.com After realizing this I asked a tech in chat if there was a way to circumvent this, and as far as they knew there wasnt. And there isnt, at least not on the server side of things. So I hopped over to php.net and looked at the info on the mail() function to see what I could see (as I should have to begin with) and as of v4.3 of PHP, you can pass more than 3 expressions to mail() and they are added on as headers. so... if you add a 4th expression that says "From: e@mail.com" the email will be sent with a from and reply-to address of whatever you put next to From:

     

    ex:

    >mail("recipient@domain.com", "this is a subject", "body of message", "From: me@****");

    will send an email to recipient@domain.com with a subject of this is a subject, a body that says body of mesage, and the from and reply addresses will be me@****

     

     

     

    Hope this is helpful to someone! Kick Me

  5. It started out because I wanted something and I couldn't find a script to do it, so I took the one that was closest and modified it to make it work for my purposes. While doing this, like many others, I realized how easy it was to understand what was going on just by reading the code. Once I decided to get more serious about it, I picked up two books from Barnes & Noble, "SAMS Teach Yourself PHP in 24 Hours" (I love SAMS books), and O'Reilley's "PHP Pocket Reference" which is really not much more than a complete function reference that really will fit in your pocket. Also, www.php.net and www.phpbuilder.com are two sites I frequent when I get stuck and my books fail me for an answer. Another piece of advice I give, is to save each and every PHP script you write, no matter how small or simplistic and give it a logical name. It's a simple way to make your own reference library for when you're in the middle of some complicated script and can't remember how to do the simplest things... lol Also, drink lots of your favorite caffinated beverage(s) (Dr Pepper and Starbucks White Chocolate Mocha for me).

     

    One more thing, for my scripting, I use a program called PHPEdit www.phpedit.net It's a great program, the highlighting features have saved me countless headaches, especially when I have lots of if statements nested in each other and didnt bother to indent... when you put your cursor next to a { it will highlihg the corresponding } for you... helpful when you get those "unexpected" errors on line whatever and you can't find the } you know you missed.

     

    One final piece of advice:

     

    REMEMBER YOUR SEMI-COLONS!!! I always forget those stupid things... especially on the last line of an if

  6. the ASP style PHP start and end tags <% and %> only work if PHP was compiled with the ASP style tags turned on. Apparantly tch didnt turn it on. I always use <?php and ?> because that is always gauranteed to work no matter what server my code gets put on.

  7. I had a similar problem a few weeks ago when I did a full site backup. While it was running it occured to me that it was probably going to put me over the storage limit, so I went in to CPanel to check and sure enough it said I was like 300MB over the limit. So I went to live chat to see if I would be billed if I immediately downloaded and deleted the backup file. Then while I was in chat with the Guru, I looked again and I was 2MB under my limit. When the backup finally finished it was showing me with .1MB free. :) At any rate, it was probably just a fluke. I haven't had any more problems out of it.

  8. You need to enable hotlinking protection it will stop them dead!

     

    http://www.cpanel.net/docs/cp/hotLinkPreventor.htm

    not to contridict you, but he said he tried that and it messed some other things up.

     

    Only thing I can think of to try to stop them is try to track them down as I mentions above, or rename the images, and take the page you have the slide show on and make it open in a new window without the menu bar, and stick a little piece of jscript in there to disable right clicking so they cant see the new filenames. thats not perfect as they can still right click the link to the page and do save as and get the source for the page to get the filenames, but its an idea....

  9. I just tried to do it on my account and it didn't work. You can add the subdomain of the subdomain via CPanel, but it doesnt work. for instance:

     

    I set up doe.dozure.net and it worked fine.

    I then added john.doe.dozure.net and it added it in CPanel, but when I try to access it via a browser, I get 'we couldnt find john.doe.dozure.net

  10. I think this might work, but I'm new to programming with databses... (this is php, if you're using something else i cant help)

     

    ><?PHP
    $check_query = mysql_query("SELECT * FROM `table_name` WHERE `email_field_name` = $email_just_submitted_variable");
    @$check = mysql_result($check_query,0,"email_field_name");
    if $check = $email_they_just_submitted_variable {
    die ('Info already in database');
    }
    else {
    code to insert the info into database
    }
    ?>

     

    Again, I wouldn't use this without having someone look at it, but I think it might work....

  11. you could add a block of code to the submission script that constructs a query to search the database based upon the info they just submitted and if it gives you a match abort the operation and display an error. if it doesnt get a match go ahead and write the info to the database.

     

    something like:

     

    SELECT * FROM `tablename` WHERE `email` = "$email_they_just_submitted"

     

    and if it returns a result

     

    die ('Duplicate record detected')

×
×
  • Create New...