php-windows Digest 16 Jun 2003 20:27:38 -0000 Issue 1779 Topics (messages 20335 through 20359):
Sessions via shared memory 20335 by: M.Staiger Re: TIP - Creating 'neat' Word documents with PHP 20336 by: sven question about mail function 20337 by: tarn.hk 20340 by: sven Re: more on HTTP post variables 20338 by: Svensson, B.A.T. (HKG) Re: Problem in windows 20339 by: sven Re: problems with variables 20341 by: Felipe Lorente 20342 by: sven Re: Help please: undefined index in sample code 20343 by: toby z 20344 by: Herhuth, Ron 20346 by: Stephen 20347 by: Luis Moreira 20348 by: toby z 20349 by: toby z Re: Subject: Re: User Authentication... 20345 by: Neil Smith Undefined variables 20350 by: Jorge L. 20353 by: DvDmanDT 20355 by: Per Lundberg 20356 by: Harpreet Re: Using the installshield vs manually 20351 by: Phil Driscoll 20352 by: Daniel Crompton 20354 by: Phil Driscoll Back button error 20357 by: Harpreet 20358 by: Stephen Re: absolute include files 20359 by: dj dust Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
--- Begin Message ---Hello NG, sessions are usually stored in files on disk or directly in a database. However when not only reading these sessions but also writing to them extensively, it might be unseful to store these sessions directly in memory. Rumors say, this is possible via "shared memory functions" which sounds interesting to me. But HOW does it work ? Marc
--- End Message ---
--- Begin Message ---nice workaround ;-) but how about this: save your rtf-file and use it as a "template" with unique "place-holders" (e.g. your rtf-part %yourUniqueDateField% next rtf-part). use preg-replace() and replace your "place-holders" with your content. save your copy or mail it. ciao SVEN "George Pitcher" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hi all, > > I had a requirement to produce neat Word documents to send as email > attachments. I looked at the COM method but couldn't get it to work (didn't > really try that hard though). Anyhow, I tried another method which procuces > exactly what I need. > > Firstly, create the document shell in Word (this will possibly work in other > formats but not tested here), leaving a space for any 'variable' content. > Save the document as an RTF file (Rich Text Format). > > Open the RTF file in Notepad (or similar) and find the first part of your > file (beginning of file to where the first variable goes in) and save that > as a text file (filename1.txt), Then find the part between the first and > second variables and save as 'filename2.txt' repeating until you have the > whole rtf file saved as a collection of txt files. > > Store them on your server. > > In your php script do the following: > > $name="Stephen"; // my example > $fp = "c:\\inetpub\\wwwroot\\mydir\\"; > $fn1 = file_get_contents("letter1.txt"); > $fn2 = file_get_contents("letter2.txt"); > $fn3 = file_get_contents("letter3.txt"); > > $filename = "letter.doc"; > $content = $fn1; > $content.= date("d, M Y"); > $content.= $fn2; > $content.= $name; > $content.= $fn3; > if (!$fp = fopen($filename, 'w')) { > print "Cannot open file ($filename)"; > exit; > } > if (!fwrite($fp, $content)) { > print "Cannot write to file ($filename)"; > exit; > } > fclose($fp); > > I use phpmailer and I've tested the attachment part and it works fine. > > It might not suit every requirement but its a quick way to get letters > formatted in word. > > Hope this helps someone. > > George in Oxford >
--- End Message ---
--- Begin Message ---
hi everybody,i'am have problem about php send mail function, how can i send extra header with it's. I'am crazy now because I can send it by using users defined variable , but when I've send it with a html form, it's don't work at all by use $_POST variableplease help me,thanks you,.....
--- End Message ---
--- Begin Message ---i don't really understand your question. for the extended headers in mail use something like this: $to = "[EMAIL PROTECTED]"; $subject = "some subject"; $header = "content-type: text/html; charset=\"iso-8859-1\"\n". "from: \"[EMAIL PROTECTED]"\n"; $message = "some message"; if (mail($to, $subject, $message, $header)) { echo "message sent"; } else { echo "error, not sent"; } but if you have problems with $_POST, maybe some code (your form and your script) could help. ciao SVEN "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] hi everybody, i'am have problem about php send mail function, how can i send extra header with it's. I'am crazy now because I can send it by using users defined variable , but when I've send it with a html form, it's don't work at all by use $_POST variable please help me, thanks you, .....
--- End Message ---
--- Begin Message ---> Thanks for the hidden input thingy. another question, when we use this kind of > format in an URL: > > ...../something.php?name=me&address=far > > does it mean I'm using global variables (name and address?) is this a good thing or > should I do it some other way? > if I'm not mistaken, to use this kind of format I need to switch 'register_globals' > to on, in the php.ini? and they say > to switch this on is not really a good thing bcoz of security problem. so how do I > get around this? > > sorry if my question is too basic. or maybe someone can suggest me a good readings > for these kind of simple questions? The question mark ("?") after the ULR indicates a GET of variables. In HTTP (Hyper Text Transfer Protocol) these variables can be extracted from HTTP package, and used by the server (HTML is wrapped in an HTTP package). It is then server (read: implementation) dependent what happens with these variables, however the page which is referred should always be able to access these variables by means of the scripting language used. You can read more about FORM's and POST in the HTML specifications found at http://www.w3.org/TR/REC-html40/interact/forms.html For instance, by following the links a bit you will end up with this information: " If the method is "get" and the action is an HTTP URI, the user agent takes the value of action, appends a `?' to it, then appends the form data set, encoded using the "application/x-www-form-urlencoded" content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes. If the method is "post" and the action is an HTTP URI, the user agent conducts an HTTP "post" transaction using the value of the action attribute and a message created according to the content type specified by the enctype attribute. " in general you will find any thing you need at www.w3.org, and in particular you will find all information about specifications of HTML (version 4.01) you ever will need at: http://www.w3.org/TR/REC-html40/ It might be tricky initially to understand the way they write these documentation, but it's well worth spending time in learning to read it, because you will never be able to find any more reliable first hand information than provided by www.w3.org. //Anders
--- End Message ---
--- Begin Message ---it seems in your php.ini you activated error_reporting = E_ALL. so also notices like yours are reported. either disable this in php.ini like that: error_reporting = E_ALL & ~E_NOTICE or correct your script as the notices say: - seems you used $array[s_UID] instead of correct $array['s_UID'] - and you used a var $s_UserInfo that you didn't define before, add $s_UserInfo = 0 or $s_UserInfo = "" or similar. ciao SVEN "James Stanley" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hello, > > I just installed php/mysql on my windows machine, now when I try to run > a script I get this: > > Use of undefined constant s_UID - assumed 's_UID' in > c:\inetpub\wwwroot\php_test\inc\session.php > > And then some Undefined variable: s_UserInfo. > > Any thought why could this be? Thanks. > > James. >
--- End Message ---
--- Begin Message ---Thanks, but where should I use $HTTP_XXXX_VARS['varname'] Arrays?? Thanks again. Felipe. "Malte" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > you probably got register globals turned off in your php.ini file. Turn it > on or use the > $HTTP_XXXX_VARS['varname'] Arrays > > XXXX can be POST, GET, SESSION and so on > > malte > > ----- Original Message ----- > From: "Felipe Lorente" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, June 15, 2003 7:57 PM > Subject: [PHP-WIN] problems with variables > > > > Hello all, > > > > I just have installed php 4.3.2, and it runs fine with single files. The > > problem comes when I try to pass a variable from another file, it doesn`t > > recognise this variable. I am using IIS 5.1 with Win XP and I have used > the > > windows instaler to install the sources on my machine. Does anyone know > what > > can happen?? Thanks. > > > > Felipe. > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >
--- End Message ---
--- Begin Message ---your vars you want to send to your next page are stored in these arrays. so if you POSTed a form with $name and $email use $_POST['name'] or $HTTP_POST_VARS['email'] in your script instead of the awaited $name and $email. ciao SVEN "Felipe Lorente" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > > Thanks, but where should I use $HTTP_XXXX_VARS['varname'] Arrays?? > > Thanks again. > > Felipe. > > "Malte" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > > you probably got register globals turned off in your php.ini file. Turn it > > on or use the > > $HTTP_XXXX_VARS['varname'] Arrays > > > > XXXX can be POST, GET, SESSION and so on > > > > malte > > > > ----- Original Message ----- > > From: "Felipe Lorente" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Sunday, June 15, 2003 7:57 PM > > Subject: [PHP-WIN] problems with variables > > > > > > > Hello all, > > > > > > I just have installed php 4.3.2, and it runs fine with single files. > The > > > problem comes when I try to pass a variable from another file, it > doesn`t > > > recognise this variable. I am using IIS 5.1 with Win XP and I have used > > the > > > windows instaler to install the sources on my machine. Does anyone know > > what > > > can happen?? Thanks. > > > > > > Felipe. > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >
--- End Message ---
--- Begin Message ---my dear man if u try >> $tireqty = $_POST['tireqty']; with register globals on it gives u the same error :) i didn ask that without any reazon toby --- Stephen <[EMAIL PROTECTED]> wrote: > Which just goes to show some people will say anything... > > I don't think this has anything to do with register globals (Sorry > toby). > Undefined index sounds like php is just warning you that you are > using a > variable without a value. Since you are using a form to send data, > this can > occur. To be honest, its a fairly pointless warning, so you > probably want to > ignore it. In your php.ini file search for and find the > error_reporting > option. I recommend you change your settings to > error_reporting = E_ALL & ~E_NOTICE > This should solve your problem. > > ----- Original Message ----- > From: "Stuart Felenstein" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, June 14, 2003 10:18 AM > Subject: Re: [PHP-WIN] Help please: undefined index in sample code > > > > Yes, register globals are now on. Though it doesn't apparently > matter. > > > > Stuart > > > > toby z <[EMAIL PROTECTED]> wrote: > > register globals on or off ????? > > > > --- Stuart Felenstein wrote: > I can't believe > > Chapter 1 , section 1 and I'm off to a bad start > > > already. > > > Using this form and script, I keep getting "undefined index" > for > > > the variables I declare in the script. Running PHP 4.3.2 on XP > > > Pro. Thanks. > > > Stuart > > > > > > Form: > > > > > > > > > > > > > > > Item > > > Quantity > > > > > > > > > Tires > > > [input] > maxlength="3"> > > > > > > > > > Oil > > > [input] > maxlength="3"> > > > > > > > > > Spark Plugs > > > [input] > maxlength="3"> > > > > > > > > > [input] > Order"> > > > > > > > > > > > > > > > Script: > > > > > > > > > > > > > > > > > > > > > Bob's Auto Parts > > > Order Results > > > > //create short variable names > > > $tireqty = $_POST['tireqty']; > > > $oilqty = $_POST['oilqty']; > > > $sparkqty = $_POST['sparkqty']; > > > ?> > > > > echo ' > > Your order is as follows: > > '; > > > echo $tireqty.' tires > > '; > > > echo $oilqty.' bottles of oil > > '; > > > echo $sparkqty.' spark plugs > > '; > > > ?> > > > > > > > > > > > > > > ________________________________________________________________________ > > Want to chat instantly with your online friends? Get the FREE > Yahoo! > > Messenger http://uk.messenger.yahoo.com/ > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message ---Undefined index is an error generated due to something trying to access a value in an array that doesn't exist. That array can be the form elements array. You should check all values with the " !isset " function to see if they exist before trying to access them in case the user did not enter a value that you are expecting to be there. Ron >From: toby z >To: Stephen >Sent: 06/16/2003 5:43 AM >my dear man >if u try > >>> $tireqty = $_POST['tireqty']; > >with register globals on > >it gives u the same error :) > >i didn ask that without any reazon > >toby > >--- Stephen <[EMAIL PROTECTED]> wrote: > Which just >goes to show some people will say anything... >> >> I don't think this has anything to do with register globals (Sorry >> toby). >> Undefined index sounds like php is just warning you that you are >> using a >> variable without a value. Since you are using a form to send data, >> this can >> occur. To be honest, its a fairly pointless warning, so you >> probably want to >> ignore it. In your php.ini file search for and find the >> error_reporting >> option. I recommend you change your settings to >> error_reporting = E_ALL & ~E_NOTICE >> This should solve your problem. >> >> ----- Original Message ----- >> From: "Stuart Felenstein" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> Sent: Saturday, June 14, 2003 10:18 AM >> Subject: Re: [PHP-WIN] Help please: undefined index in sample code >> >> >> > Yes, register globals are now on. Though it doesn't apparently >> matter. >> > >> > Stuart >> > >> > toby z <[EMAIL PROTECTED]> wrote: >> > register globals on or off ????? >> > >> > --- Stuart Felenstein wrote: > I can't believe >> > Chapter 1 , section 1 and I'm off to a bad start >> > > already. >> > > Using this form and script, I keep getting "undefined index" >> for >> > > the variables I declare in the script. Running PHP 4.3.2 on XP >> > > Pro. Thanks. >> > > Stuart >> > > >> > > Form: >> > > >> > > >> > > >> > > >> > > Item >> > > Quantity >> > > >> > > >> > > Tires >> > > [input] > maxlength="3"> >> > > >> > > >> > > Oil >> > > [input] > maxlength="3"> >> > > >> > > >> > > Spark Plugs >> > > [input] > maxlength="3"> >> > > >> > > >> > > [input] > Order"> >> > > >> > > >> > > >> > > >> > > Script: >> > > >> > > >> > > >> > > >> > > >> > > >> > > Bob's Auto Parts >> > > Order Results >> > > > //create short variable names >> > > $tireqty = $_POST['tireqty']; >> > > $oilqty = $_POST['oilqty']; >> > > $sparkqty = $_POST['sparkqty']; >> > > ?> >> > > > echo ' >> > Your order is as follows: >> > '; >> > > echo $tireqty.' tires >> > '; >> > > echo $oilqty.' bottles of oil >> > '; >> > > echo $sparkqty.' spark plugs >> > '; >> > > ?> >> > > >> > > >> > > >> > >> > >> >________________________________________________________________________ >> > Want to chat instantly with your online friends? Get the FREE >> Yahoo! >> > Messenger http://uk.messenger.yahoo.com/ >> >> >> >> -- >> PHP Windows Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > >________________________________________________________________________ >Want to chat instantly with your online friends? Get the FREE Yahoo! >Messenger http://uk.messenger.yahoo.com/ > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > -- Ron Herhuth -- Senior Developer -- [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---Toby, $_POST should exist even if register globals are on! Thats why I said it would probably be nothing to do with it. Unless I am mistaken Stephen ----- Original Message ----- From: "toby z" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 10:37 AM Subject: Re: [PHP-WIN] Help please: undefined index in sample code > my dear man > if u try > > >> $tireqty = $_POST['tireqty']; > > with register globals on > > it gives u the same error :) > > i didn ask that without any reazon > > toby > > --- Stephen <[EMAIL PROTECTED]> wrote: > Which just > goes to show some people will say anything... > > > > I don't think this has anything to do with register globals (Sorry > > toby). > > Undefined index sounds like php is just warning you that you are > > using a > > variable without a value. Since you are using a form to send data, > > this can > > occur. To be honest, its a fairly pointless warning, so you > > probably want to > > ignore it. In your php.ini file search for and find the > > error_reporting > > option. I recommend you change your settings to > > error_reporting = E_ALL & ~E_NOTICE > > This should solve your problem. > > > > ----- Original Message ----- > > From: "Stuart Felenstein" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Saturday, June 14, 2003 10:18 AM > > Subject: Re: [PHP-WIN] Help please: undefined index in sample code > > > > > > > Yes, register globals are now on. Though it doesn't apparently > > matter. > > > > > > Stuart > > > > > > toby z <[EMAIL PROTECTED]> wrote: > > > register globals on or off ????? > > > > > > --- Stuart Felenstein wrote: > I can't believe > > > Chapter 1 , section 1 and I'm off to a bad start > > > > already. > > > > Using this form and script, I keep getting "undefined index" > > for > > > > the variables I declare in the script. Running PHP 4.3.2 on XP > > > > Pro. Thanks. > > > > Stuart > > > > > > > > Form: > > > > > > > > > > > > > > > > > > > > Item > > > > Quantity > > > > > > > > > > > > Tires > > > > [input] > maxlength="3"> > > > > > > > > > > > > Oil > > > > [input] > maxlength="3"> > > > > > > > > > > > > Spark Plugs > > > > [input] > maxlength="3"> > > > > > > > > > > > > [input] > Order"> > > > > > > > > > > > > > > > > > > > > Script: > > > > > > > > > > > > > > > > > > > > > > > > > > > > Bob's Auto Parts > > > > Order Results > > > > > //create short variable names > > > > $tireqty = $_POST['tireqty']; > > > > $oilqty = $_POST['oilqty']; > > > > $sparkqty = $_POST['sparkqty']; > > > > ?> > > > > > echo ' > > > Your order is as follows: > > > '; > > > > echo $tireqty.' tires > > > '; > > > > echo $oilqty.' bottles of oil > > > '; > > > > echo $sparkqty.' spark plugs > > > '; > > > > ?> > > > > > > > > > > > > > > > > > > > > > ________________________________________________________________________ > > > Want to chat instantly with your online friends? Get the FREE > > Yahoo! > > > Messenger http://uk.messenger.yahoo.com/ > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > ________________________________________________________________________ > Want to chat instantly with your online friends? Get the FREE Yahoo! > Messenger http://uk.messenger.yahoo.com/ >
--- End Message ---
--- Begin Message ---Toby, If you write $tireqty = $_POST['tireqty'] you're telling PHP that the calling script is sending a variable called 'tireqty'. Since on your case the name of the value and of the POST are the same, I mean that if you write $AFTER_POST = $_POST['VALUE_PASSED'] you will set a variable called $AFTER_POST to the value given by the calling form through the field named 'VALUE_PASSED' Otherwise, you trying to get the value of a POST that never was. Check the names of the fields on the form, and as someone said, use 'isset' to see if something actually went trough Sorry to be so thorough, but it's just to be as clear as I can Luis ----- Original Message ----- From: "Stephen" <[EMAIL PROTECTED]> To: "toby z" <[EMAIL PROTECTED]> Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 1:58 PM Subject: Re: [PHP-WIN] Help please: undefined index in sample code > Toby, $_POST should exist even if register globals are on! Thats why I said > it would probably be nothing to do with it. > > Unless I am mistaken > > Stephen > > ----- Original Message ----- > From: "toby z" <[EMAIL PROTECTED]> > To: "Stephen" <[EMAIL PROTECTED]> > Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]> > Sent: Monday, June 16, 2003 10:37 AM > Subject: Re: [PHP-WIN] Help please: undefined index in sample code > > > > my dear man > > if u try > > > > >> $tireqty = $_POST['tireqty']; > > > > with register globals on > > > > it gives u the same error :) > > > > i didn ask that without any reazon > > > > toby > > > > --- Stephen <[EMAIL PROTECTED]> wrote: > Which just > > goes to show some people will say anything... > > > > > > I don't think this has anything to do with register globals (Sorry > > > toby). > > > Undefined index sounds like php is just warning you that you are > > > using a > > > variable without a value. Since you are using a form to send data, > > > this can > > > occur. To be honest, its a fairly pointless warning, so you > > > probably want to > > > ignore it. In your php.ini file search for and find the > > > error_reporting > > > option. I recommend you change your settings to > > > error_reporting = E_ALL & ~E_NOTICE > > > This should solve your problem. > > > > > > ----- Original Message ----- > > > From: "Stuart Felenstein" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Saturday, June 14, 2003 10:18 AM > > > Subject: Re: [PHP-WIN] Help please: undefined index in sample code > > > > > > > > > > Yes, register globals are now on. Though it doesn't apparently > > > matter. > > > > > > > > Stuart > > > > > > > > toby z <[EMAIL PROTECTED]> wrote: > > > > register globals on or off ????? > > > > > > > > --- Stuart Felenstein wrote: > I can't believe > > > > Chapter 1 , section 1 and I'm off to a bad start > > > > > already. > > > > > Using this form and script, I keep getting "undefined index" > > > for > > > > > the variables I declare in the script. Running PHP 4.3.2 on XP > > > > > Pro. Thanks. > > > > > Stuart > > > > > > > > > > Form: > > > > > > > > > > > > > > > > > > > > > > > > > Item > > > > > Quantity > > > > > > > > > > > > > > > Tires > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > Oil > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > Spark Plugs > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > [input] > Order"> > > > > > > > > > > > > > > > > > > > > > > > > > Script: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Bob's Auto Parts > > > > > Order Results > > > > > > //create short variable names > > > > > $tireqty = $_POST['tireqty']; > > > > > $oilqty = $_POST['oilqty']; > > > > > $sparkqty = $_POST['sparkqty']; > > > > > ?> > > > > > > echo ' > > > > Your order is as follows: > > > > '; > > > > > echo $tireqty.' tires > > > > '; > > > > > echo $oilqty.' bottles of oil > > > > '; > > > > > echo $sparkqty.' spark plugs > > > > '; > > > > > ?> > > > > > > > > > > > > > > > > > > > > > > > > > > > > ________________________________________________________________________ > > > > Want to chat instantly with your online friends? Get the FREE > > > Yahoo! > > > > Messenger http://uk.messenger.yahoo.com/ > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > ________________________________________________________________________ > > Want to chat instantly with your online friends? Get the FREE Yahoo! > > Messenger http://uk.messenger.yahoo.com/ > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---jeez it didn work with me ...... !!!! i mean when i had register globals on it didn work ..... i guess i must ve tried that in the stone age ...... :| toby --- Stephen <[EMAIL PROTECTED]> wrote: > Toby, $_POST should exist even if register globals are on! Thats > why I said > it would probably be nothing to do with it. > > Unless I am mistaken > > Stephen > > ----- Original Message ----- > From: "toby z" <[EMAIL PROTECTED]> > To: "Stephen" <[EMAIL PROTECTED]> > Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]> > Sent: Monday, June 16, 2003 10:37 AM > Subject: Re: [PHP-WIN] Help please: undefined index in sample code > > > > my dear man > > if u try > > > > >> $tireqty = $_POST['tireqty']; > > > > with register globals on > > > > it gives u the same error :) > > > > i didn ask that without any reazon > > > > toby > > > > --- Stephen <[EMAIL PROTECTED]> wrote: > Which just > > goes to show some people will say anything... > > > > > > I don't think this has anything to do with register globals > (Sorry > > > toby). > > > Undefined index sounds like php is just warning you that you > are > > > using a > > > variable without a value. Since you are using a form to send > data, > > > this can > > > occur. To be honest, its a fairly pointless warning, so you > > > probably want to > > > ignore it. In your php.ini file search for and find the > > > error_reporting > > > option. I recommend you change your settings to > > > error_reporting = E_ALL & ~E_NOTICE > > > This should solve your problem. > > > > > > ----- Original Message ----- > > > From: "Stuart Felenstein" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Saturday, June 14, 2003 10:18 AM > > > Subject: Re: [PHP-WIN] Help please: undefined index in sample > code > > > > > > > > > > Yes, register globals are now on. Though it doesn't > apparently > > > matter. > > > > > > > > Stuart > > > > > > > > toby z <[EMAIL PROTECTED]> wrote: > > > > register globals on or off ????? > > > > > > > > --- Stuart Felenstein wrote: > I can't believe > > > > Chapter 1 , section 1 and I'm off to a bad start > > > > > already. > > > > > Using this form and script, I keep getting "undefined > index" > > > for > > > > > the variables I declare in the script. Running PHP 4.3.2 on > XP > > > > > Pro. Thanks. > > > > > Stuart > > > > > > > > > > Form: > > > > > > > > > > > > > > > > > > > > > > > > > Item > > > > > Quantity > > > > > > > > > > > > > > > Tires > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > Oil > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > Spark Plugs > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > [input] > Order"> > > > > > > > > > > > > > > > > > > > > > > > > > Script: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Bob's Auto Parts > > > > > Order Results > > > > > > //create short variable names > > > > > $tireqty = $_POST['tireqty']; > > > > > $oilqty = $_POST['oilqty']; > > > > > $sparkqty = $_POST['sparkqty']; > > > > > ?> > > > > > > echo ' > > > > Your order is as follows: > > > > '; > > > > > echo $tireqty.' tires > > > > '; > > > > > echo $oilqty.' bottles of oil > > > > '; > > > > > echo $sparkqty.' spark plugs > > > > '; > > > > > ?> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ________________________________________________________________________ > > > > Want to chat instantly with your online friends? Get the FREE > > > Yahoo! > > > > Messenger http://uk.messenger.yahoo.com/ > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > ________________________________________________________________________ > > Want to chat instantly with your online friends? Get the FREE > Yahoo! > > Messenger http://uk.messenger.yahoo.com/ > > > > ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message ---thats rather sweet of luis thnx :) but it was somebody elses problem this time i was only replying to stephen :) ;) toby --- Luis Moreira <[EMAIL PROTECTED]> wrote: > Toby, > > If you write > > $tireqty = $_POST['tireqty'] > > you're telling PHP that the calling script is sending a variable > called > 'tireqty'. > Since on your case the name of the value and of the POST are the > same, I > mean that if you write > > $AFTER_POST = $_POST['VALUE_PASSED'] > > you will set a variable called $AFTER_POST to the value given by > the calling > form through the field named 'VALUE_PASSED' > Otherwise, you trying to get the value of a POST that never was. > > Check the names of the fields on the form, and as someone said, use > 'isset' > to see if something actually went trough > > Sorry to be so thorough, but it's just to be as clear as I can > > > Luis > > > ----- Original Message ----- > From: "Stephen" <[EMAIL PROTECTED]> > To: "toby z" <[EMAIL PROTECTED]> > Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]> > Sent: Monday, June 16, 2003 1:58 PM > Subject: Re: [PHP-WIN] Help please: undefined index in sample code > > > > Toby, $_POST should exist even if register globals are on! Thats > why I > said > > it would probably be nothing to do with it. > > > > Unless I am mistaken > > > > Stephen > > > > ----- Original Message ----- > > From: "toby z" <[EMAIL PROTECTED]> > > To: "Stephen" <[EMAIL PROTECTED]> > > Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]> > > Sent: Monday, June 16, 2003 10:37 AM > > Subject: Re: [PHP-WIN] Help please: undefined index in sample > code > > > > > > > my dear man > > > if u try > > > > > > >> $tireqty = $_POST['tireqty']; > > > > > > with register globals on > > > > > > it gives u the same error :) > > > > > > i didn ask that without any reazon > > > > > > toby > > > > > > --- Stephen <[EMAIL PROTECTED]> wrote: > Which > just > > > goes to show some people will say anything... > > > > > > > > I don't think this has anything to do with register globals > (Sorry > > > > toby). > > > > Undefined index sounds like php is just warning you that you > are > > > > using a > > > > variable without a value. Since you are using a form to send > data, > > > > this can > > > > occur. To be honest, its a fairly pointless warning, so you > > > > probably want to > > > > ignore it. In your php.ini file search for and find the > > > > error_reporting > > > > option. I recommend you change your settings to > > > > error_reporting = E_ALL & ~E_NOTICE > > > > This should solve your problem. > > > > > > > > ----- Original Message ----- > > > > From: "Stuart Felenstein" <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Saturday, June 14, 2003 10:18 AM > > > > Subject: Re: [PHP-WIN] Help please: undefined index in sample > code > > > > > > > > > > > > > Yes, register globals are now on. Though it doesn't > apparently > > > > matter. > > > > > > > > > > Stuart > > > > > > > > > > toby z <[EMAIL PROTECTED]> wrote: > > > > > register globals on or off ????? > > > > > > > > > > --- Stuart Felenstein wrote: > I can't believe > > > > > Chapter 1 , section 1 and I'm off to a bad start > > > > > > already. > > > > > > Using this form and script, I keep getting "undefined > index" > > > > for > > > > > > the variables I declare in the script. Running PHP 4.3.2 > on XP > > > > > > Pro. Thanks. > > > > > > Stuart > > > > > > > > > > > > Form: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Item > > > > > > Quantity > > > > > > > > > > > > > > > > > > Tires > > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > > > > Oil > > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > > > > Spark Plugs > > > > > > [input] > maxlength="3"> > > > > > > > > > > > > > > > > > > [input] > Order"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Script: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Bob's Auto Parts > > > > > > Order Results > > > > > > > //create short variable names > > > > > > $tireqty = $_POST['tireqty']; > > > > > > $oilqty = $_POST['oilqty']; > > > > > > $sparkqty = $_POST['sparkqty']; > > > > > > ?> > > > > > > > echo ' > > > > > Your order is as follows: > > > > > '; > > > > > > echo $tireqty.' tires > > > > > '; > > > > > > echo $oilqty.' bottles of oil > > > > > '; > > > > > > echo $sparkqty.' spark plugs > > > > > '; > > > > > > ?> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ________________________________________________________________________ > > > > > Want to chat instantly with your online friends? Get the > FREE > > > > Yahoo! > > > > > Messenger http://uk.messenger.yahoo.com/ > > > > > > > > > > > > > > > > -- > > > > PHP Windows Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > ________________________________________________________________________ > > > Want to chat instantly with your online friends? Get the FREE > Yahoo! > > > Messenger http://uk.messenger.yahoo.com/ > > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message --- Try this. Please note that on windows you *cannot* raise a http auth box this way (PHP_AUTH_USER is not defined for Apache on windows), so you will need to use this on your live unix Apache/PHP server :
function getUserAuthPW() {
// If present, set user Authenticate Password box values
global $_SERVER;
if (isset($_SERVER["PHP_AUTH_USER"])) {
$username=safestring($_SERVER["PHP_AUTH_USER"]);
$password=safestring($_SERVER["PHP_AUTH_PW"]);
return true;
} else {
header("WWW-Authenticate: Basic realm=\"CaptionKit\"");
header("HTTP/1.0 401 Unauthorized");
echo "You must enter a valid login ID and password to access this resource\n";
exit;
}
}
What this does is to check for PHP_AUTH_USER and if it's not defined, raises a 401 error. The client interprets this as a request to enter user name & password, and brings up the grey box you see using .htaccess / .htpasswd files. The function safestring just adds slashes if there are characters which need escaping for your database (some people might just 'addslashes()' but I do a little more first, like trim and htmlspecialchars).
Cheers - Neil Smith.
Please note : I do not accept email from hotmail, yahoo, AOL or msn accounts. All such mail *will* be bounced and deleted without being read. Thankyou for your understanding.
At 07:36 16/06/2003 +0000, you wrote:Message-ID: <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Reply-To: "Guru P Chaturvedi" <[EMAIL PROTECTED]> From: "Guru P Chaturvedi" <[EMAIL PROTECTED]> Date: Mon, 16 Jun 2003 01:16:53 +0530 Subject: Re: User Authentication... MIME-Version: 1.0
Hi,
Any clues...please?!
--- End Message ---
--- Begin Message ---I bought a book on PHP, and in one of the examples it declares a variable without assigning it a variable, then it uses the gettype() method to show that the result would be "NULL". Well, when I test the script I get the following error:
Notice: Undefined variable: testing in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 7
A few months ago I remember that the script would run without a problem (I had to stop reading it and I picked it up again), but now it seems that I have to assing a value to variables before I can use them. Is this a change from a recent PHP update? I looked at their update section but I can't find anything that says this is something new. Or is this something that I have to set in php.ini?
Thanks for your help George
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--- End Message ---
--- Begin Message ---It's your PHP.ini... You must set error_reporting to like E_ALL & ~E_NOTICE or something like that... You might also want to check register_globals, most likely you want this to be On instead of Off which is default... "Jorge L." <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > I bought a book on PHP, and in one of the examples it declares a variable > without assigning it a variable, then it uses the gettype() method to show > that the result would be "NULL". Well, when I test the script I get the > following error: > > Notice: Undefined variable: testing in C:\Program Files\Apache > Group\Apache2\htdocs\test.php on line 7 > > A few months ago I remember that the script would run without a problem (I > had to stop reading it and I picked it up again), but now it seems that I > have to assing a value to variables before I can use them. Is this a change > from a recent PHP update? I looked at their update section but I can't find > anything that says this is something new. Or is this something that I have > to set in php.ini? > > Thanks for your help > George > > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail >
--- End Message ---
--- Begin Message ---On Mon, 2003-06-16 at 18:49, DvDmanDT wrote: > It's your PHP.ini... You must set error_reporting to like E_ALL & ~E_NOTICE > or something like that... You might also want to check register_globals, > most likely you want this to be On instead of Off which is default... Both of these are very bad advice. Why not fix the code instead of relying on bad and deprecated functionality? -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com
signature.asc
Description: This is a digitally signed message part
--- End Message ---
--- Begin Message ---I am getting the following error when i use the IE back button. Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. I read by writing the following it should work. session_cache_limiter('private_no_expire'); But no luck. How do i change the headers to make my back button work. Please help. Regards, Harpreet
--- End Message ---
--- Begin Message ---The 'installshield' distribution installs the cgi version of php along with a php.ini file which is exactly the same as the php.ini-dist which comes with the zip distribution with the following settings edited to the values set up by your progress through the wizard: SMTP sendmail_from upload_tmp_dir session.save_path error_reporting cgi.force_redirect As mentioned, this may be fine for a test setup - but for a production setup you are quite likely to want the extra performance you would get from a sapi installation and you may well need some extension modules which are only shipped with the zip distribution. With either distribution, if you are going to expose your system to the internet, you need to very carefully evaluate many security issues - the settings in php.ini being only a very small part of the whole picture. My own personal journey in this regard was to abandon the Windows platform, as I didn't think it was possible for me to learn enough to make and keep a Windows box secure :) Cheers -- Phil Driscoll
--- End Message ---
--- Begin Message ---Hi Phil Thanks for the info. The thing is i have already installed using the installshield on a number of online servers and this all works perfectly fine. It appears i do not need any of the extra extension modules which are only installed with the zip version because everything is working ok using the installsheild version. My only concern is any security issue. I'm still unsure exactly what security issue people are reffering to. i.e. what are the consequences of using the installshield in real terms. > The 'installshield' distribution installs the cgi version of php along with a > php.ini file which is exactly the same as the php.ini-dist which comes with > the zip distribution with the following settings edited to the values set up > by your progress through the wizard: > > SMTP > sendmail_from > upload_tmp_dir > session.save_path > error_reporting > cgi.force_redirect > > As mentioned, this may be fine for a test setup - but for a production setup > you are quite likely to want the extra performance you would get from a sapi > installation and you may well need some extension modules which are only > shipped with the zip distribution. With either distribution, if you are going > to expose your system to the internet, you need to very carefully evaluate > many security issues - the settings in php.ini being only a very small part > of the whole picture. > > My own personal journey in this regard was to abandon the Windows platform, as > I didn't think it was possible for me to learn enough to make and keep a > Windows box secure :) > > Cheers > -- > Phil Driscoll >
--- End Message ---
--- Begin Message ---On Monday 16 June 2003 5:21 pm, Daniel Crompton wrote: > > My only concern is any security issue. I'm still unsure exactly what > security issue people are reffering to. > i.e. what are the consequences of using the installshield in real terms. Exactly the same as using the zip distribution and installing php.ini-dist. Securing your Windows web server is a huge issue - the php.ini settings really are just a tiny part of the picture which includes: making sure your web server is patched to the hilt making sure your web server is configured securely making sure your os is patched to the hilt making sure you are running no unnecessary services making sure your own php scripts are secure and that unexpected input can't give attackers access to things you don't want them to access making sure that you trust no input whatsoever from the internet making sure your windows server is sat behind an industral strength firewall which is fowarding probably only port 80 requests to your windows machine If you don't feel you've already spent hundred of hours on the above, and you have a good grasp of what you need to do, then you've already been cracked and you just don't know it :) I suspect google is your best bet for advice on all of the above. Cheers -- Phil Driscoll
--- End Message ---
--- Begin Message ---I am getting the following error when i use the IE back button. Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. I read by writing the following it should work. session_cache_limiter('private_no_expire'); But no luck. How do i change the headers to make my back button work. Please help. Regards, Harpreet
--- End Message ---
--- Begin Message ---Its a feature of IE. It stops you going backwards to a page which was generated when you sent form data to it. There is no way around this, so you will need to find a way around your problem (A manual "<-- Go Back" link perhaps?) Stephen ----- Original Message ----- From: "Harpreet" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 7:55 PM Subject: [PHP-WIN] Back button error > I am getting the following error when i use the IE back button. > > Warning: Page has Expired The page you requested was created using > information you submitted in a form. This page is no longer available. As a > security precaution, Internet Explorer does not automatically resubmit your > information for you. > > To resubmit your information and view this Web page, click the Refresh > button. > > I read by writing the following it should work. > session_cache_limiter('private_no_expire'); > > But no luck. > How do i change the headers to make my back button work. > > Please help. > Regards, > Harpreet > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
--- End Message ---
--- Begin Message ---thanks for the reply. > This should be easy enough. First, have you checked to see if > register_globals is on or off on your local machine? It defaults to off, > so $DOCUMENT_ROOT would become $_SERVER['DOCUMENT_ROOT']. yep, it was set to 'off' so I've changed all the includes now so that they look like this: <?php include($_SERVER['DOCUMENT_ROOT'] . "/include/header.htm"); ?> again, they work fine on the live site but still not locally :( > Check a phpinfo() screen and see what variables are different between your > host and your local box. Just a simple file with only the following line: > > <?php phpinfo(); ?> > > will suffice. > well, here's the page I put up live: http://www.curve-online.co.uk/test.php I notice the live version of PHP is version 4.1.2. I'm running 4.2.3 locally. Could this make a difference? > Another thing you could do is to declare a php include directory and stuff > all your include files into there. erm, the live one is set to " .: " I tried adding it to the local include_path (on C:/windows/php.ini) so that it said " . ; .: ;C:/phpdev/php/includes;C:/phpdev/php/class " but still no joy - this is driving me really barmy now. Am I still missing something? cheers daz > > > hiya > > > > I've been tearing my hair out for 2 days now trying to get this to work and > > I'm sure the answer has gotta be pretty simple... > > > > I'm using PHP for the first time and have got some pages uploaded to my live > > site and they work like a dream - the problem is that they won't work > > locally using PHPdev. > > > > Every page on site uses the following include code on every page: > > > > <?php > > include($DOCUMENT_ROOT . "/include/header.htm"); > > ?> > > > > the theory is that no matter where you are in the site hierarchy (there's a > > lot of directories within directories) it should still work. > > > > Like I said, it DOES work fine when I upload the pages to my ISP but only > > the top level files of the site work locally. If you go down into > > sub-directories I get the following error: > > > > "Warning: Failed opening '/include/header.htm' for inclusion > > (include_path='.;C:/phpdev/php/includes;C:/phpdev/php/class') in > > c:\phpdev\www\curve-online.co.uk\discography\official.php on line 12" > > > > Any idea how I can get my local server working the same as my ISP server? > > > > cheers > > > > daz > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >
--- End Message ---