Jump to content

goatboy

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

goatboy's Achievements

Member

Member (2/5)

0

Reputation

  1. sorry, i had a parse error, so it's partly working but the results are looping, it list the results 3 times <? $mydir = dir('./templates/'); //include the trailing slash here while(($file = $mydir->read()) !== false) { $upper = ucwords($file); if(is_dir($mydir->path.$file) == true && $file != '.' && $file != '..') { $data_dir[] = $upper; foreach ($data_dir as $value) { echo "$value <br />\n"; } } } $mydir->close(); ?>
  2. here's what i did but it did'nt work if(is_dir($mydir->path.$file) == true && $file != '.' && $file != '..') { $dir_data[] = $variable; $dir_data = sort($dir_data); foreach($dir_data as $folder){ echo "<option>$folder</option>"; }
  3. I was able to figure out this code to scan a directory and put all of the folders in a select box the problem is i can't get them in alphabetical order, can anyone help with this? <form method="get"> <select onChange="top.location.href=this.options[this.selectedIndex].value"> <option>--Bands--</option> <? $mydir = dir('./path_to_directory/'); //include the trailing slash here while(($file = $mydir->read()) !== false) { $upper = ucwords($file); if(is_dir($mydir->path.$file) == true && $file != '.' && $file != '..') { echo "<option value=\"url_goes_here\">$variable</option>"; } } $mydir->close(); ?> </select> <input type="submit" value="GO" /> </form>
  4. to rename the file $filename = "new file name goes here"; //if magic quotes is off $newfilename = stripslashes($filename); //Move the File to the Directory of your choice //move_uploaded_file('filename','destination') Moves afile to a new location. move_uploaded_file($_FILES['imagefile']['tmp_name'],$upload_dir.$newfilename);
  5. thanks for the replies, I'm going to check out that tutorial and see if I can figure it out. the javascript is an option and i have that on some of my other form validations, but I agree that you also need server side checking for the malicious users, or users who happen to have it blocked, otherwise content will get through that that i'm otherwise trying to prevent. so I guess this is more complicated than I thought
  6. I have an upload script, and it checks for size and extension, but i just noticed that if i don't select a file and press submit, the form won't return an error but process the request and then make an entry into the database. I thought it would return an error when checking for a file extension cause it's not there. So my question is, how do you check that a file has actually been submitted for upload. Would i just check to see if the variable is blank, like if($image_file == ''){ die() I have a feeling the answer to this is relatively easy and I'm going to feel dumb after I realize that.
  7. I had actually checked hotscripts first but didn't find exactly what I was looking for. I didn't find anything exactly titled Advanced Login 2.0 but i found something with a similar name. I think i'm going to have to extract the feature from an existing script.
  8. anyone know of a tutorial or script so i can implement user online status?
  9. it was to insure that it wouldn't happen, but it looks like it's not something i have to worry about. this is what he said "Otherwise people's spam filters may score your message up, and some MTAs may even reject the message entirely because the domain of the sender address doesn't exist"
  10. it was by some random person that used a script i was testing, here's what they said This is sort of like the address at the top of a business letter. There is also an "envelope-sender" address, which shows up in the Return-Path: header of the final message that the recipient receives. This is added by the recipient's mail server and contains the address that the mail server sent during the transaction. That's the address that bounces will go to. This is sort of like the address on the *outside* of the same letter - if you respond to the letter, you'll probably use the address on the letterhead... but the post office would return the letter to the return address on the back of the envelope if the message were undeliverable. Make sense sorta? So the fifth param to mail() is "arguments to sendmail" - you can add "-faddress@example.com" (where address@example.com is a valid address at your domain) to set the envelope-sender address. http://us2.php.net/manual/en/function.mail.php A lot of people try to just add a header like "Return-Path: blahblah@example.com" - it doesn't work that way, though.
  11. I was told i need to have the mailed-by part of the email set correctly to an email address as to prevent messages from being caught by spam filters. I'm having trouble getting this to all work right. I tried using -finfo@mydomain.com and that kinda worked but then the reply to address seemed to get messed up, it would try to reply to the person i sent it to. Any ideas? Let me know if any more info is needed. from "info@mydomain.com" <info@mydomain.com> reply-to info@mydomain.com to testing@gmail.com date 5 Feb 2007 16:25:53 -0500 subject [LV] testing mailed-by server.myservername.com
  12. i feel so dumb, i should have known that. i think i'm brain dead after figuring out how to compare dates thanks
  13. ok hope i don't make this too confusing. lets say i have a table called comments. A user can have multiple entries in the table or none, I want to be able to find the most recent post by a certain user. so lets say they posted comments last month, last week, and yesturday. what code would i use to retreive only the post from yesturday. the table contains the date they posted, the user id and what item they commented on. I need to be able to check when they posted last in comparison to the current date, i have that part of the code down just need to be able to find the last time they posted.
  14. i got it to work with dividing by /100 thanks guys! for some reason the calculator and php give different answers when i did it the original way
  15. are you dividing? i just did it in the windows calulator and on this sales tax calcualtr http://www.convertit.com/Go/ConvertIt/Calculators/Finance/Sales_Tax_Calc.ASP it comes out to 9.93 maybe i'm using a wrong formula but i'm pretty sure that's it
×
×
  • 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.