Re: Getting parameters from a URL coming from outside the site

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2005-05-20 at 12:51, Mário Gamito wrote:

> Why is this wrong and how to make it right ?

I did this and sent myself a link to it via email, clicked it from
within my email client (Evolution) which launched a browser and called
the script successfully writing the vars to test.txt. Of course this is
not use-able in the real world but it works for testing...

http:/foobar.com/test.php?email=foo@xxxxxxx&code=vu782

<?php

$filename="test.txt";

if(!file_exists($filename)) {
    touch($filename);
}

$content = $_GET['email'] . ":";
$content .= $_GET['code'] . "\n";

$fp = fopen($filename, 'ab');
fwrite($fp, $content);
fclose($fp);

header("Location: http://foobar.com/test.txt";);

?>


-- 

s/:-[(/]/:-)/g


Brian        GnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux