php-windows Digest 16 Jun 2003 07:36:33 -0000 Issue 1778
Topics (messages 20325 through 20334):
Re: more on HTTP post variables
20325 by: weifan agusman
TIP - Creating 'neat' Word documents with PHP
20326 by: George Pitcher
Re: Help please: undefined index in sample code
20327 by: Stuart Felenstein
Re: Grrrrr! Definitive guide for setup on XP Pro?
20328 by: Roy Henderson
Using the installshield vs manually
20329 by: Daniel Crompton
20330 by: Stephen
20331 by: Daniel Crompton
problems with variables
20332 by: Felipe Lorente
20334 by: malte
Re: User Authentication...
20333 by: Guru P Chaturvedi
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 ---
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?
thanks guys
weifan
____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005
--- End Message ---
--- Begin Message ---
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 ---
I actually did get the form and script to behave and work correctly as written below.
I think my configuration was off though I did a mass reconfigure so which particular
steps made it work I have no idea. I did dump all my dll's into my /system32
directory.
Anyway, I still get the same warning in Zend Studio as to the "undefined index" and
will try to figure that out. Regardless it works correctly on the web page.
Thanks
Stuart
Adam Goossens <[EMAIL PROTECTED]> wrote:Stuart,
This problem occurs when you try to access an index in an array that
does not exist.
First off, make sure that your variables are getting passed to the
script via POST. Do this by calling the function print_r(), and passing
the $_POST array as an argument to it.
print_r($_POST);
That will dump the entire contents of the _POST array onto the screen,
so you may check exactly what's in there. This may give you a clue as to
what is going wrong. I tested your script on my 4.3.2 build, and it
worked fine.
If $_POST doesn't work, give $HTTP_POST_VARS a try. If that doesn't
work, I'm stumped. What web server are you using?
-Adam.
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]
>
>
> Spark Plugs
> [input] > maxlength="3">
>
>
> [input]
>
>
>
>
> 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
';
> ?>
>
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
.. strange - my XP/Pro lives in WINNT and I don't have a windows folder ...
-----Original Message-----
From: Stuart Felenstein [mailto:[EMAIL PROTECTED]
Sent: 15 June 2003 11:56
To: Windows Helplist (PHP)
Subject: [PHP-WIN] Grrrrr! Definitive guide for setup on XP Pro?
I had to do a system restore yesterday and basically blew out my PHP setup.
What I seem to not be able to find is a definitive guide to setting up PHP
properly. I have followed the install guidelines on php.net (documentation)
for Windows. What I found though before, was that it was not completely
accurate and some of the comments helped. For instance, in the
documentation it says to put php.ini into the root directory, which by the
way suggested would be /winnt. No there is no /winnt under XP. So
following the other possiblity I dropped it into /windows. Nothing happened
so following someone's comment I put it into /system 32 along with
php4apache2 and php4ts. This seemed to turn it on. This though confuses me
as it still states to reference php4apache2 in the http.conf file as
apache/sapi/php4apache2. If I copied it over to system32 should I reference
it there.
Anyway is there a definitive guide for install, or some proven method to get
PHP 4.3.2, Apache 2 (latest stable) and XP Pro all singing the same tune?
Thanks
Stuart
--- End Message ---
--- Begin Message ---
Hi
There are two ways to install php on win2k, either manually or using the
installshield.
I have always installed php using the windows installshield which has
always worked perfectly. (win2k/iis)
The paragraph below suggests you should not install php this way.
Can anyone tell me why this says it is not secure?. Is there
reason for concern re. my previous installations?
TIA
http://www.php.net/manual/en/install.windows.php#install.windows.manual
Be aware, that this setup of PHP is not secure. If you would like to have a
secure PHP setup, you'd better go on the manual way, and set every option
carefully. This automatically working setup gives you an instantly working
PHP installation, but it is not meant to be used on online servers.
--- End Message ---
--- Begin Message ---
It is not secure because it creates a php.ini file with default settings. It
is better to choose your own settings in php.ini to suit your website and
the enviroment it opperates it. It also uses default settings in your server
configuration, which sometimes is not the best way to do it. If you only use
the server for beta testing/development, install shield is fine on its own.
Otherwise, it is best to customise the php.ini and check the server settings
(Which is almosts as time consuming as just installing manually!).
Stephen
----- Original Message -----
From: "Daniel Crompton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 7:08 PM
Subject: [PHP-WIN] Using the installshield vs manually
Hi
There are two ways to install php on win2k, either manually or using the
installshield.
I have always installed php using the windows installshield which has
always worked perfectly. (win2k/iis)
The paragraph below suggests you should not install php this way.
Can anyone tell me why this says it is not secure?. Is there
reason for concern re. my previous installations?
TIA
http://www.php.net/manual/en/install.windows.php#install.windows.manual
Be aware, that this setup of PHP is not secure. If you would like to have a
secure PHP setup, you'd better go on the manual way, and set every option
carefully. This automatically working setup gives you an instantly working
PHP installation, but it is not meant to be used on online servers.
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Stephen" <[EMAIL PROTECTED]>
To: "Daniel Crompton" <[EMAIL PROTECTED]>
Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 7:17 PM
Subject: Re: [PHP-WIN] Using the installshield vs manually
> It is not secure because it creates a php.ini file with default settings.
It
> is better to choose your own settings in php.ini to suit your website and
> the enviroment it opperates it. It also uses default settings in your
server
> configuration, which sometimes is not the best way to do it. If you only
use
> the server for beta testing/development, install shield is fine on its
own.
> Otherwise, it is best to customise the php.ini and check the server
settings
> (Which is almosts as time consuming as just installing manually!).
>
> Stephen
Hi Stephen
Unfortunately knowing nothing about php i'm not sure what the risks
are of having php.ini file with default settings.
Why is this such a problem. What sort of issues should i be concerned about
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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 ---
Hi,
Any clues...please?!
--- End Message ---