|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Mon Jan 06 2003 - 04:05:07 CST
php-general Digest 6 Jan 2003 10:05:07 -0000 Issue 1806
Topics (messages 130337 through 130374):
Advanced PHP Debugger
130337 by: Fredrik Johansson
Re: security in guest book and user forums
130338 by: Justin French
Re: PHP and MySQL bug
130339 by: David Freeman
Good Linux Admin Mail List
130340 by: Michael J. Pawlowsky
Unexpected $end error?
130341 by: Vincent Bouret
130342 by: Tom Rogers
130343 by: Rick Emery
130345 by: Michael J. Pawlowsky
How to get the mail sending stuff to work on Win2k?
130344 by: Rad Craig
130347 by: Andrew Brampton
130349 by: Rad Craig
130350 by: Rad Craig
130351 by: Manuel Lemos
Re: array help please
130346 by: David Freeman
Pass Variables
130348 by: Stephen
130352 by: Stephen
130359 by: Greg Beaver
Re: locally enabling register_globals?
130353 by: Daevid Vincent
Passing Query_String or variables through multiple pages?
130354 by: Noel Wade
130355 by: Justin French
Web Based PHP CVS
130356 by: Michael J. Pawlowsky
130357 by: Sterling Hughes
Re: undocumented OOP feature/bug?
130358 by: Greg Beaver
Zend IDE vs. PhpEd
130360 by: John Wells
130362 by: Sterling Hughes
130363 by: John Wells
130372 by: Mirek Novak
130373 by: Timothy Hitchens \(HiTCHO\)
Combine sockets and Header()
130361 by: Bobby Patel
Re: system()
130364 by: Jason Wong
printer_open
130365 by: Kathy
130366 by: Leif K-Brooks
130367 by: Jason Wong
emulate full post wth redirect
130368 by: Bobby Patel
emulate Post with redirect
130369 by: Bobby Patel
130370 by: Jason Wong
changing uid/gid
130371 by: Pupeno
email a web page
130374 by: DC
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
If someone out there has an .dll file for the Advanced PHP Debugger
(APD) extension to run i Windows 2000 (PHP version 4.2.2) I would be
glad if you could send it to me. I have tried to compile one myself but
has failed each and every time :(
Regards,
Fredrik Johansson
attached mail follows:
on 05/01/03 11:54 PM, Jurre Thiel (xs2jrr
xs4all.nl) wrote:
> The bad side of this that all other HTML tags than <b> and <i> will be
> removed.
So add some more tags!! Geeeez! Which would you prefer? Pretty colours
and bold text, or a page full of unclosed tags, evil javascripts, and other
harmfull markup?
Let me know where your message board / guestbook's are on the web, and i'll
wrap a
<b onmouseover="javascript:window.close()">
tag around my whole post... as soon as someone mouses over my guestbook
post, the window will close down :)
Justin French
attached mail follows:
>
MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this
> query doesn't work!!!!
Personally, I'd call it bad programming practice to do a database update
and not check to see if it worked or not. In this case, how are you
determining that the query did not work? Are you manually checking the
database? You don't have anything in your code to check the status of
this query.
Perhaps this might get you somewhere:
$qid =
mysql_query("UPDATE d SET h = '$h' WHERE id = '$id'");
if (isset($qid) && mysql_affected_rows() == 1)
{
echo "query executed";
} else {
echo "query failed: " . mysql_error();
}
At least this way you might get some indication of where the problem is.
CYA, Dave
attached mail follows:
Perhaps a weird place to ask.. but, anyone have a really good (advanced without to many newbie questions) Linux System Administrators Mail List?
Thanks,
Mike
attached mail follows:
Can someone tell me why I keep getting that error:
Parse error: parse error, unexpected $end in D:\Program Files\Apache
Group\Apache2\htdocs\proxy\acc_new.php on line 62
line 62 refers to </html>
Thanks for your help
Vincent
Here is the content of acc_new.php
<?php
//MUST declare $page_class to specify the level of authentication required
$page_class = "account";
include('auth.php');
include('mysql.php');
?>
<html>
<head>
<title>Account Management Tools - Add a new account</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="proxy.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1>Accounts Management Tools</h1>
<h2>Add a new account</h2>
<form name="frmAdd" method="post" action="acc_new.php">
<p><strong>Username:</strong>
<input type="text" name="textfield">
</p>
<p><strong>Password:</strong>
<input name="txtPassword" type="password" id="txtPassword" value=""
size="25" maxlength="20">
<em>Must contain between 4 and 20 characters.</em></p>
<p><strong>Firstname:</strong>
<input name="txtFirstname" type="text" id="txtFirstname" value=""
size="25" maxlength="50">
</p>
<p><strong>Lastname:</strong>
<input name="txtLastname" type="text" id="txtLastname" value=""
size="25" maxlength="50">
</p>
<p><strong>Email address:</strong>
<input name="txtEmail" type="text" id="txtEmail" value="" size="50"
maxlength="80">
</p>
<p><strong>Usergroup:</strong>
<select name="selUserGroup">
<?php
//Fetch list of groups
$result = mysql_query("SELECT id, name FROM tblUserGroups", $db);
$row = mysql_fetch_array($result);
if ($row = mysql_fetch_array($result)) {
do {
?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['name'];
?></option>
<?php
} while($row = mysql_fetch_array($result));
?>
</select>
</p>
<p align="center">
<input name="btnAdd" type="submit" id="btnUpdate" value="Add new
account">
</p>
</form>
<p><a href="man_accounts.php">Back to Account Management Tools</a></p>
</body>
</html>
and here is the content of auth.php
<?php
//some code working with every other pages
?>
and mysql.php
<?php
//mysql.php Include file initializing connection to db
$db = mysql_connect(dbinfo goes here);
mysql_select_db("proxy_db", $db);
?>
attached mail follows:
Hi,
Monday, January 6, 2003, 8:56:58 AM, you wrote:
VB> Can someone tell me why I keep getting that error:
VB> Parse error: parse error, unexpected $end in D:\Program Files\Apache
VB> Group\Apache2\htdocs\proxy\acc_new.php on line 62
VB> line 62 refers to </html>
VB> Thanks for your help
VB> Vincent
VB> Here is the content of acc_new.php
VB> <?php
VB> //MUST declare $page_class to specify the level of authentication required
VB> $page_class = "account";
VB> include('auth.php');
VB> include('mysql.php');
?>>
VB> <html>
VB> <head>
VB> <title>Account Management Tools - Add a new account</title>
VB> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
VB> <link href="proxy.css" rel="stylesheet" type="text/css">
VB> </head>
VB> <body>
VB> <h1>Accounts Management Tools</h1>
VB> <h2>Add a new account</h2>
VB> <form name="frmAdd" method="post" action="acc_new.php">
VB> <p><strong>Username:</strong>
VB> <input type="text" name="textfield">
VB> </p>
VB> <p><strong>Password:</strong>
VB> <input name="txtPassword" type="password" id="txtPassword" value=""
VB> size="25" maxlength="20">
VB> <em>Must contain between 4 and 20 characters.</em></p>
VB> <p><strong>Firstname:</strong>
VB> <input name="txtFirstname" type="text" id="txtFirstname" value=""
VB> size="25" maxlength="50">
VB> </p>
VB> <p><strong>Lastname:</strong>
VB> <input name="txtLastname" type="text" id="txtLastname" value=""
VB> size="25" maxlength="50">
VB> </p>
VB> <p><strong>Email address:</strong>
VB> <input name="txtEmail" type="text" id="txtEmail" value="" size="50"
maxlength="80">>
VB> </p>
VB> <p><strong>Usergroup:</strong>
VB> <select name="selUserGroup">
VB> <?php
VB> //Fetch list of groups
VB> $result = mysql_query("SELECT id, name FROM tblUserGroups", $db);
VB> $row = mysql_fetch_array($result);
VB> if ($row = mysql_fetch_array($result)) {
VB> do {
VB> ?>
VB> <option value="<?php echo $row['id']; ?>"><?php echo $row['name'];
?>></option>
VB> <?php
VB> } while($row = mysql_fetch_array($result));
VB> ?>
VB> </select>
VB> </p>
VB> <p align="center">
VB> <input name="btnAdd" type="submit" id="btnUpdate" value="Add new
account">>
VB> </p>
VB> </form>
VB> <p><a href="man_accounts.php">Back to Account Management Tools</a></p>
VB> </body>
VB> </html>
VB> and here is the content of auth.php
VB> <?php
VB> //some code working with every other pages
?>>
VB> and mysql.php
VB> <?php
VB> //mysql.php Include file initializing connection to db
VB> $db = mysql_connect(dbinfo goes here);
VB> mysql_select_db("proxy_db", $db);
?>>
That happens if you have mismatched braces {} or if(): endif; etc
-- regards, Tom
attached mail follows:
When you get an error that points to </HTML>, it means you did not close a {} or ""
In this case, you did not close the: if ($row = mysql_fetch_array($result)) {
Although you did close the "while do {}" immediately thereafter.
----- Original Message -----
From: "Vincent Bouret" <vbouret
iquebec.com>
To: <>
Sent: Sunday, January 05, 2003 4:56 PM
Subject: [PHP] Unexpected $end error?
Can someone tell me why I keep getting that error:
Parse error: parse error, unexpected $end in D:\Program Files\Apache Group\Apache2\htdocs\proxy\acc_new.php on line 62
line 62 refers to </html>
Thanks for your help
Vincent
Here is the content of acc_new.php
<?php //MUST declare $page_class to specify the level of authentication required $page_class = "account";
include('auth.php');
include('mysql.php');
?> <html> <head> <title>Account Management Tools - Add a new account</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="proxy.css" rel="stylesheet" type="text/css"> </head>
<body> <h1>Accounts Management Tools</h1> <h2>Add a new account</h2> <form name="frmAdd" method="post" action="acc_new.php"> <p><strong>Username:</strong> <input type="text" name="textfield"> </p> <p><strong>Password:</strong> <input name="txtPassword" type="password" id="txtPassword" value="" size="25" maxlength="20"> <em>Must contain between 4 and 20 characters.</em></p> <p><strong>Firstname:</strong> <input name="txtFirstname" type="text" id="txtFirstname" value="" size="25" maxlength="50"> </p> <p><strong>Lastname:</strong> <input name="txtLastname" type="text" id="txtLastname" value="" size="25" maxlength="50"> </p> <p><strong>Email address:</strong> <input name="txtEmail" type="text" id="txtEmail" value="" size="50" maxlength="80"> </p> <p><strong>Usergroup:</strong> <select name="selUserGroup"> <?php //Fetch list of groups $result = mysql_query("SELECT id, name FROM tblUserGroups", $db); $row = mysql_fetch_array($result); if ($row = mysql_fetch_array($result)) { do { ?> <option value="<?php echo $row['id']; ?>"><?php echo $row['name']; ?></option> <?php } while($row = mysql_fetch_array($result)); ?> </select> </p>
<p align="center"> <input name="btnAdd" type="submit" id="btnUpdate" value="Add new account"> </p>
</form>
<p><a href="man_accounts.php">Back to Account Management Tools</a></p>
</body> </html>
and here is the content of auth.php
<?php
//some code working with every other pages
?>
and mysql.php
<?php //mysql.php Include file initializing connection to db $db = mysql_connect(dbinfo goes here); mysql_select_db("proxy_db", $db);
?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
look at your loop. you have mis matched <?php and a ?> which starts one
*********** REPLY SEPARATOR ***********
On 05/01/2003 at 5:56 PM Vincent Bouret wrote:
>Can someone tell me why I keep getting that error: > >Parse error: parse error, unexpected $end in D:\Program Files\Apache >Group\Apache2\htdocs\proxy\acc_new.php on line 62 > >line 62 refers to </html> > >Thanks for your help > >Vincent >
attached mail follows:
I have a fresh install of PHP on a Win2k server. It is installed along with MySQL to allow me to run and XMB message base on my website.
Everything works great except for the fact that I never receive any email notification when someone replies to a message I (or anyone else) posts. I think the problem is that I don't have the email part of PHP configured correctly.
I used the php.ini-recommended file to set it up. In the mail section it says:
SMTP=localhost
There is a mail server on the local host.
Do I have to install a sendmail app to get this working correctly?
Nothing shows up in the event logs.
One more question, when I make a change to that ini file, do I have to reboot the machine or just restart IIS? ================================ Rad Craig ================================ Rad Craig
attached mail follows:
change that line to your ISPs email server. OR install a email server locally
Andrew
----- Original Message -----
From: "Rad Craig" <rad
inductionconcepts.com>
To: "PHP Mailing List" <php-general
lists.php.net>
Sent: Sunday, January 05, 2003 11:20 PM
Subject: [PHP] How to get the mail sending stuff to work on Win2k?
> I have a fresh install of PHP on a Win2k server. It is installed along with > MySQL to allow me to run and XMB message base on my website. > > Everything works great except for the fact that I never receive any email > notification when someone replies to a message I (or anyone else) posts. I > think the problem is that I don't have the email part of PHP configured > correctly. > > I used the php.ini-recommended file to set it up. In the mail section it > says: > > SMTP=localhost > > There is a mail server on the local host. > > Do I have to install a sendmail app to get this working correctly? > > Nothing shows up in the event logs. > > One more question, when I make a change to that ini file, do I have to > reboot the machine or just restart IIS? > ================================ > Rad Craig > ================================ > Rad Craig > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
I run ArgoSoft's mail server which has worked great. I use SMTP authentication, could that be the problem?
Is there a way to setup the info for SMTP authentication in PHP so it can pass it to the mail server during it's sendmail type functions?
Rad...
> -----Original Message-----
> From: Andrew Brampton [mailto:andrew
bramp.freeserve.co.uk]
> Sent: Sunday, January 05, 2003 6:22 PM
> To: rad
inductionconcepts.com
> Subject: Re: [PHP] How to get the mail sending stuff to work on Win2k?
>
>
> Sorry I misread that you had a local mail server...
>
> Well I use ISP mail server for my PHP and it works fine, so there
> is no need
> to install any extras ie sendmail etc...
>
> I can only suggest that your mail server doesn't like forwarding mail for
> PHP, maybe it takes the wrong way to it or something... If you
> got any smtp
> logs have a read to see if you see anything. If its IIS SMTP server I
> beleive they are stored in c:\winnt\system32\Logfiles\....\blah.log.
>
> Also to reload the php settings you just have to restart IIS.
>
> Hope this helps
> Andrew
> ----- Original Message -----
> From: "Rad Craig" <rad
inductionconcepts.com>
> To: "Andrew Brampton" <andrew
bramp.freeserve.co.uk>
> Sent: Monday, January 06, 2003 12:20 AM
> Subject: RE: [PHP] How to get the mail sending stuff to work on Win2k?
>
>
> > I have an email server installed on that machine. Mail server works
> great,
> > has been for many months.
> >
> > I have tested it via PHP using this code:
> >
> > <?php mail("me
myemailaddy.com", "test message", "this is a test"); ?>
> >
> > But it doesn't work. I never get an email.
> >
> > I've tried:
> > SMTP = localhost
> > SMTP = 127.0.0.1
> > SMTP = mail.mydomain.com
> >
> > None work.
> >
> > Rad...
> >
> > > -----Original Message-----
> > > From: Andrew Brampton [mailto:andrew
bramp.freeserve.co.uk]
> > > Sent: Sunday, January 05, 2003 6:12 PM
> > > To: rad
inductionconcepts.com; php-general
lists.php.net
> > > Subject: Re: [PHP] How to get the mail sending stuff to work on Win2k?
> > >
> > >
> > > change that line to your ISPs email server.
> > > OR install a email server locally
> > >
> > > Andrew
> > > ----- Original Message -----
> > > From: "Rad Craig" <rad
inductionconcepts.com>
> > > To: "PHP Mailing List" <php-general
lists.php.net>
> > > Sent: Sunday, January 05, 2003 11:20 PM
> > > Subject: [PHP] How to get the mail sending stuff to work on Win2k?
> > >
> > >
> > > > I have a fresh install of PHP on a Win2k server. It is installed
> along
> > > with
> > > > MySQL to allow me to run and XMB message base on my website.
> > > >
> > > > Everything works great except for the fact that I never receive
> > > any email
> > > > notification when someone replies to a message I (or anyone else)
> posts.
> > > I
> > > > think the problem is that I don't have the email part of PHP
> configured
> > > > correctly.
> > > >
> > > > I used the php.ini-recommended file to set it up. In the mail
> > > section it
> > > > says:
> > > >
> > > > SMTP=localhost
> > > >
> > > > There is a mail server on the local host.
> > > >
> > > > Do I have to install a sendmail app to get this working correctly?
> > > >
> > > > Nothing shows up in the event logs.
> > > >
> > > > One more question, when I make a change to that ini file,
> do I have to
> > > > reboot the machine or just restart IIS?
> > > > ================================
> > > > Rad Craig
> > > > ================================
> > > > Rad Craig
> > > >
> > > >
> > > >
> > > > --
> > > > 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
> > >
> > >
> >
> >
> >
>
>
attached mail follows:
I just turned PHP authentication off and it didn't make any difference, still didn't receive any email from PHP.
Rad...
> -----Original Message-----
> From: Rad Craig [mailto:rad
inductionconcepts.com]
> Sent: Sunday, January 05, 2003 6:37 PM
> To: PHP Mailing List
> Subject: FW: [PHP] How to get the mail sending stuff to work on Win2k?
>
>
> I run ArgoSoft's mail server which has worked great. I use SMTP
> authentication, could that be the problem?
>
> Is there a way to setup the info for SMTP authentication in PHP so it can
> pass it to the mail server during it's sendmail type functions?
>
> Rad...
>
> > -----Original Message-----
> > From: Andrew Brampton [mailto:andrew
bramp.freeserve.co.uk]
> > Sent: Sunday, January 05, 2003 6:22 PM
> > To: rad
inductionconcepts.com
> > Subject: Re: [PHP] How to get the mail sending stuff to work on Win2k?
> >
> >
> > Sorry I misread that you had a local mail server...
> >
> > Well I use ISP mail server for my PHP and it works fine, so there
> > is no need
> > to install any extras ie sendmail etc...
> >
> > I can only suggest that your mail server doesn't like
> forwarding mail for
> > PHP, maybe it takes the wrong way to it or something... If you
> > got any smtp
> > logs have a read to see if you see anything. If its IIS SMTP server I
> > beleive they are stored in c:\winnt\system32\Logfiles\....\blah.log.
> >
> > Also to reload the php settings you just have to restart IIS.
> >
> > Hope this helps
> > Andrew
> > ----- Original Message -----
> > From: "Rad Craig" <rad
inductionconcepts.com>
> > To: "Andrew Brampton" <andrew
bramp.freeserve.co.uk>
> > Sent: Monday, January 06, 2003 12:20 AM
> > Subject: RE: [PHP] How to get the mail sending stuff to work on Win2k?
> >
> >
> > > I have an email server installed on that machine. Mail server works
> > great,
> > > has been for many months.
> > >
> > > I have tested it via PHP using this code:
> > >
> > > <?php mail("me
myemailaddy.com", "test message", "this is a test"); ?>
> > >
> > > But it doesn't work. I never get an email.
> > >
> > > I've tried:
> > > SMTP = localhost
> > > SMTP = 127.0.0.1
> > > SMTP = mail.mydomain.com
> > >
> > > None work.
> > >
> > > Rad...
> > >
> > > > -----Original Message-----
> > > > From: Andrew Brampton [mailto:andrew
bramp.freeserve.co.uk]
> > > > Sent: Sunday, January 05, 2003 6:12 PM
> > > > To: rad
inductionconcepts.com; php-general
lists.php.net
> > > > Subject: Re: [PHP] How to get the mail sending stuff to
> work on Win2k?
> > > >
> > > >
> > > > change that line to your ISPs email server.
> > > > OR install a email server locally
> > > >
> > > > Andrew
> > > > ----- Original Message -----
> > > > From: "Rad Craig" <rad
inductionconcepts.com>
> > > > To: "PHP Mailing List" <php-general
lists.php.net>
> > > > Sent: Sunday, January 05, 2003 11:20 PM
> > > > Subject: [PHP] How to get the mail sending stuff to work on Win2k?
> > > >
> > > >
> > > > > I have a fresh install of PHP on a Win2k server. It is installed
> > along
> > > > with
> > > > > MySQL to allow me to run and XMB message base on my website.
> > > > >
> > > > > Everything works great except for the fact that I never receive
> > > > any email
> > > > > notification when someone replies to a message I (or anyone else)
> > posts.
> > > > I
> > > > > think the problem is that I don't have the email part of PHP
> > configured
> > > > > correctly.
> > > > >
> > > > > I used the php.ini-recommended file to set it up. In the mail
> > > > section it
> > > > > says:
> > > > >
> > > > > SMTP=localhost
> > > > >
> > > > > There is a mail server on the local host.
> > > > >
> > > > > Do I have to install a sendmail app to get this working correctly?
> > > > >
> > > > > Nothing shows up in the event logs.
> > > > >
> > > > > One more question, when I make a change to that ini file,
> > do I have to
> > > > > reboot the machine or just restart IIS?
> > > > > ================================
> > > > > Rad Craig
> > > > > ================================
> > > > > Rad Craig
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hello,
On 01/05/2003 10:37 PM, Rad Craig wrote: > I run ArgoSoft's mail server which has worked great. I use SMTP > authentication, could that be the problem? > > Is there a way to setup the info for SMTP authentication in PHP so it can > pass it to the mail server during it's sendmail type functions?
No, PHP mail() function does not support authentication. You may want to try this class that comes with a wrapper function named smtp_mail() that emulates the mail() function by sending the message via SMTP. It les you configure the authentication credentials among other things that the mail() function does not support:
http://www.phpclasses.org/mimemessage
To send via SMTP you also need this:
http://www.phpclasses.org/smtpclass
--Regards, Manuel Lemos
attached mail follows:
> $mysql query1 > result > array[cityid][cityname] > > mysql query2 > result > array[cityid][cityname] > > now what i want to do is kick out any doubles in my array > and resort them alphebetically by cityname ?!
It's difficult to answer this question without knowing more about the context and the way you have your database laid out.
In any event, sorting stuff and getting removing duplicates is probably better achieved in your mysql query than in php.
Something like this would get you close (you'll have to figure it out for your database as you didn't give much to go on)...
SELECT cityid, DISTINCE(cityname) FROM my_table WHERE some = 'condition' ORDER BY cityname
Basically, use DISTINCT() to remove duplicates and use ORDER BY to set the display order.
CYA, Dave
attached mail follows:
I want to make a function that passes all the variables in a form to the next form since the form has multiple steps. I thought about putting all the contents in an array but I'd have to name out each array which would take a while and then there's the global inside the function, but again, I'd have to list all of them out. Any other quick and simple way?
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
Oh yeah, forgot that the $_POST variable was an actual array already... Thanks!
----- Original Message -----
From: "Justin French" <justin
indent.com.au>
To: "Stephen" <webmaster
melchior.us>
Sent: Sunday, January 05, 2003 7:56 PM
Subject: Re: [PHP] Pass Variables
: Assuming php > 4.1, on the script that accepts the first form's submitted
: content, you want to loop through the POST variables, and include them as
: hidden INPUTs on the second form
:
: <!-- the second form -->
: <form action="something.php" method="POST">
: <?
: foreach($_POST as $key => $value)
: {
: echo "<input type='hidden' name='{$key}' value='{$value}'>\n";
: }
: ?>
: <!-- other form elements -->
: Your shoe size: <input type='text' name='shoe_size' value='' size='2'><br
/>
: </form>
:
: Totally untested code (never had to do a multi-page form!!), but in
theory,
: you've got a heap of POST items in an array from the first form... all you
: need to do is include them in the second form as hidden fields, and
they'll
: become part of the second form.
:
:
: Have fun,
:
: Justin
:
:
: on 06/01/03 11:16 AM, Stephen (webmaster
melchior.us) wrote:
:
: > I want to make a function that passes all the variables in a form to the
next
: > form since the form has multiple steps. I thought about putting all the
: > contents in an array but I'd have to name out each array which would
take a
: > while and then there's the global inside the function, but again, I'd
have to
: > list all of them out. Any other quick and simple way?
: >
: > Thanks,
: > Stephen Craton
: > http://www.melchior.us
: >
: > "What's the point in appearance if your true love, doesn't care about
it?" --
: > http://www.melchior.us
:
:
:
attached mail follows:
Use sessions, you can save the result of the previous form in a server-side variable, and it will still be there even if the user has a modem disconnect.
Take care, Greg
-- phpDocumentor http://www.phpdoc.org"Stephen" <webmaster
melchior.us> wrote in message news:000b01c2b518$d8e4a1a0$0200a8c0
melchior... I want to make a function that passes all the variables in a form to the next form since the form has multiple steps. I thought about putting all the contents in an array but I'd have to name out each array which would take a while and then there's the global inside the function, but again, I'd have to list all of them out. Any other quick and simple way?
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
This might help... Put this at the top of each page:
reset ($_POST); while (list ($key, $val) = each ($_POST)) { //echo "$key => $val<br>\n"; $$key = $val; }
You could do the same for $_GET if you need to as well.
DÆVID.
> -----Original Message-----
> From: Michael Greenspon [mailto:mcg
sequin.com]
> Sent: Friday, January 03, 2003 5:51 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] locally enabling register_globals?
>
>
> Thanks. This is what we've chosen to do-- 'fix' the code.
> Unfortunately this was all written 'old style' by novices, so 'fixing'
> it by putting in references to $_GET, $_POST etc. doesn't really lend
> any clarity to it. Values are still splayed out across multiple pages
> with no structure. But at least it works now. Still uncertain why the
> php_flag in htaccess didn't do it-- perhaps not enabled with Apache.
> Cheers
> M.
>
>
> "Michael J. Pawlowsky" wrote:
> >
> > Why not just fix your code?
> >
> > *********** REPLY SEPARATOR ***********
> >
> > On 03/01/2003 at 2:50 PM Michael Greenspon wrote:
> >
> > >Our hosting provider installed PHP 4.2 and thus disabled
> > >register_globals by default which our scripts depend on.
> We don't have
> > >access to php.ini to change this. This is with Apache. I
> tried putting
> > >
> > >php_flags register_globals on
> > >
> > >into .htaccess in the directory(s) with pages that need
> this but it does
> > >not seem to work. How can I enable register_globals
> selectively for some
> > >directories of pages so that our old scripts work again?
> > >
> > >Thanks
> > >Michael
> > >
> > >--
> > >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
>
attached mail follows:
Hi all,
I have an issue I'm hoping there's a simple answer for (I'm betting there is):
I have a dynamic page where the user may click on a link - this link processes their data and shows them a "result" page...
Then I want a variable (for a manual hypertext link) that contains the original URL they were viewing. The problem is, the original page / URL needs a query string (i.e. "?key1=val1&key2=val2&key3=val3...").
So I have to somehow pass their original query string THROUGH the "result page" via a GET, and without using a <form> (using a POST form I could do it)... I've looked at manually copying and "forwarding" each original variable by including it in the URL for the "result page"; but I was hoping for something more elegant and flexible...
Any thoughts or ideas?
Thanks a bunch in advance! Take care,
--Noel
attached mail follows:
get your entire query string (eg key1=val1&key2=val2&key3=val3), base64encode() it, pass it through to the next page via get as a var (eg href="page.php?ref=<?=base64encode($_SERVER["QUERY_STRING"])?>">, the base64decode() it on the next page... I use this HEAPS.
Justin
on 06/01/03 1:12 PM, Noel Wade (noelwade
attbi.com) wrote:
> Hi all, > > I have an issue I'm hoping there's a simple answer for (I'm betting there > is): > > I have a dynamic page where the user may click on a link - this link > processes their data and shows them a "result" page... > > Then I want a variable (for a manual hypertext link) that contains the > original URL they were viewing. The problem is, the original page / URL > needs a query string (i.e. "?key1=val1&key2=val2&key3=val3..."). > > So I have to somehow pass their original query string THROUGH the "result > page" via a GET, and without using a <form> (using a POST form I could do > it)... I've looked at manually copying and "forwarding" each original > variable by including it in the URL for the "result page"; but I was hoping > for something more elegant and flexible... > > Any thoughts or ideas? > > Thanks a bunch in advance! Take care, > > --Noel > > >
attached mail follows:
Does anyone know of any decent PHP/Web front ends to CVS?
Thanks Mike
P.S. Still looking for a good Linux SysAdmin Mail list. I don't understand Romanian but thanks for the answer! :-)
attached mail follows:
> > Does anyone know of any decent PHP/Web front ends to CVS? >
check out chora.
-sterling
> Thanks > Mike > > > P.S. Still looking for a good Linux SysAdmin Mail list. > I don't understand Romanian but thanks for the answer! :-) > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Use get_class($this)
function Go() { if (!isset($this)) { echo 'Called Statically<br />'; } switch(get_class($this)) { // note get_class is lowercase (which I think is a bug, but it hasn't changed, so oh well) 'a' : echo 'Called Dynamically<br />'; 'b' : echo 'Called Statically<br />'; } }
or, is_a() to include descendants (PHP 4.2.0+ I think)
function Go() { if (!isset($this)) { echo 'Called Statically<br />'; } if (is_a($this,'a')) { echo 'Called Dynamically<br />'; } else { echo 'Called Statically<br />'; } }
Incidentally, this ability to call other methods and operate on your own variables is in my opinion the greatest feature of PHP along with aggregation. It allows dynamic (runtime!) multiple inheritance, which is essential for the new version of a complex data-access project I'm working on constantly (http://calendar.chiaraquartet.net)
Take care, Greg
-- phpDocumentor http://www.phpdoc.org"Sean Malloy" <sean
element.net.au> wrote in message news:CGEHIGJLIDDPBDNCJCMIOEMPGGAA.sean
element.net.au... > Consider the following code... > > class A > { > function Go() > { > switch (isset($this)) > { > case true: echo 'Called Dynamically<br />'; break; > case false: echo 'Called Statically<br />'; break; > } > } > } > > class B > { > function Go() > { > A::Go(); > } > } > > A::Go(); > $a = new A(); > $a->Go(); > > B::Go(); > $b = new B(); > $b->Go(); > > > My understanding is that the output should be: > > Called Statically > Called Dynamically > Called Statically > Called Statically > > Yet the output is actually: > > Called Statically > Called Dynamically > Called Statically > Called Dynamically > > > Now my question is, is this what was intended? > > It seems that if you call a static class from within a dynamic instance of a > class, the static class then decides $this should reference the class from > which the static class was called > > Anyone else come across this? > > It could be useful, but right now, its bloody annoying! I need a class to be > called from within another clas, and it needs to know wether it has had an > instance created, or wether it is being statically called, and now I'll have > to write some kludge code instead... > > > > > /////////////////////////////////////////////////////////////////// > // Sean Malloy > // Developer > // element > // t: +61 3 9510 7777 > // f: +61 3 9510 7755 > // m: 0413 383 683 > /////////////////////////////////////////////////////////////////// > > DISCLAIMER: > © copyright protected element digital pty ltd 2002. > the information contained herein is the intellectual property > of element digital pty ltd and may contain confidential material. > you must not disclose, reproduce, copy, or use this information > in any way unless authorised by element digital pty ltd in writing > or except as permitted by any applicable laws including the > copyright act 1968 (cth). >
attached mail follows:
Can anyone who's familiar with both give an honest, open evaluation? I'm in a rush project and need something quickly (have to purchase tomorrow), but I'm on the fence when it comes to these two products.
Zend costs $100 less than Phped, so I'm leaning that way. But if there's anything you know that could make my decision easier, please forward it on. They seem pretty comparable, with the exception of PhpEd's db browser.
Thanks!
John
attached mail follows:
> Can anyone who's familiar with both give an honest, open evaluation? I'm > in a rush project and need something quickly (have to purchase tomorrow), > but I'm on the fence when it comes to these two products. > > Zend costs $100 less than Phped, so I'm leaning that way. But if there's > anything you know that could make my decision easier, please forward it > on. They seem pretty comparable, with the exception of PhpEd's db > browser. >
I personally recommend the Zend IDE, simply because:
1) Its (more) cross platform 2) A more complete autocompletion. Uses javadoc style documentation to generate function prototypes for which you can then use autocompletion. It also resolves classes and objects. 3) Richer debugger 4) Better integration with other Zend products, if you want to use the encoder, it plugs right into the Zend IDE. 5) I like working with it more, and that's what it all comes down too. The Zend IDE is what I'm more comfortable with (outside of vim and emacs, which I must admit are my primary development tools).
-Sterling
> Thanks! > > John > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Sterling,
Thanks for the reply. I'm also impressed with Zend's autocompletion...I can't even get PHPEd to autocomplete on objects.
I wonder if Zend uses dbg as well. It'd be nice to see a profiler thrown into a future version.
Finally, one frustrating thing on the part of both editors is the inability to autocomplete on arrays of object references...but I suppose that's a little difficult with a dynamically typed language.
Thanks!
John
attached mail follows:
John Wells wrote: > Can anyone who's familiar with both give an honest, open evaluation? I'm > in a rush project and need something quickly (have to purchase tomorrow), > but I'm on the fence when it comes to these two products. > > Zend costs $100 less than Phped, so I'm leaning that way. But if there's > anything you know that could make my decision easier, please forward it > on. They seem pretty comparable, with the exception of PhpEd's db > browser.
... have u seen phpEdit? It's for free, has perfect autocompletion, project manager, editable templates and many other features. AFAIK it has no db browser, but has good developer community around ... http://www.phpedit.net
-- Mirek Novak jabber:mirekjabber.cz ICQ:119499448
AUTO.CZ http://www.auto.cz
NEWS.AUTO.CZ http://news.auto.cz
FORMULE1.CZ http://www.formule1.cz
attached mail follows:
__NO I DON'T WORK FOR ZEND__
Well I use Zend Studio and have done for sometime.
Check out there offer for Small Business:
http://www.zend.com/store/products/zend-smallbiz.php
Includes the Encoder and the IDE ++
You won't regret a Zend Studio buy and with the upgrade option you get all upgrades (including all version comp eg 4.x.x comp) included.
HiTCHO has Spoken!
Timothy Hitchens (HiTCHO)
tim
hitcho.com.au
> -----Original Message-----
> From: Mirek Novak [mailto:mirek.novak
auto.cz]
> Sent: Monday, 6 January 2003 5:08 PM
> To: John Wells; php-general
lists.php.net
> Subject: Re: [PHP] Zend IDE vs. PhpEd
>
>
> John Wells wrote:
> > Can anyone who's familiar with both give an honest, open
> evaluation?
> > I'm in a rush project and need something quickly (have to purchase
> > tomorrow), but I'm on the fence when it comes to these two products.
> >
> > Zend costs $100 less than Phped, so I'm leaning that way. But if
> > there's anything you know that could make my decision
> easier, please
> > forward it on. They seem pretty comparable, with the exception of
> > PhpEd's db browser.
>
> ... have u seen phpEdit? It's for free, has perfect autocompletion,
> project manager, editable templates and many other features. AFAIK it
> has no db browser, but has good developer community around
> ... http://www.phpedit.net
>
>
> --
> Mirek Novak
> jabber:mirek
jabber.cz
> ICQ:119499448
>
> AUTO.CZ
> http://www.auto.cz
>
> NEWS.AUTO.CZ
> http://news.auto.cz
>
> FORMULE1.CZ
> http://www.formule1.cz
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hello, I want to emulate a POST request to Paypal. Originally a POST request is sent from the user (through a form) and the user is redirected to paypal's site. Now, what I want to do is to emulate a POST request (so that the surfer can't see some of the hidden fields of the form) and to deter tampering. (If they could see all the fields, they could just create their own form , and just change the amount).
Possible solution: fsockopen to emulate POST, but that doesn;t redirect the user, using header will direct the user to the paypal site, but then I have to use a GET request and then once again variables are visible and modifiable.
Desired solution: a PHP script (toPaypal.php, say) that is called when a surfer wants to buy something for a product for $5 , say. The Product form will direct to the toPaypal.php script that creates a POST request and sends the request and the surefer to Paypal.
Any ideas? or did I just make this confusing? One solution I guess is to just double check the total amount credited to the merchant account matches the product. But then I ask this question out of curosity.
attached mail follows:
On Monday 06 January 2003 04:20, Richard Baskett wrote: > When using the system() function, let's say starting up a program, can that > program start in the background while the rest of the page is parsed or > does it have to wait until the system command has finished whatever it is > doing?
If you're using linux or similar you can append an ampersand (&) to your command to make it run in the background:
system('mycommand &');
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* The kernel license has expired */
attached mail follows:
Hi, I'm Kathy and just a beginner in php. I'm using the printer_open and printer_draw_text etc. to print a report. It works in my localhost, but when I run it in a remote server, the error message 'couldn't connect to the printer' shown. I think this was caused by no printer was setup in the remote server. Can you suggest how I can print to a local printer with the programs reside in remote server.
attached mail follows:
PHP is server-side. You can't do anything to the client besides give them data. This may be possible with javascript (I don't think so, though), but not with PHP.
Kathy wrote:
> Hi, I'm Kathy and just a beginner in php. I'm using the printer_open and printer_draw_text etc. to print a report. It works in my localhost, but when I run it in a remote server, the error message 'couldn't connect to the printer' shown. I think this was caused by no printer was setup in the remote server. Can you suggest how I can print to a local printer with the programs reside in remote server. > > > > > >
-- 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.
attached mail follows:
On Tuesday 07 January 2003 05:56, Kathy wrote: > Hi, I'm Kathy and just a beginner in php. I'm using the printer_open > and printer_draw_text etc. to print a report. It works in my localhost, but > when I run it in a remote server, the error message 'couldn't connect to > the printer' shown. I think this was caused by no printer was setup in the > remote server. Can you suggest how I can print to a local printer with the > programs reside in remote server.
The php printer commands can only control printers attached to the webserver.
If you want finer control over the printed output than what HTML can provide, then you can consider creating a PDF file instead.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* It is better to live rich than to die rich. -- Samuel Johnson */
attached mail follows:
Hello, I want to emulate a POST request to Paypal. Originally a POST request is sent from the user (through a form) and the user is redirected to paypal's site. Now, what I want to do is to emulate a POST request (so that the surfer can't see some of the hidden fields of the form) and to deter tampering. (If they could see all the fields, they could just create their own form , and just change the amount).
Possible solution: fsockopen to emulate POST, but that doesn;t redirect the user, using header will direct the user to the paypal site, but then I have to use a GET request and then once again variables are visible and modifiable.
Desired solution: a PHP script (toPaypal.php, say) that is called when a surfer wants to buy something for a product for $5 , say. The Product form will direct to the toPaypal.php script that creates a POST request and sends the request and the surefer to Paypal.
Any ideas? or did I just make this confusing? One solution I guess is to just double check the total amount credited to the merchant account matches the product. But then I ask this question out of curosity.
attached mail follows:
Hello, I want to emulate a POST request to Paypal. Originally a POST request is sent from the user (through a form) and the user is redirected to paypal's site. Now, what I want to do is to emulate a POST request (so that the surfer can't see some of the hidden fields of the form) and to deter tampering. (If they could see all the fields, they could just create their own form , and just change the amount).
Possible solution: fsockopen to emulate POST, but that doesn;t redirect the user, using header will direct the user to the paypal site, but then I have to use a GET request and then once again variables are visible and modifiable.
Desired solution: a PHP script (toPaypal.php, say) that is called when a surfer wants to buy something for a product for $5 , say. The Product form will direct to the toPaypal.php script that creates a POST request and sends the request and the surefer to Paypal.
Any ideas? or did I just make this confusing? One solution I guess is to just double check the total amount credited to the merchant account matches the product. But then I ask this question out of curosity.
attached mail follows:
On Monday 06 January 2003 14:01, Bobby Patel wrote: > Hello, I want to emulate a POST request to Paypal. Originally a POST > request is sent from the user (through a form) and the user is redirected > to paypal's site. Now, what I want to do is to emulate a POST request (so > that the surfer can't see some of the hidden fields of the form) and to > deter tampering. (If they could see all the fields, they could just create > their own form , and just change the amount). > > Possible solution: > fsockopen to emulate POST, but that doesn;t redirect the user, using > header will direct the user to the paypal site, but then I have to use a > GET request and then once again variables are visible and modifiable. > > > Desired solution: > a PHP script (toPaypal.php, say) that is called when a surfer wants to buy > something for a product for $5 , say. > The Product form will direct to the toPaypal.php script that creates a POST > request and sends the request and the surefer to Paypal. > > Any ideas? or did I just make this confusing? One solution I guess is to > just double check the total amount credited to the merchant account matches > the product. But then I ask this question out of curosity.
Have a look at curl and snoopy.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Remember, drive defensively! And of course, the best defense is a good offense! */
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Is it posible to change the current uid/gid in a script that is being running
? of course, having the user and password ? like running su.
I'm writting a script that has to perform some operations on the files on the
server, make some directories in the place where the web is and make some
symlinks, the other option, is to make a bash script that would do the work
of making some globaly writeable directories to later let php do the job and
I don't like that option.
Thanks
Carpe diem.
- --
Pupeno: pupeno
pupeno.com
http://www.pupeno.com
- ---
Help the hungry children of Argentina,
please go to (and make it your homepage):
http://www.porloschicos.com/servlet/PorLosChicos?comando=donar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+GSorLr8z5XzmSDQRAn6iAJ96NIQIdVwUqeEpMbSkwAQAEHIfdwCgtfCf eOfVoJXVBd/wzZ0aEwiWEZU= =P6Tf -----END PGP SIGNATURE-----
attached mail follows:
Hi all,
I have a newsletter ready to email to my database of customers.
The entire newsletter incl graphics , layout etc is enclosed within a form which posts to a second page which s supposed to email the desired page..........but it does not work! The code is listed below........
_______________________________________________________
<?php
$dbcnx =
mysql_connect("localhost","", "");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
if (!
mysql_select_db("NameOfDataBase") )
{
echo( "<P>Unable to locate the " . "database at this time.</P>" );
exit();
}
?>
<? // HTML VERSION
$result = mysql_query( "SELECT EmailAddress FROM emailbasketrecipient"); if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); } while ( $row = mysql_fetch_array($result) ) {
$message = " <html> <head> <title>::: Welcome to my Newsletter :::</title> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
</head>
<body> <div align='center'> <table width='750' border='0' cellspacing='0' cellpadding='0' height='162'>
content content etc
</table>
</div> </body> </html>
";
$email = $row["EmailAddress"];
(line 79) $headers .= "From: My site.com<dcurran
powerup.com.au>\n";
$headers .= "X-Sender: <dcurran
powerup.com.au>\n";
$headers .= "X-Mailer: testDC\n";
$headers .= "Return-Path: <dcurran
powerup.com.au>\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$subject = " Club Newsletter";
(line 91) mail($email, $subject , $message, $headers);
$headers = "";
}
echo("$message");
?> _________________________________________________________
and then I get this message each time.........
Warning: Undefined variable: headers in c:\www\cavalier\admin\newsletteremailcommand.php on line 79
Warning: Failed to Connect in c:\www\cavalier\admin\newsletteremailcommand.php on line 91
Any quick and easy tips to get my newsletter happening? Even a new script or easy tutorial in Englsih.
Thanks
DC
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]