You are here: Re: Simple beginners question about inserting data via an URL « PHP Programming Language « IT news, forums, messages
Re: Simple beginners question about inserting data via an URL

Posted by Jerry Stuckle on 10/11/07 04:23

deja@icepick.com wrote:
> On Oct 10, 7:54 pm, macca <ptmcna...@googlemail.com> wrote:
>> To see if they are coming though the URL to the script okay, which
>> they should be.
>>
>> echo $_GET['var1'] . "<br />" . $_GET['var2'];
>>
>> Try
>>
>> $var1 = mysql_real_escape_string($_GET['var1']);
>> $var2 = mysql_real_escape_string($_GET['var2']);
>>
>> $query = "INSERT INTO log VALUES ('$var1','$var2')";
>> mysql_query($query,$conn) or die(mysql_error());
>
>
> I tried both ideas.. but neither of them return me the string that I
> had in the url :(
>
> What I dont understand is that I can pass 1 string, just not multiple
> strings from the URL.
>
>

(Top posting fixed)

If your URL is really something like:

http://www.example.com?var1=blah&var2=blah

Then $_GET['var1'] will contain the first value, and $_GET['var2'] will
contain the second value. If it doesn't work, either your url is wrong
or you're not accessing the data correctly.

P.S. Please don't top post. And when using examples, use example.com as
the domain - that's what it's reserved for.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация