Jump to content

patentu

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by patentu

  1. i have an html file submits data to a php file which saves inputed data to a .txt but if i write chinese or taiwan characters i get " ϥΪ̥N½X¨Ï¥ÎªÌ¥N½X " instead of " 客訴服務電話 ". The PHP: <?php header("Content-Type: text/plain;charset=ISO-8859-1"); @$pfw_ip= $_SERVER['REMOTE_ADDR']; @$idno = addslashes($_POST['idno']); @$id = addslashes($_POST['id']); @$email = addslashes($_POST['email']); $pfw_file_name = "dates.txt"; $pfw_first_raw = "---------------------------------\r\n"; $pfw_values = "Ip: $pfw_ip Question: $idno; Refrence: $id; Email: $email; --------------------------------------------------\r\n"; $pfw_is_first_row = false; if(!file_exists($pfw_file_name)) { $pfw_is_first_row = true ; } if (!$pfw_handle = fopen($pfw_file_name, 'a+')) { die("Cannot open file ($pfw_file_name)"); exit; } if ($pfw_is_first_row) { if (fwrite($pfw_handle, $pfw_first_raw ) === FALSE) { die("Cannot write to file ($pfw_filename)"); exit; } } if (fwrite($pfw_handle, $pfw_values) === FALSE) { die("Cannot write to file ($pfw_filename)"); exit; } fclose($pfw_handle); header("Location: home.htm"); ?> Thank you!!!!
  2. <? $visitor = $_SERVER['REMOTE_ADDR']; if (preg_match("/192.168.0.1/",$visitor)) { header('Location: http://www.yoursite.com/thank-you.html'); } else { header('Location: http://www.yoursite.com/home-page.html'); }; ?> something like this,but i want it to take the ip from a list
  3. i have that in the php and works,i want a script that will check if that ip already submited that form,if yes redirect to other url without saving anything on the server.
  4. i have an html page with 3 fields "name,email,message" this goes to done.php done.php process the data and saves "name,email,message,ip" to an .txt file on the server,(IIS6 server 2003)how can i redirect to another page if that IP submitted already?Because i have some "friends" who refreshes the page and i get allot of empty fields hope you understand.
  5. http://domeniumeuma.com/a.php
  6. yeah i thought to textarea but doesn't work,it takes only the first link from the textarea. <textarea name="url" rows="20" cols="67"></textarea>
  7. parse email address from links but i don't know php where should i insert that line?and how can i make a bigger input where each line will be an url,because like this i still have only one url
  8. What modification should i bring to this script to make a mass parsing not only for one url,for 200 at once or more.Hope you understand,thank you <?php $the_url = isset($_REQUEST['url']) ? htmlspecialchars($_REQUEST['url']) : ''; ?> <form method="post"> Please enter full URL of the page to parse (including http://):<br /> <input type="text" name="url" size="65" value="<?php echo $the_url; ?>"/><br /> <input type="submit" value="Parse Emails" /> </form> <?php if (isset($_REQUEST['url']) && !empty($_REQUEST['url'])) { // fetch data from specified url $text = file_get_contents($_REQUEST['url']); } elseif (isset($_REQUEST['text']) && !empty($_REQUEST['text'])) { // get text from text area $text = $_REQUEST['text']; } // parse emails if (!empty($text)) { $res = preg_match_all( "/[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}/i", $text, $matches ); if ($res) { foreach(array_unique($matches[0]) as $email) { echo $email . "<br />"; } } else { echo "No emails found."; } } ?>
×
×
  • 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.