Re: [PHP] Re: Variables via url

2012-05-12 Thread Ashley Sheridan
On Sat, 2012-05-12 at 09:21 -0400, Jim Giner wrote:

 Ashley M. Kirchner ash...@pcraft.com wrote in message 
 news:4fad9d8b.4020...@pcraft.com...
 
  Can someone point me at examples or directions on how I can pass a
  variable via a URL in the following way:
 
  http://server.domain.com//script///variable/
 
  I will only be passing one single /variable/.  And I want the
  /script/ to use that.
 
  I don't want to see what the script is, for example I don't want it
  to say 'script.php' or 'script.html' ...
 
  Is this possible through PHP only, or do I have to write a rewrite
  directive in Apache to accomplish this?
 
 
 A URL has to point to a script - how will your server know what to do with 
 the incoming URL if it doesn't point to something?  That said - format your 
 URL as a GET string and there's your variable.
 
 Ex.:
 
 http://server.domain.com/(scriptname)?variableanothervariableanothervariable
 
 Or - if this url is coming from an already running script, you could post 
 the var to a session var and then send a url without the script name and let 
 your server's default document (index.php ?) receive it and look up the 
 session var, but that's a pretty silly way to handle things just to hide the 
 scriptname.
 
 Of course, someone here with much more knowledge than I could very soon make 
 me look stupid  :) 
 
 
 


I think what you're looking for is URL rewriting. PHP by itself can't do
that, you need to do it at the server level, so an .htaccess file would
be along the right lines.
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Re: Variables via url

2012-05-12 Thread TR Shaw

On May 12, 2012, at 9:47 AM, Ashley Sheridan wrote:

 On Sat, 2012-05-12 at 09:21 -0400, Jim Giner wrote:
 
 Ashley M. Kirchner ash...@pcraft.com wrote in message 
 news:4fad9d8b.4020...@pcraft.com...
 
Can someone point me at examples or directions on how I can pass a
 variable via a URL in the following way:
 
http://server.domain.com//script///variable/
 
I will only be passing one single /variable/.  And I want the
 /script/ to use that.
 
I don't want to see what the script is, for example I don't want it
 to say 'script.php' or 'script.html' ...
 
Is this possible through PHP only, or do I have to write a rewrite
 directive in Apache to accomplish this?
 
 
 A URL has to point to a script - how will your server know what to do with 
 the incoming URL if it doesn't point to something?  That said - format your 
 URL as a GET string and there's your variable.
 
 Ex.:
 
 http://server.domain.com/(scriptname)?variableanothervariableanothervariable
 
 Or - if this url is coming from an already running script, you could post 
 the var to a session var and then send a url without the script name and let 
 your server's default document (index.php ?) receive it and look up the 
 session var, but that's a pretty silly way to handle things just to hide the 
 scriptname.
 
 Of course, someone here with much more knowledge than I could very soon make 
 me look stupid  :) 
 
 
 
 
 
 I think what you're looking for is URL rewriting. PHP by itself can't do
 that, you need to do it at the server level, so an .htaccess file would
 be along the right lines.

Ash is right; however you can leverage off of the index page  So your script 
would be in index.php and the url would be:

http://server.domain.com/some_optional_directory_path/?variable

Tom




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



Re: [PHP] Re: Variables via url

2012-05-12 Thread Ashley M. Kirchner

On 5/12/2012 7:21 AM, Jim Giner wrote:
Of course, someone here with much more knowledge than I could very 
soon make me look stupid :) 


Meh, I don't call that looking stupid.  I call it a different way 
of skinning the cat. :)  We're all here to learn from one another, right?


Thanks for the suggestion.

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



Re: [PHP] Re: Variables in Variables?

2005-11-18 Thread Jasper Bryant-Greene

Ben wrote:
If I understand your question properly I'd explode $two_vars with 
whatever seperator you have between them and then you'll need to use 
eval to get your results.  Maybe something like...


$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key = $value) {
$eval=\$temp=.$value.;;
eval($eval);
echo $temp;
}


WTF do you need eval() for?!

$dbVars = explode( ',', $two_vars );
foreach( $dbVars as $value ) {
echo $value;
}

... does exactly the same thing.

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



Re: [PHP] Re: Variables in Variables?

2005-11-18 Thread Jasper Bryant-Greene

Jasper Bryant-Greene wrote:

Ben wrote:


$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key = $value) {
$eval=\$temp=.$value.;;
eval($eval);
echo $temp;
}


WTF do you need eval() for?!

$dbVars = explode( ',', $two_vars );
foreach( $dbVars as $value ) {
echo $value;
}


Ah, sorry, I see what I missed now... Still, I'm sure there's a way to 
do this without resorting to eval()...


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



RE: [PHP] Re: Variables not working!

2004-01-19 Thread Jay Blanchard
[snip]
Try using $_POST['fname'] instead of $fname.  
[/snip]

Or $_GET['fname'] depending on your form method

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



Re: [PHP] Re: Variables not working!

2004-01-19 Thread Chris Boget
 [snip]
 Try using $_POST['fname'] instead of $fname.  
 [/snip]
 Or $_GET['fname'] depending on your form method

Or even $_REQUEST['fname'], which doesn't care about which
method is specified in the form. :p

Chris

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



Re: [PHP] re: variables with

2003-03-17 Thread Charles Kline
php has a function stripslashes() you could try using.

- charles

On Monday, March 17, 2003, at 10:11 AM, Ian A. Gray wrote:

Using the \ or using single quotes instead of double
is great.  However I am now finding a problem if
someone inputs either single or double quotes on a
form which uses php.
The user inputs for example:
I\ve performed many roles including Figaro,
Dandini and 'Wotan'
becomes:
I\'ve performed many roles including \Figaro\,
\Dandini\ and \'Wotan\'
Is there a simple way of getting rid of the annoying
backslash(\) from a the contents of a variable?
Many thanks,

Ian Gray

=

-
Ian A. Gray
Manchester, UK
Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: 
+44 (0) 7900 996 328
US Fax no.:  707-885-3582
E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com 
(performance)  www.vocalstudio.co.uk (Tuition)
-

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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


RE: [PHP] re: variables with

2003-03-17 Thread Ford, Mike [LSS]
 -Original Message-
 From: Ian A. Gray [mailto:[EMAIL PROTECTED]
 Sent: 17 March 2003 15:11
 
 
 Using the \ or using single quotes instead of double
 is great.  However I am now finding a problem if
 someone inputs either single or double quotes on a
 form which uses php.
 
 The user inputs for example:
 I\ve performed many roles including Figaro,
 Dandini and 'Wotan'  
 
 becomes:
 I\'ve performed many roles including \Figaro\,
 \Dandini\ and \'Wotan\'
 
 Is there a simple way of getting rid of the annoying
 backslash(\) from a the contents of a variable?

http://uk2.php.net/stripslashes

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



Re: [PHP] Re: Variables not being received from form

2003-02-23 Thread Leif K-Brooks
Please, please, PLEASE don't correct code that isn't wrong with code 
that is!  Read http://www.php.net/manual/en/language.types.array.php. 
To answer the original question, the $HTTP_POST_VARS variable is out of 
scope in your function.  Either use $_POST superglobal array if you're 
using 4.1.0 or higher, or use $GLOBALS['HTTP_POST_VARS']['formvarhere']

pei_world wrote:

cann't see any thing without your form! I think it is misstyping error,
check your form variables name,
specially upper case or lower case!
but try
$rank = $HTTP_POST_VARS[rank];
$title_new = $HTTP_POST_VARS[titles];
--
Sincerely your;
pei_world ( .::IT::. )



Peter Gumbrell [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Thanks to those who have helped me with my two other questions this
afternoon.
In the function below, the update query at the end is inserting empty
   

values
 

into the database. For some reason the lines:

re not picking up the form values.

Here is the complete function. I do not have a form action set so that I
   

can
 

read the SQL message. The update query is working.

function retrieve_select_listing($link, $workshop, $session, $username)
{
$query_retrieve = SELECT choice_ID, rank, workshop_id FROM choices_peter
WHERE workshop_ID = '$workshop' AND username ='$username';
$result1 = mysql_query($query_retrieve, $link) or die(display_db_query:
   

.
 

mysql_error());
$row1 = mysql_fetch_array($result1);
$choice_id = $row1[0];
$query_title = SELECT title, CONCAT(sessionlet, sesnumber) AS SessionID
FROM ECOO2003 WHERE sessionlet = '$session';
$result2 = mysql_query($query_title, $link) or die(display_db_query: .
mysql_error());
while ($columns = mysql_fetch_array($result2))
{
$column = $columns['title'];
$sessionid = $columns['SessionID'];
$selected = ;
if ($sessionid == $row1['workshop_id'])
{
$selected = SELECTED;
}
$title_block .= OPTION name='title' value=\$sessionid\
$selected$column/OPTION\n;
}
print trtd colspan=\4\;
$selected_session = $HTTP_POST_VARS['titles'];
print form method=\POST\ name=\update_workshop\ action=\\\n;
print Change the rank of this workshop, or select another workshop from
this session and click the update button.brbr/td/tr;
print trtd colspan=\4\table border=\1\ width=\80%\;
print trthworkshop/ththRank/ththWorkshop Title/th/tr;
print trtd$row1[2]/tdtdinput type = \text\ name =\rank\
value=$row1[1]/tdtdSELECT
NAME=\titles\$title_block/SELECT/td/tr\n;
print trtd colspan =\3\;
print input type=\hidden\ name=\update_select\ value=\v\;
print brAfter you have made your changes, click the Update button to
confirm these.br/td/trtrtd;
print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td;
print td/tdtd/td/tr;
print /table;
print /form;
if ($_POST['Submit']=='Update')
{
print updated!!;
$rank = $HTTP_POST_VARS['rank'];
$title_new = $HTTP_POST_VARS['titles'];
print rank =$rankbr;
print title# = $title_newbr;
$query_update = UPDATE choices_peter SET rank = '$rank', workshop_id =
'$title_new' WHERE choice_ID = '$choice_id';
$update = mysql_query($query_update, $link) or die(display_db_query: .
mysql_error());
}
}
Many thanks

Peter

   



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



Re: [PHP] Re: Variables

2002-11-05 Thread Martín Marqués
On Dom 03 Nov 2002 06:40, David Jackson wrote:
 Bryan McLemore wrote:
  What is a variables value before said value has been assigned a value?
 
  Thanks
  Bryan

 Wouldn't it be null or empty  ?

NULL



-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-


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




Re: [PHP] Re: Variables aren't being passed to php page

2002-07-14 Thread Jason Wong

On Monday 15 July 2002 03:55, Tim Luoma wrote:
 Jason Wong wrote:
  This list gets at least one question a day on this subject ...

 And there will be a lot more as people scan the web for example scripts
 and find ones that assume 'register_globals' is set to on.

Questions coming from those sources are partly understandable. 

What I was referring to was the particular case of I've got an application 
that was working perfectly using php X.XX, then I upgraded to php Y.YY and 
now it doesn't work anymore.

It is those people who should look before they leap and read before they 
upgrade.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
If all the world's a stage, I want to operate the trap door.
-- Paul Beatty
*/


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




Re: [PHP] Re: variables

2002-05-22 Thread Eugene Lee

Also, it's good to read the press releases:

http://www.php.net/release_4_2_1.php

External variables

We would also like to attend you on a big change in PHP
4.2.0 concerning variable handling. External variables
(from the environment, the HTTP request, cookies or the
web server) are no longer registered in the global scope
by default. The preferred method of accessing these
external variables is by using the new Superglobal
arrays, introduced in PHP 4.1.0.

http://www.php.net/release_4_1_0.php

On Wed, May 22, 2002 at 11:52:02AM +0200, Michael Virnstein wrote:
: 
: you can use
: 
: $_POST['name1'] if you're using post vars
: $_GET['name1'] if you're using get vars
: 
: Roman Duriancik [EMAIL PROTECTED] schrieb:
:  
:  When are set in php.ini (php version 4.2.1 on linux) register_globals = Off
:  how I read variables from  html files with forms in other php file ?


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] Re: Variables within a string

2002-03-14 Thread Jason Wong

On Thursday 14 March 2002 14:14, Analysis  Solutions wrote:

[snip]

 The examples on that page are lame.  For example:

if($HTTP_COOKIE_VARS['username']){
   // can only come from a cookie, forged or otherwise
   $good_login = 1;
   fpassthru (/highly/sensitive/data/index.html);
}

[snip]

Admittedly the example given in the manual wasn't very good or clear. Let's 
change the example slightly.

  if($HTTP_COOKIE_VARS['username']) {
// can only come from a cookie, forged or otherwise
$good_login = 1;
  }

// later on ...
  
  if ($good_login) { 
fpassthru (/highly/sensitive/data/index.html); }
  else {
echo(Hello, you're not logged in!);
  }

Now if register_globals was ON then it's a simple matter of passing a value 
in the URL to gain access to the sensitive data without actually having to 
log in:

  http://www.domain.com/display_secret_data.php?good_login=1

If register_globals is OFF then the above ploy would not work because 
good_login would not automatically make it into the variable namespace.

Enabling register_globals is nice and convenient but it's very easy to shoot 
yourself in the foot if you don't track where your variables are coming from, 
or you don't initialise your variables properly.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Carmel, New York, has an ordinance forbidding men to wear coats and
trousers that don't match.
*/

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




Re: [PHP] Re: Variables within a string

2002-03-13 Thread Analysis Solutions

On Tue, Mar 12, 2002 at 05:42:12PM +0800, Jason Wong wrote:
 On Tuesday 12 March 2002 12:27, Analysis  Solutions wrote:
 
 The source of the data *does* matter. That is why the latest releases of
 PHP ( 4.0.6) recommends having register_globals OFF by default.
 ... snip snip snip ...
 To see why the source of data matters, see the chapter Security::Using 
 Register Globals

The examples on that page are lame.  For example:

   if($HTTP_COOKIE_VARS['username']){
  // can only come from a cookie, forged or otherwise
  $good_login = 1;
  fpassthru (/highly/sensitive/data/index.html);
   }

Naturally, just because someone submits a user name doesn't make their
submission valid.  I know, they're just using that as an example.  But,
in the real world, you need to first make sure the username submitted
fits within your expected parameters of length and character types.  
Plus, if you're about to put that user name into a query, doesn't
contain any characters which will trick the query.  Then, you need to
check that the user name is valid.  Then, and only then, would you
permit the user to get the sensitive data.  Regardless of where the data
comes from, all of those steps need to be taken.  Thus, it doesn't
matter where the data came from.


 But if you don't know where the data came from then it's not secure. Consider 
 a real-life example. Robin Hood steals the Sheriff's ATM card, and the 
 Sheriff stupidly enough has written the PIN onto the back of the card. Now 
 Robin can go and withdraw all the money from the Sheriff's account because 
 the ATM has no way of knowing that the card was stolen (it doesn't know where 
 the source of the data came from), all it knows is that the data is valid 
 (right card, right PIN).

Hmm.  You're correct.  At the same time, the point I'm trying to make is
not about the person transmitting the data, but rather, the means
they're doing so.  My issue is the thief would also be able to use that
pin to (hypothetically, of course) access the Sheriff's account via
debit card purchases in stores, the bank's website and bank-by-phone
services.

Regardless of the means used to transmit the PIN, the bank still needs 
to ensure the data is clean before they perform the check to see if the 
PIN is the right PIN for that account.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




Re: [PHP] Re: Variables within a string

2002-03-12 Thread Jason Wong

On Tuesday 12 March 2002 12:27, Analysis  Solutions wrote:

  For security reasons. To make sure the variable did come from POSTing a
  form and not from the URL.

 Neither is more or less secure.  The source of the data doesn't matter.

The source of the data *does* matter. That is why the latest releases of PHP 
( 4.0.6) recommends having register_globals OFF by default.

That is also why instead of the cumbersome $HTTP_POST_VARS[] (etc) it's been 
changed to a much shorter $_POST[]. And to further encourage you to use the 
new form, $_POST[], $GET[] etc have been made super global so they can be 
used directly inside functions without having to declare them as global.

To see why the source of data matters, see the chapter Security::Using 
Register Globals

 Regardless of where the info is from, validating user input is the only
 way to ensure security.

But if you don't know where the data came from then it's not secure. Consider 
a real-life example. Robin Hood steals the Sheriff's ATM card, and the 
Sheriff stupidly enough has written the PIN onto the back of the card. Now 
Robin can go and withdraw all the money from the Sheriff's account because 
the ATM has no way of knowing that the card was stolen (it doesn't know where 
the source of the data came from), all it knows is that the data is valid 
(right card, right PIN).


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Let not the sands of time get in your lunch.
*/

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




Re: [PHP] Re: Variables within a string

2002-03-12 Thread Faisal Abdullah

I love your example..

 But if you don't know where the data came from then it's not secure.
 Consider a real-life example. Robin Hood steals the Sheriff's ATM card,
 and the Sheriff stupidly enough has written the PIN onto the back of the
 card. Now Robin can go and withdraw all the money from the Sheriff's
 account because the ATM has no way of knowing that the card was stolen (it
 doesn't know where the source of the data came from), all it knows is that
 the data is valid (right card, right PIN).

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




Re: [PHP] Re: Variables within a string

2002-03-12 Thread Erik Price


On Monday, March 11, 2002, at 10:34  PM, Jason Wong wrote:

 On Monday 11 March 2002 11:10, Chris Cocuzzo wrote:
 $foo = Entry for  . $HTTP_POST_VARS[name];

 $foo = Entry for for $HTTP_POST_VARS[name];

 But that's not good programming.  Associative arrays should have the 
 key
 quoted in order to avoid confusion with contants.  See
 http://www.php.net/manual/en/language.types.array.php#language.types.array.
 donts

 Inside of double-quoted strings there is no need to single-quote the 
 array
 key (in fact it can't be done, gives syntax error). The section of the 
 manual
 you quoted states this :)

I thought that it could be done like so:

$foo = Entry for {$HTTP_POST_VARS['name']};





Sorry for butting in,

Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Re: Variables within a string

2002-03-11 Thread Jason Wong

On Tuesday 12 March 2002 11:11, Analysis  Solutions wrote:
 On Mon, Mar 11, 2002 at 08:39:16PM -0500, webapprentice wrote:
  From: Jason Wong [EMAIL PROTECTED]
 
  On Monday 11 March 2002 11:10, Chris Cocuzzo wrote:
   $foo = Entry for  . $HTTP_POST_VARS[name];
 
  $foo = Entry for for $HTTP_POST_VARS[name];

 But that's not good programming.  Associative arrays should have the key
 quoted in order to avoid confusion with contants.  See
 http://www.php.net/manual/en/language.types.array.php#language.types.array.
donts

Inside of double-quoted strings there is no need to single-quote the array 
key (in fact it can't be done, gives syntax error). The section of the manual 
you quoted states this :)

[snip]

 Now, I wonder why you're even assigning this information to yet another
 varialbe.  Why not just use the information straight up?:
echo Entry for for $name;

 Of course, there are legitimate reasons for your approach, but often new
 programmers needlessly assign stuff to varialbes.  Just making sure.

For security reasons. To make sure the variable did come from POSTing a form 
and not from the URL.

 Finally, if you really want to use $HTTP_POST_VARS[]  AND  your'e
 running PHP 4.1*, consider using the superglobal $_POST[] instead.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Nobody knows what goes between his cold toes and his warm ears.
-- Roy Harper
*/

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




Re: [PHP] Re: Variables within a string

2002-03-11 Thread Analysis Solutions

On Tue, Mar 12, 2002 at 11:34:14AM +0800, Jason Wong wrote:
 On Tuesday 12 March 2002 11:11, Analysis  Solutions wrote:
  On Mon, Mar 11, 2002 at 08:39:16PM -0500, webapprentice wrote:
   From: Jason Wong [EMAIL PROTECTED]
  
   On Monday 11 March 2002 11:10, Chris Cocuzzo wrote:
$foo = Entry for  . $HTTP_POST_VARS[name];
  
   $foo = Entry for for $HTTP_POST_VARS[name];
 
  But that's not good programming.  Associative arrays should have the key
  quoted in order to avoid confusion with contants.
 
 Inside of double-quoted strings there is no need to single-quote the array 
 key (in fact it can't be done, gives syntax error). The section of the manual 
 you quoted states this :)

Yes.  Quoting the array key inside a string is not correct.  Never said
it was.  Now that I think about it, though, if you use the associative
array inside a string, there's no way the string key can be confused
with a constant, so the main point of my initial post is mute.  So, 
you're right that the following is kosher:

   $foo = Entry for for $HTTP_POST_VARS[name];


 For security reasons. To make sure the variable did come from POSTing a form 
 and not from the URL.

Neither is more or less secure.  The source of the data doesn't matter.  
Regardless of where the info is from, validating user input is the only
way to ensure security.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




RE: [PHP] Re: variables

2001-09-11 Thread webgenie

Thanks for the fast answer1

Yes I thought of that, but I also got the problem using the $vars in frames:

I'm using a authenticationform for users to get to a frameset. Now I'm
transfering the usernames/pwds in the uri-string to all the framepages. In
all framepages I check for $PHP_AUTH_USER to be set and when so I query the
db again and.
It seems that the vars aren't global. How can I globalize the vars so they
are usable in other files. Are sessions teh only option?

Thanks in advance,
Bart

-Oorspronkelijk bericht-
Van: _lallous [mailto:[EMAIL PROTECTED]]
Verzonden: dinsdag 11 september 2001 12:23
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Re: variables


Sure you can!

consider this simple example:
html
body
a href=javascript:setvars('var1value', 'var2value')click here to go to
next page/a

script language=JavaScript
!--
  function setvars(var1, var2)
  {
df = document.dataform;
df.var1.value = var1;
df.var2.value = var2;
df.submit();
  }
//--
/script
form name=dataform action=page2.php method=post
input type='hidden' name='var1'
input type='hidden' name='var2'
/form
/body
/html

it's using hidden forms...
you can also use sessions...

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 Is it possible to transfer certain variables to a new scripts, but not
doing
 this as uri-parameters (../bla.php?var1=varvar2=var#)

 I need it for Usernames and passwords and when the pages get cached the
 usernames and pwd's can be viewed in the Temp-inetfiles-folder in
Windhoze.

 Thanks,

 Bart




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: variables

2001-09-11 Thread _lallous

In that case you'll have to use session_variables or cookies.
mostly session_variables are better especially for authentication and
login/logout systems...

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks for the fast answer1

 Yes I thought of that, but I also got the problem using the $vars in
frames:

 I'm using a authenticationform for users to get to a frameset. Now I'm
 transfering the usernames/pwds in the uri-string to all the framepages. In
 all framepages I check for $PHP_AUTH_USER to be set and when so I query
the
 db again and.
 It seems that the vars aren't global. How can I globalize the vars so they
 are usable in other files. Are sessions teh only option?

 Thanks in advance,
 Bart

 -Oorspronkelijk bericht-
 Van: _lallous [mailto:[EMAIL PROTECTED]]
 Verzonden: dinsdag 11 september 2001 12:23
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Re: variables


 Sure you can!

 consider this simple example:
 html
 body
 a href=javascript:setvars('var1value', 'var2value')click here to go to
 next page/a

 script language=JavaScript
 !--
   function setvars(var1, var2)
   {
 df = document.dataform;
 df.var1.value = var1;
 df.var2.value = var2;
 df.submit();
   }
 //--
 /script
 form name=dataform action=page2.php method=post
 input type='hidden' name='var1'
 input type='hidden' name='var2'
 /form
 /body
 /html

 it's using hidden forms...
 you can also use sessions...

 [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  Is it possible to transfer certain variables to a new scripts, but not
 doing
  this as uri-parameters (../bla.php?var1=varvar2=var#)
 
  I need it for Usernames and passwords and when the pages get cached the
  usernames and pwd's can be viewed in the Temp-inetfiles-folder in
 Windhoze.
 
  Thanks,
 
  Bart
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: variables

2001-09-11 Thread webgenie

Thanks,

I'll implement sessions... :)

regards

Bart

-Oorspronkelijk bericht-
Van: _lallous [mailto:[EMAIL PROTECTED]]
Verzonden: dinsdag 11 september 2001 13:30
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] Re: variables


In that case you'll have to use session_variables or cookies.
mostly session_variables are better especially for authentication and
login/logout systems...

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks for the fast answer1

 Yes I thought of that, but I also got the problem using the $vars in
frames:

 I'm using a authenticationform for users to get to a frameset. Now I'm
 transfering the usernames/pwds in the uri-string to all the framepages. In
 all framepages I check for $PHP_AUTH_USER to be set and when so I query
the
 db again and.
 It seems that the vars aren't global. How can I globalize the vars so they
 are usable in other files. Are sessions teh only option?

 Thanks in advance,
 Bart

 -Oorspronkelijk bericht-
 Van: _lallous [mailto:[EMAIL PROTECTED]]
 Verzonden: dinsdag 11 september 2001 12:23
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Re: variables


 Sure you can!

 consider this simple example:
 html
 body
 a href=javascript:setvars('var1value', 'var2value')click here to go to
 next page/a

 script language=JavaScript
 !--
   function setvars(var1, var2)
   {
 df = document.dataform;
 df.var1.value = var1;
 df.var2.value = var2;
 df.submit();
   }
 //--
 /script
 form name=dataform action=page2.php method=post
 input type='hidden' name='var1'
 input type='hidden' name='var2'
 /form
 /body
 /html

 it's using hidden forms...
 you can also use sessions...

 [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  Is it possible to transfer certain variables to a new scripts, but not
 doing
  this as uri-parameters (../bla.php?var1=varvar2=var#)
 
  I need it for Usernames and passwords and when the pages get cached the
  usernames and pwd's can be viewed in the Temp-inetfiles-folder in
 Windhoze.
 
  Thanks,
 
  Bart
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]