Jump to content

shawnplr

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

About shawnplr

  • Birthday 04/13/1971

Contact Methods

  • MSN
    beanshawn@live.com
  • Website URL
    http://www.trimtools.net/

Profile Information

  • Gender
    Male
  • Location
    Illinois U.S.A.

shawnplr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. http://groups.google.com/group/ffmpeg-php/browse_frm/thread/7734efada7b2f355/df3510343804aa02?hl=en&pli=1
  2. I have created a contact form using a flat file to avoid using sendmail. I use fwrite on a flat file which is set to 0622. i am wondering if this is secure code? <?php if (!empty($_POST)) { $file = "contact.txt"; $handle = fopen($file, 'a+'); $ip=$_SERVER['REMOTE_ADDR']; $name = $_POST["name"]; $nameformat = nameize($name); $email = $_POST["email"]; $message = $_POST["message"]; $agree = $_POST["agreement"]; if (empty($name)) { echo "<p><b>“Please supply your name to use this form.”</b></p>"; } elseif (!$email == "" && (!strstr($email,"@") || !strstr($email,".")) || (empty($email))) { echo "<p><b>“Please supply a valid email to use this form.”</b></p>"; } elseif (empty($message)) { echo "<p><b>“Please supply a reason for contacting us.”</b></p>"; } elseif ($agree == "disagree") { echo "<p><b>“All information is confidential. You may agree to terms to submit this form.”</b></p>"; } else { fwrite($handle, "\n" . "\n" . $ip . "\n" . $nameformat . "\n" . $email . "\n" . $message); fclose($handle); echo "<p><b>“Thank you " . $nameformat . ". Your message has been sent.”</b></p>"; }} function nameize($str,$a_char = array("'","-"," ")){ $string = strtolower($str); foreach ($a_char as $temp){ $pos = strpos($string,$temp); if ($pos){ $mend = ''; $a_split = explode($temp,$string); foreach ($a_split as $temp2){ $mend .= ucfirst($temp2).$temp; } $string = substr($mend,0,-1); }} return ucfirst($string); } ?> My form <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <p>Name:* <input type="text" name="name" value="<?php if (isset($name)) {echo $name;} ?>"/></p> <p>email:* <input type="text" name="email" value="<?php if (isset($email)) {echo $email;} ?>" /></p> <p>Reason for contacting us:*<br /><textarea rows="10" cols="40" name="message"><?php if (isset($message)) {echo $message;} ?></textarea></p> <p><input checked="checked" type="radio" value="disagree" name="agreement" />I do not wish to complete all of the fields.</p> <p><input type="radio" value="agree" name="agreement" />All Fields are complete I wish to continue.</p> <hr> <p><input type="submit" value="Submit" /></p> </form> The working code is at http://www.trimtools.net/cont/
  3. This is not php but javascript. Google javascript gray box. Not that I'm a moderator or even a valued member but usually in order to get results from the experts of this forum you have to make an effort with your code, if you get stuck they will help.
  4. I feel a certain obligation to respond to posts on threads I have started. I just wish there was a way of deleting this one. Please no more posts here. I wrote the script because it is what I wanted and it was not available. If you like it it is open source (LGPL) for as long as kwikphp.com allows me to offer it on their server. If not write it down and send it to some one who cares. Over 200 downloads 1 suggestion 1 vote 0 thanks. Signed Last time I will ever post on a forum or offer anything to the internet community for free. :'( P.S. Special thanks to those of you who took the time to read the replies and try the script. I have appreciated the feedback positive and negative alike.
  5. Your ip range is not in the database so it showed you the default city forecast which is set by the webmaster. It most certainly did not ask you to purchase anything. The download site is a free shared host which can not allow file_get, fopen and the like for security reasons. So there is a link to my other site for the working example. I am no rocket scientist but I am not trying to advertise carpentry tools to IT's and programmers.
  6. It is the GeoIp data file that is so large. Using an online whois I think would be too resource intensive.
  7. Sorry all. I either can't get my point across or I shouldn't be asking for any one to down load and test this script since my counter shows 0 downloads. So, I'll just mark it as read and keep wondering what went wrong here.
  8. Not too many people would care about that example, it is from Sun, 18 Feb 2007 12:51 pm. A working example can be seen from the link on the home page. Already tested by this forum. Accuracy is no more than 60% for US. Thats not the point. Was really more interested in the usability and integrity of the down loadable script. Thanks all.
  9. Due to the community here at phpfreaks I got this script working on my site. So I made it available for download http://ipweather.kwikphp.com/download.php . What do you think?
  10. Moderators please bump this meant to put in beta test
  11. I am using a shared free host which does not allow get_file curl or any such thing it says example forecast you can see a working example from the link on the home page. Sorry I should have specified that it is a script to be downloaded and tried.
  12. Due to the testing done by this community I got this script working on my site. Now it it is available for all http://ipweather.kwikphp.com/download.php. May be a noob script kiddie thing but I like it. What do you think?
  13. Site is down Ted. I can't get there either.
×
×
  • 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.