php-general Digest 13 Jun 2003 17:39:40 -0000 Issue 2115
Topics (messages 151331 through 151385):
Re: Gettnig PHP code out of a DB?
151331 by: Ignatius Teo
151332 by: Ben Houlton
151333 by: Leif K-Brooks
Re: How do I capture a POST responce
151334 by: Ralph
Re: $_SESSION as $key=>$value
151335 by: Ralph
Re: 4.3.2 -- does connection_status() actually work?
151336 by: Per Jessen
151337 by: Per Jessen
Re: Zend Optimizer not active?
151338 by: Marek Kilimajer
re : ldap problem
151339 by: chandrakant Reddy
Re: How to find if a string is an integer?
151340 by: Ford, Mike [LSS]
151346 by: António Rafael Paiva
Re: make a variable not exist?
151341 by: Ford, Mike [LSS]
Re: POST detection
151342 by: Ford, Mike [LSS]
XML
151343 by: Diana Castillo
PHP Priter Functions
151344 by: Stephen Goddard
Re: General question...
151345 by: Valentin
151382 by: Ralph
Some error
151347 by: Birgir Ţór Halldórsson
Setting Return-Path header for mail() on Linux
151348 by: Tom Woody
regarding <?php ?> tags
151349 by: Ulrik NIelsen
151351 by: PHP4 Emailer
151352 by: Ford, Mike [LSS]
151356 by: Ulrik NIelsen
151363 by: Wim Paulussen
Re: mail() function & exchange
151350 by: Manuel Lemos
PHP crashes when using gd with true type fonts.
151353 by: Branko F. Gračnar
slow mail()
151354 by: Marko
151355 by: Miles Thompson
dealiong with quote's in SQL strings
151357 by: Petre Agenbag
151358 by: Awlad Hussain
151359 by: Petre Agenbag
151360 by: CPT John W. Holmes
151362 by: Petre Agenbag
151365 by: Marek Kilimajer
fgets() problem
151361 by: Armand Turpel
151366 by: Marek Kilimajer
Variable variables question?
151364 by: Douglas Douglas
shopping cart and login system
151367 by: electroteque
Access violation for an EXE file
151368 by: Ferhat BINGOL
151369 by: Ferhat BINGOL
Redirects in PHP
151370 by: Carl Furst
151372 by: Wendell Brown
151374 by: Johnny Martinez
151375 by: chris sherwood
151376 by: Michael
151377 by: Kevin Stone
151378 by: Zak Johnson
151379 by: Wendell Brown
151380 by: Kevin Stone
151381 by: DvDmanDT
151383 by: Michael
151384 by: Zak Johnson
151385 by: Michael
failed to delete buffer default output handler
151371 by: Shawn McKenzie
It´s a test!!
151373 by: Felipe Desiderati
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 ---
----- Original Message -----
From: "Ben Houlton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 13, 2003 2:49 PM
Subject: [PHP] Gettnig PHP code out of a DB?
Er...you need to eval() it to get it to parse/run.
> Is there a way to get PHP script/code out of a DB? Becasue, when I
enter PHP
> code into the textbox and hit submit, and go check the page it has
nothing
> there with <?php xxxxxxx ?> and just shows the code, e.g.
> include("menu.php"); without the <? ?> tags, the code I'm using to
import
> the DB text is below:
>
> } elseif ($id == $row["id"] && $cat == $row["cat"] &&
$row["xtra"] ==
> php) {
>
> $msg = $row["msg"];
>
> $msg;
>
> }
>
> Thank you for your time!
> -Ben
>
> (Note: My post didn't come up before, if it does, sorry for double
posting)
>
--- End Message ---
--- Begin Message ---
I use
echo $msg;
eval("\$msg = \"$msg\";");
echo $msg;
and it comes up with
include("menu.php");
on the live page
"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> www.php.net/eval
>
> Ben Houlton wrote:
>
> >Is there a way to get PHP script/code out of a DB? Becasue, when I enter
PHP
> >code into the textbox and hit submit, and go check the page it has
nothing
> >there with <?php xxxxxxx ?> and just shows the code, e.g.
> >include("menu.php"); without the <? ?> tags, the code I'm using to import
> >the DB text is below:
> >
> > } elseif ($id == $row["id"] && $cat == $row["cat"] && $row["xtra"]
==
> >php) {
> >
> > $msg = $row["msg"];
> >
> > $msg;
> >
> > }
> >
> >Thank you for your time!
> >-Ben
> >
> >(Note: My post didn't come up before, if it does, sorry for double
posting)
> >
> >
> >
>
> --
> 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.
>
>
--- End Message ---
--- Begin Message ---
*sigh* Just do:
eval($msg);
Ben Houlton wrote:
I use
echo $msg;
eval("\$msg = \"$msg\";");
echo $msg;
and it comes up with
include("menu.php");
on the live page
"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
www.php.net/eval
Ben Houlton wrote:
Is there a way to get PHP script/code out of a DB? Becasue, when I enter
PHP
code into the textbox and hit submit, and go check the page it has
nothing
there with <?php xxxxxxx ?> and just shows the code, e.g.
include("menu.php"); without the <? ?> tags, the code I'm using to import
the DB text is below:
} elseif ($id == $row["id"] && $cat == $row["cat"] && $row["xtra"]
==
php) {
$msg = $row["msg"];
$msg;
}
Thank you for your time!
-Ben
(Note: My post didn't come up before, if it does, sorry for double
posting)
--
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.
--
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.
--- End Message ---
--- Begin Message ---
You have to use socket connection. Take a look at:
http://us4.php.net/fsockopen
In the User Contributed Notes look for a post by
info at agriya dot com
02-Feb-2003 12:38
there you will see a script that shows you how to do it.
Hope this helps.
-----Original Message-----
From: Joaco [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 3:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How do I capture a POST responce
I am writing a module that will allow a customer to process a credit
card
refund thru a web interface that I am designing. The problem I am having
is
that once the information is posted to the gateway, it returns a url
encoded
string with the responce from the transaction. How can I capture that
responce on my page rather than having to open or save the returned
file?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Daniel,
Rather than sending them to a new page to validate the form and then
sending them back if a field is invalid, do the error checking from the
same script.
Here's an example, a bit simple but just to give you an idea.
For a better explanation, you should read this article which elaborates
on this method:
http://www.zend.com/zend/spotlight/form-pro-php4.php
<?php
if($HTTP_POST_VARS){
// check for required fields
if(!HTTP_POST_VARS['name'] || !HTTP_POST_VARS['email'])
$error_message = 'You did not provide all required fields'
}
// any other error checking you want to do
....
?>
<?php
// if error, print out error message
if($error_message){
echo $error_message;
}
?>
<FORM METHOD="post" ACTION="<?php echo $PHP_SELF ?>">
<INPUT TYPE="text" NAME="name" SIZE="20" VALUE="<?php echo
$HTTP_POST_VARS['name'] ?>">
<INPUT TYPE="text" NAME="email" SIZE="20" VALUE="<?php echo
$HTTP_POST_VARS['email'] ?>">
and so on....
<INPUT TYPE="submit" NAME="process_form" VALUE="Submit">
-----Original Message-----
From: Daniel J. Rychlik [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 2:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] $_SESSION as $key=>$value
Is this valid to iterate over a form variables.?
foreach ($_SESSION as $key=>$value)
and another question, do I need this <form action="scripts/process.php"
method="post"> in my form?
Im really struggling with $_SESSION. Im trying to program smarter and
make friendlier applications.
Ive submitted several emails dealing with this function and I apologize
for beating a dead horse, so to speak.
I have a form with a few form fields. Im working on an error function
that will take the data that was entered and pass it back to the form so
that the user will not have to input the data again. If an error is
found I use the header function to go back to the form. Im having
trouble with passing back the data. Do I in my form setup a $_GET or
should I use the $_SESSION to call it. I am also going to setup a few
css styles that highlight which field was found in error.
Again, I apologize for my lack of vision and maybe a spark of light will
go off, and I will be able to make some connections to get this done.
Dan
--- End Message ---
--- Begin Message ---
Rasmus Lerdorf wrote:
> What does it do? Using connection_status() in a script that doesn't
> ignore user aborts is pretty useless.
Regardless of whether I use ignore(0) or ignore(1), the script keeps going
after the user has hit stop. The apache error-log is then full of:
(32)Broken pipe: core_output_filter: writing data to the network
> The script will abort on the print
> and never get to the connection_status() line so your code doesn't
> actually make any sense.
OK, that's good to know too :-)
> And, beyond that, all bets are off for
> Apache-2.0.x. No real extensive testing has been done on that platform
> which is why we don't suggest running it in production because stuff like
> this is likely to be broken even if you got your code right.
Fair enough - this isn't production as such - I thought it might be worth
asking. What are the plans, if any, regarding apache 2.0.x and php?
For my purposes, I would be perfectly happy if my php script would stop
running once the client has disconnected.
/Per
--
Per Jessen, Zurich
http://timian.jessen.ch - an analog report formatter using XSLT.
http://www.dansk.org - for alle danskere i udlandet!
--- End Message ---
--- Begin Message ---
Jeff Harris wrote:
> I'm just guessing here, because you didn't give us the desired result,
> but how about:
> if (connection_status() ) break;
Yeah, that would do about the same.
The expected result is for the script to stop running once the client
disconnects.
/Per
--
Per Jessen, Zurich
http://timian.jessen.ch - an analog report formatter using XSLT.
http://www.dansk.org - for alle danskere i udlandet!
--- End Message ---
--- Begin Message ---
Are the logs saying anything? Or if you run php from command line?
Steve Yates wrote:
Starting with a working site (FreeBSD 4.7, Apache 1.3.27) using PHP 4.3.0
and the latest Zend Optimizer, I upraded to PHP 4.3.2. Afterwards, phpinfo
() did not show the Optimizer as loaded. Reinstalling Optimizer did not
change this, nor did uninstalling and reinstalling Optimizer. There were
no errors during the Optimizer install, and everything looks like it's
correct to me...the two lines are in php.ini, and they point to the right
ZendOptimizer.so file. There is only one php.ini on the system. Any
hints?
Thanks,
- Steve Yates
- Termite in pub: "Is the bar tender here?"
~ Taglines by Taglinator - www.srtware.com ~
--- End Message ---
--- Begin Message ---
Hi
The proto type is not correct.
array ldap_get_values(link_identifier ,
result_entry_identifier, string attribute);
^
try this
1) connect
2) bind
3) search
4) get_entries // this the step you are missing
5) get_values
regards
CVR
Can anyone tell me what is wrong with this simple
> code? It errors with
> the ldap_get_values and says: "supplied resource is
> not a valid ldap
> result entry resource"
>
> I am very new at PHP LDAP so pardon my error...
>
> <?
> //include "inc/connect.inc.php";
> $ds = ldap_connect("localhost");
> $base = "ou=people,dc=cwalk,dc=org";
> $filter = "(&(givenname=$givenName*)(sn=$sn*))";
> $search = ldap_list($ds, $base, $filter);
> $mail = "mail";
> $attrs = ldap_get_values($ds, $search, $mail);
> ?>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Alex Earl [mailto:[EMAIL PROTECTED]
> Sent: 12 June 2003 21:13
>
> > Jumping in a little late here, but what about is_numeric()?
> > Haven't tried it, but the php manual for is_int says:
> > Note: To test if a variable is a number or a numeric
> string (such as
> > form input, which is always a string), you must use is_numeric().
> >
>
> The problem with is_numeric() is that something like "4e4" comes up as
> true, because it could be construed as a HEX value.
Just a little nitpick here, but 4e4 is not hex but scientific notation
representing 40,000. 0x4e4 would be a hex value representing, ooooh, a
little over 1200 at a rough guess.
I'm pretty sure both of these have been suggested, but personally I'd go for
either a pattern match or something like:
if ((string)($value+0)===$value)
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
Why don't you write your own test function since it's
getting so hard to find one. All you have to do is check
if the string only has number characters.
I would say this is a simple task!
Good luck,
Rafael
On Thu, 12 Jun 2003 13:13:28 -0700 (MST)
"Alex Earl" <[EMAIL PROTECTED]> wrote:
> Jumping in a little late here, but what about
>is_numeric()?
> Haven't tried it, but the php manual for is_int says:
> Note: To test if a variable is a number or a numeric
>string (such as
> form input, which is always a string), you must use
>is_numeric().
>
The problem with is_numeric() is that something like
"4e4" comes up as
true, because it could be construed as a HEX value.
Alex
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
----------------------------------------------------
António Rafael C. Paiva
Electronics and Telecommunications Dep.
Aveiro University
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Amanda McComb [mailto:[EMAIL PROTECTED]
> Sent: 12 June 2003 22:21
>
> Is there a way to make a variable not exist? There are several places
> where I test (!$variable), and I want to be able to change the
> variable to pass that test, even though it exists, under certain
> circumstances.
Well, the following values will all cause that test to succeed:
0
0.0
''
'0'
array()
FALSE
NULL
so take your pick!
Personally, I tend to use NULL in this situation, because it fails isset(),
is detectable with is_null(), and, crucially, doesn't generate a notice on
doing if($variable).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Johnny Martinez [mailto:[EMAIL PROTECTED]
> Sent: 13 June 2003 00:49
>
> Will this work for $_GET as well?
Yup.
> -----Original Message-----
> From: Jason Wong [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 12, 2003 2:14 PM
>
> if ($_POST) { do_something_with_post(); }
>
> or
>
> if (!empty($_POST)) { do_something_with_post(); }
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
does anyone know if there are any advantages/disadvantages as far as
performance to using one of the following methods for gettting xml
responses?
1) get
2)normal post with php
3)curl
--- End Message ---
--- Begin Message ---
Hi,
Has anyone managed to get the php printer functions to work on a network
printer. My code is connecting to the printer but .....
Warning: couldn't allocate new print job in
c:\inetpub\wwwroot\phpprinter\print2.php on line 32
test.bmp
Warning: couldn't start a new page in
c:\inetpub\wwwroot\phpprinter\print2.php on line 80
Warning: couldn't end the page in c:\inetpub\wwwroot\phpprinter\print2.php
on line 84
Fatal error: couldn't terminate print job in
c:\inetpub\wwwroot\phpprinter\print2.php on line 121
The same code works on a local printer, so I know the code is ok.
<?
set_time_limit(9000000000000);
$printerhandle = @printer_open("\\\\phill\RICOHCOL");
printer_set_option($printerhandle, PRINTER_MOD, "EMF");
printer_start_doc($printerhandle, "Image Print");
$filename = "test.bmp";
printer_start_page($printerhandle);
printer_draw_bmp($printerhandle, $filename, 1, 1);
printer_end_page($printerhandle);
closedir($handle);
printer_end_doc($printerhandle);
printer_close($printerhandle);
?>
Cheers....
--- End Message ---
--- Begin Message ---
Thanks Bobby!
--- End Message ---
--- Begin Message ---
Read the following:
http://us2.php.net/fsockopen
http://www.zend.com/manual/ref.stream.php
-----Original Message-----
From: Jason Paschal [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 8:48 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] General question...
ppl, you're missing the point. you keep re-stating his problem. he
knows
it's not good to make the 3rd party gateway so obvious. he's looking
for a
way to make it transparent, so it looks like it's actually part of his
site.
i think there should be a way to do it. maybe use the fsock stuff to
pass
the data (security is an issue, and i'm not familiar with the fsock
functions much less how they'd be affected if you in a secure section of
your site).
good luck.
>From: "Valentin" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [PHP] General question...
>Date: Thu, 12 Jun 2003 15:53:39 +0200
>
>hi all,
>
>is it possible with php:
>first to pass request to another URL and after that to get the html
>responce
>as a string and put it into php $variable?
>
>best,
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I have an error in a PHP script I’m working with.
Here is information about my PHP: http://kalk.snerpa.is/test.php
The error describes like this: After the size of the page that the
script is writing reaches 16 KB it just stop process.
Do somone out there know what the problem could be?
Best regards,
Birgir Ţór Halldórsson
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Is it possible to change the Return-Path header in PHP on linux? I have
seen all the posts about setting it in the php.ini with the -f switch to
sendmail. But I need to set it based on the person logged into the
page? Right now the Return-Path is set to a default that gets sent to
me (the administrator).
I have a group of about 20 users who log into the webpage, and send
email messages. If any of the messages bounce, those users don't know
about it until I sift through the postmaster mailbox and let them know
(that is unless the remote mail server is nice and send the bounce to
the From: or Reply-To:). Changing the Return-Path would solve this for
everyone. Any thoughts ideas, or am i just out of luck?
--
Tom
In a world without boundaries why
do we need Gates and Windows?
--- End Message ---
--- Begin Message ---
Hi NG,
Does any og you know why it's not possible to use the syntax:
<?php=$something?>
when you can use this:
<?=$something?>
it would be a nice feature when mixing xml and php ...
--
>> ulrik - ulrik(@)lazy.dk
excuse of the day : Domain controller not responding
from bofh : http://www.cs.wisc.edu/~ballard/bofh/
--- End Message ---
--- Begin Message ---
My understanding of this (am still a newbie though) is that the
<?=$variable?> is a short tag that assignes the $variable directly to a
"print/echo" command. You can use the other way by just adding <?php print
$variable; ?>
Hope this helps.
-----Original Message-----
From: Ulrik NIelsen [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 7:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regarding <?php ?> tags
Hi NG,
Does any og you know why it's not possible to use the syntax:
<?php=$something?>
when you can use this:
<?=$something?>
it would be a nice feature when mixing xml and php ...
--
>> ulrik - ulrik(@)lazy.dk
excuse of the day : Domain controller not responding
from bofh : http://www.cs.wisc.edu/~ballard/bofh/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ulrik NIelsen [mailto:[EMAIL PROTECTED]
> Sent: 13 June 2003 13:25
>
> Does any og you know why it's not possible to use the syntax:
>
> <?php=$something?>
>
> when you can use this:
>
> <?=$something?>
This has been discussed more than once by the PHP developers, and the decision has
always been not to adopt it. I think you can safely file it in the "Won't Fix"
category (there may even be a Feature Request at bugs.php.net marked as such).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
Mike Ford wrote:
This has been discussed more than once by the PHP developers, and the
decision has always been not to adopt it. I think you can safely
file it in the "Won't Fix" category (there may even be a Feature
Request at bugs.php.net marked as such).
bugger ;) I would have loved this feature....
--
ulrik - ulrik(@)lazy.dk
excuse of the day : Domain controller not responding
from bofh : http://www.cs.wisc.edu/~ballard/bofh/
--- End Message ---
--- Begin Message ---
extract from php.ini file
<<
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On
; Allow ASP-style <% %> tags.
asp_tags = Off
>>
Hope this helps
YT
-----Oorspronkelijk bericht-----
Van: Ulrik NIelsen [mailto:[EMAIL PROTECTED]
Verzonden: Friday, June 13, 2003 3:39 PM
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] regarding <?php ?> tags
Mike Ford wrote:
>
> This has been discussed more than once by the PHP developers, and the
> decision has always been not to adopt it. I think you can safely
> file it in the "Won't Fix" category (there may even be a Feature
> Request at bugs.php.net marked as such).
bugger ;) I would have loved this feature....
--
>> ulrik - ulrik(@)lazy.dk
excuse of the day : Domain controller not responding
from bofh : http://www.cs.wisc.edu/~ballard/bofh/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello,
On 06/12/2003 02:32 PM, Diana wrote:
I totally agree with your first sentence *grin*.
Anyways, I won`t be able to use your class because my
server is kind of "locked" in their network, meaning I
don`t have the possibility to connect outside, only to
their servers (NT servers). And as Exchange servers
don`t use SMTP (meaning the whole protocol is NOT
used, so your classes won`t help me), I`m not able to
send mails at all. Only like he offered me to put an
extra box in the network which will relay the mails
from my linux server.
That will do.
Does anyone know about the way exchange servers work,
mapi and mapisend? The only thing I found was how to
program that in VB (and being able to talk to Exchange
servers), but it seems like this is not possible for
my penguin :) (VB on Linux??? sounds stupid)
No, that will not work on Linux because you do not have COM object
support, which is a Windows thing.
--
Regards,
Manuel Lemos
just today I stumbled into the same problem. It is
true, I got this answer from an expert:
"Unfortunately this will not work. SMTP relaying
is
disabled on all the
Exchange connector servers and a standard Exchange
mailbox server does
not
support SMTP. The only way that you can send SMTP
email from within
our company is to use the Internal MailSweeper.
And
to allow this we need
the IP
Address of the box that will be sending the
messages
so that we can
include
it in the authenticated list. We have to have
things
set up this way
for
Security reasons.
One other thing I should have mentioned. Outlook
uses
mapi to send on
the
Exchange servers. So we can use the mapisend
command
but I do not know
if
your application would support this. I think that
this may also need a
valid Outlook profile to work."
I don`t understand that either, because I am
trying to
use my Linux server (inside my companys network)
to
deliver mails to the exchange server via sendmail.
If anyone knows more about this topic, let me
know.....sorry that this obviously does not belong
to
a php list, but I deleted the original email &
could
not find the email address of the author of this
topic
:(
I wonder about his expertise. Authentication was
meant for security reasons.
Anyway, you do no not need to relay in the company
SMTP server unless
outside access is blocked in some firewall.
If you are using Linux, you just need to use the
mail() function because
it just uses sendmail by default.
If you still have problems, just use the classes
that I mentioned
enabling direct delivery mode in the SMTP sending
attributes. That does
the same as sendmail but at least if it fails you
can enable debugging
to see what the SMTP protocol dialog reveals.
--- Manuel Lemos <[EMAIL PROTECTED]> schrieb: >
Hello,
On 06/10/2003 04:44 PM, Matthias Wulkow wrote:
a friend of mine is trying to set up an automated
mailing function.
The platform is Windows & he's using the last PHP
release at this
time.
He asks me how to do it with Exchange, because it
doesn't speak SMTP
or not correctly? What is the matter? Is that
true? But that's not
really the question... could somebody point me to
some documents where
I could find out, what has to be done to make it
work?
I do not see what he means by not speaking SMTP
correctly. Anyway, if it
receives e-mail that you get, it also can relay
messages that you send.
I think in the worst case you need to
authenticate.
In that case you may want to try this class for
composing and sending
messages. It comes with a sub class for sending
messages via SMTP that
supports authentication.
http://www.phpclasses.org/mimemessage
You also need this class for the actual message
delivery:
http://www.phpclasses.org/smtpclass
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
Check out the following code:
<?php
$image_file = "images/test.gif";
$font_file = dirname(__FILE__) . "/" . "fonts/timesbd.ttf";
$str = "You must be kidding :)";
$red = 0;
$blue = 0;
$green = 0;
$img = imagecreatefromgif("images/test.gif");
$color = imagecolorallocate($img, $red, $blue, $green);
# use TTF
imagettftext($img, 20, -20, 20, 40, $color, $font_file, $str);
/*
int imagestring ( resource image, int font, int x, int y, string s, int col)
*/
# don't use ttf
# imagestring($img, 5, 0, 0, $str, $color);
header("Content-Type: image/gif");
imagegif($img);
imagedestroy($img);
?>
When i use imagettftext() i httpd child process always crashes with signal 11
and in 20% requests it doesn't serve the image.
If i use imagestring() everything works okay, with no crashes at all..
Any ideas?
system: freebsd 5.1 release
httpd: apache 2.0.46
php: 4.3.2
freetype: 2.1.4
gd: 2.0.11
Ideas? I REALLY need TTF support in php.
Brane
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)
iD8DBQE+6ch/Upzh9iszIGARArHIAJ0fcp43LHVuV7v/DhNJT2RG7JSXmwCfd4g+
2N8dUxLepFMCZR5/QyDWcMw=
=Rjox
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Hi all,
Sending multiple emails using PHP - as BCC or multiple mail() commands -
takes quite long; usually over 50 seconds for 10 addresses.
While sending these messages the browser won't show anything else but a
blank page, which is not a very exciting internetexperience for people using
my mailing-application.
I've been using exactly the same code on some other boxes without any
extreme delays.
The box is running Sendmail 8.12.9, PHP 4.3.1 on FreeBSD 4.8.
Any help greatly appreciated!
The maillog says:
Jun 12 19:25:20 pippi sendmail[95211]: h5CHPKZu095211: from=nobody,
size=56, class=0, nrcpts=1,
msgid=<[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Jun 12 19:25:30 pippi sendmail[95212]: h5CHPP6h095212:
from=<[EMAIL PROTECTED]>, size=293, class=0, nrcpts=1,
msgid=<[EMAIL PROTECTED]>, proto=ESMTP, daemon=MTA,
relay=localhost [127.0.0.1]
Jun 12 19:25:30 pippi sendmail[95212]: h5CHPP6h095212: to=<[EMAIL PROTECTED]>,
delay=00:00:00, mailer=esmtp, pri=30289, stat=queued
Jun 12 19:25:30 pippi sendmail[95211]: h5CHPKZu095211: [EMAIL PROTECTED],
ctladdr=nobody (65534/65534), delay=00:00:10, xdelay=00:00:10, mailer=relay,
pri=30052, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent
(h5CHPP6h095212 Message accepted for delivery)
--- End Message ---
--- Begin Message ---
Are you sending these in a loop?
Write out something as each mail is sent, the email address is useful, plus
an OK or FAIL depending on what mail() returned.
Also, don't enclose this in a table as on some browsers nothing will
display until the closing table tag is received.
You might also investigate flush() (I think) .
HTH -Miles Thompson
At 03:19 PM 6/13/2003 +0200, you wrote:
Hi all,
Sending multiple emails using PHP - as BCC or multiple mail() commands -
takes quite long; usually over 50 seconds for 10 addresses.
While sending these messages the browser won't show anything else but a
blank page, which is not a very exciting internetexperience for people using
my mailing-application.
I've been using exactly the same code on some other boxes without any
extreme delays.
The box is running Sendmail 8.12.9, PHP 4.3.1 on FreeBSD 4.8.
Any help greatly appreciated!
The maillog says:
Jun 12 19:25:20 pippi sendmail[95211]: h5CHPKZu095211: from=nobody,
size=56, class=0, nrcpts=1,
msgid=<[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Jun 12 19:25:30 pippi sendmail[95212]: h5CHPP6h095212:
from=<[EMAIL PROTECTED]>, size=293, class=0, nrcpts=1,
msgid=<[EMAIL PROTECTED]>, proto=ESMTP, daemon=MTA,
relay=localhost [127.0.0.1]
Jun 12 19:25:30 pippi sendmail[95212]: h5CHPP6h095212: to=<[EMAIL PROTECTED]>,
delay=00:00:00, mailer=esmtp, pri=30289, stat=queued
Jun 12 19:25:30 pippi sendmail[95211]: h5CHPKZu095211: [EMAIL PROTECTED],
ctladdr=nobody (65534/65534), delay=00:00:10, xdelay=00:00:10, mailer=relay,
pri=30052, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent
(h5CHPP6h095212 Message accepted for delivery)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi List
I recently installed 4.3.1 and enabled the magic_quotes_gpc to deal with
quotes in mysql inserts.
However, I think I have run into a problem that might be related, and
was wondering if there is an easy way to fix it:
I have a script that gets user input from a drop-down, on the action
page I search a mysql table for the row matching the selection made
previously. What I do then is to extract the result of that "select *
from table where data = form_selection" and then to re-insert the data
into the table ; note, re-insert, NOT UPDATE ( the app cals for a new
row to be added with the updated data, so the "old" row stays intact and
a new row is added that contains some of the old row's data plus some
new stuff I add).
So, the new insert sql looks as per usual
insert into table (`var1`,`var2`,`var3`,`var4`,...) values
('$var1','$var2',....);
where $var1, $var2 etc is either "inherited" from the extract of the
first querie's result set, or overwritten with my newly generated
values. The problem now comes in with this:
If one or more of the extracted variables containes something like
" O'Healy " or something similar that causes trouble with the quotes in
the new INSERT sql, well, you see the problem...
And I don't want to have to go and addslashes to all my extracted
variables, because there really are a whole heap of them.
So, is there another php.ini setting that I'm missing to help me with
this, or maybe a function that will addslashes to all my extracted vars?
I'm lazy, shoot me!
--- End Message ---
--- Begin Message ---
addslashes
(PHP 3, PHP 4 )
addslashes -- Quote string with slashes
Description
string addslashes ( string str)
Returns a string with backslashes before characters that need to be quoted
in database queries etc. These characters are single quote ('), double quote
("), backslash (\) and NUL (the NULL byte).
----- Original Message -----
From: "Petre Agenbag" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 13, 2003 2:43 PM
Subject: [PHP] dealiong with quote's in SQL strings
> Hi List
>
> I recently installed 4.3.1 and enabled the magic_quotes_gpc to deal with
> quotes in mysql inserts.
>
> However, I think I have run into a problem that might be related, and
> was wondering if there is an easy way to fix it:
>
> I have a script that gets user input from a drop-down, on the action
> page I search a mysql table for the row matching the selection made
> previously. What I do then is to extract the result of that "select *
> from table where data = form_selection" and then to re-insert the data
> into the table ; note, re-insert, NOT UPDATE ( the app cals for a new
> row to be added with the updated data, so the "old" row stays intact and
> a new row is added that contains some of the old row's data plus some
> new stuff I add).
>
> So, the new insert sql looks as per usual
>
> insert into table (`var1`,`var2`,`var3`,`var4`,...) values
> ('$var1','$var2',....);
>
> where $var1, $var2 etc is either "inherited" from the extract of the
> first querie's result set, or overwritten with my newly generated
> values. The problem now comes in with this:
>
> If one or more of the extracted variables containes something like
> " O'Healy " or something similar that causes trouble with the quotes in
> the new INSERT sql, well, you see the problem...
>
> And I don't want to have to go and addslashes to all my extracted
> variables, because there really are a whole heap of them.
>
> So, is there another php.ini setting that I'm missing to help me with
> this, or maybe a function that will addslashes to all my extracted vars?
>
> I'm lazy, shoot me!
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi Awlad
Yes, I know addslashes(), but that's the point, I would rather NOT want
to go and have to use addslashes() to all my extracted vars as there are
almost a hundred vars, and I douldn't want to go and have to add
addslashes($var1), addlsashes($var2), ....., addslashes($var100) UNLESS
it is the unanimous feeling of the list that there is no other way (
BTW, the app worked fine on PHP 4.0.4, hence my suspicion that there
might be a php.ini setting I missed when upgrading to 4.3.1)
On Fri, 2003-06-13 at 15:46, Awlad Hussain wrote:
> addslashes
> (PHP 3, PHP 4 )
>
> addslashes -- Quote string with slashes
> Description
> string addslashes ( string str)
>
>
> Returns a string with backslashes before characters that need to be quoted
> in database queries etc. These characters are single quote ('), double quote
> ("), backslash (\) and NUL (the NULL byte).
>
> ----- Original Message -----
> From: "Petre Agenbag" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 13, 2003 2:43 PM
> Subject: [PHP] dealiong with quote's in SQL strings
>
>
> > Hi List
> >
> > I recently installed 4.3.1 and enabled the magic_quotes_gpc to deal with
> > quotes in mysql inserts.
> >
> > However, I think I have run into a problem that might be related, and
> > was wondering if there is an easy way to fix it:
> >
> > I have a script that gets user input from a drop-down, on the action
> > page I search a mysql table for the row matching the selection made
> > previously. What I do then is to extract the result of that "select *
> > from table where data = form_selection" and then to re-insert the data
> > into the table ; note, re-insert, NOT UPDATE ( the app cals for a new
> > row to be added with the updated data, so the "old" row stays intact and
> > a new row is added that contains some of the old row's data plus some
> > new stuff I add).
> >
> > So, the new insert sql looks as per usual
> >
> > insert into table (`var1`,`var2`,`var3`,`var4`,...) values
> > ('$var1','$var2',....);
> >
> > where $var1, $var2 etc is either "inherited" from the extract of the
> > first querie's result set, or overwritten with my newly generated
> > values. The problem now comes in with this:
> >
> > If one or more of the extracted variables containes something like
> > " O'Healy " or something similar that causes trouble with the quotes in
> > the new INSERT sql, well, you see the problem...
> >
> > And I don't want to have to go and addslashes to all my extracted
> > variables, because there really are a whole heap of them.
> >
> > So, is there another php.ini setting that I'm missing to help me with
> > this, or maybe a function that will addslashes to all my extracted vars?
> >
> > I'm lazy, shoot me!
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
> I recently installed 4.3.1 and enabled the magic_quotes_gpc to deal with
> quotes in mysql inserts.
>
> However, I think I have run into a problem that might be related, and
> was wondering if there is an easy way to fix it:
>
> I have a script that gets user input from a drop-down, on the action
> page I search a mysql table for the row matching the selection made
> previously. What I do then is to extract the result of that "select *
> from table where data = form_selection" and then to re-insert the data
> into the table ; note, re-insert, NOT UPDATE ( the app cals for a new
> row to be added with the updated data, so the "old" row stays intact and
> a new row is added that contains some of the old row's data plus some
> new stuff I add).
>
> So, the new insert sql looks as per usual
>
> insert into table (`var1`,`var2`,`var3`,`var4`,...) values
> ('$var1','$var2',....);
>
> where $var1, $var2 etc is either "inherited" from the extract of the
> first querie's result set, or overwritten with my newly generated
> values. The problem now comes in with this:
>
> If one or more of the extracted variables containes something like
> " O'Healy " or something similar that causes trouble with the quotes in
> the new INSERT sql, well, you see the problem...
>
> And I don't want to have to go and addslashes to all my extracted
> variables, because there really are a whole heap of them.
>
> So, is there another php.ini setting that I'm missing to help me with
> this, or maybe a function that will addslashes to all my extracted vars?
magic_quotes_runtime in php.ini
---John Holmes...
--- End Message ---
--- Begin Message ---
Thanks, it was there right infront of me...
Just as a matter of interest, are there security/performance issues with
this setting as well as the magic_quotes_gpc or other oddities that it
could cause?
On Fri, 2003-06-13 at 15:54, CPT John W. Holmes wrote:
> > I recently installed 4.3.1 and enabled the magic_quotes_gpc to deal with
> > quotes in mysql inserts.
> >
> > However, I think I have run into a problem that might be related, and
> > was wondering if there is an easy way to fix it:
> >
> > I have a script that gets user input from a drop-down, on the action
> > page I search a mysql table for the row matching the selection made
> > previously. What I do then is to extract the result of that "select *
> > from table where data = form_selection" and then to re-insert the data
> > into the table ; note, re-insert, NOT UPDATE ( the app cals for a new
> > row to be added with the updated data, so the "old" row stays intact and
> > a new row is added that contains some of the old row's data plus some
> > new stuff I add).
> >
> > So, the new insert sql looks as per usual
> >
> > insert into table (`var1`,`var2`,`var3`,`var4`,...) values
> > ('$var1','$var2',....);
> >
> > where $var1, $var2 etc is either "inherited" from the extract of the
> > first querie's result set, or overwritten with my newly generated
> > values. The problem now comes in with this:
> >
> > If one or more of the extracted variables containes something like
> > " O'Healy " or something similar that causes trouble with the quotes in
> > the new INSERT sql, well, you see the problem...
> >
> > And I don't want to have to go and addslashes to all my extracted
> > variables, because there really are a whole heap of them.
> >
> > So, is there another php.ini setting that I'm missing to help me with
> > this, or maybe a function that will addslashes to all my extracted vars?
>
> magic_quotes_runtime in php.ini
>
> ---John Holmes...
--- End Message ---
--- Begin Message ---
Yes, there is a performance hit. And the oddity is (if set globaly in
php.ini) you have to stripslashes() everything you want to echo to the
browser. So I would recomend you to ini_set() magic_quotes_runtime on
right before this process and then turn it off.
Petre Agenbag wrote:
Thanks, it was there right infront of me...
Just as a matter of interest, are there security/performance issues with
this setting as well as the magic_quotes_gpc or other oddities that it
could cause?
On Fri, 2003-06-13 at 15:54, CPT John W. Holmes wrote:
I recently installed 4.3.1 and enabled the magic_quotes_gpc to deal with
quotes in mysql inserts.
However, I think I have run into a problem that might be related, and
was wondering if there is an easy way to fix it:
I have a script that gets user input from a drop-down, on the action
page I search a mysql table for the row matching the selection made
previously. What I do then is to extract the result of that "select *
from table where data = form_selection" and then to re-insert the data
into the table ; note, re-insert, NOT UPDATE ( the app cals for a new
row to be added with the updated data, so the "old" row stays intact and
a new row is added that contains some of the old row's data plus some
new stuff I add).
So, the new insert sql looks as per usual
insert into table (`var1`,`var2`,`var3`,`var4`,...) values
('$var1','$var2',....);
where $var1, $var2 etc is either "inherited" from the extract of the
first querie's result set, or overwritten with my newly generated
values. The problem now comes in with this:
If one or more of the extracted variables containes something like
" O'Healy " or something similar that causes trouble with the quotes in
the new INSERT sql, well, you see the problem...
And I don't want to have to go and addslashes to all my extracted
variables, because there really are a whole heap of them.
So, is there another php.ini setting that I'm missing to help me with
this, or maybe a function that will addslashes to all my extracted vars?
magic_quotes_runtime in php.ini
---John Holmes...
--- End Message ---
--- Begin Message ---
It seems that some php versions have difficulties with the fgets() function.
On php 4.3.2 it works fine, but other versions report warnings.
fgets($f);
Warning: Wrong parameter count for fgets() in
/var/www/Xprotector/include/base.inc.php on line 70
If I change fgets to
fgets($f, 4096);
it woks.
Any idea why?
--- End Message ---
--- Begin Message ---
From the manual:
Note: The length parameter became optional in PHP 4.2.0, if omitted, it
would assume 1024 as the line length. As of PHP 4.3, omitting length
will keep reading from the stream until it reaches the end of the line.
If the majority of the lines in the file are all larger than 8KB, it is
more resource efficient for your script to specify the maximum line length.
Armand Turpel wrote:
It seems that some php versions have difficulties with the fgets() function.
On php 4.3.2 it works fine, but other versions report warnings.
fgets($f);
Warning: Wrong parameter count for fgets() in
/var/www/Xprotector/include/base.inc.php on line 70
If I change fgets to
fgets($f, 4096);
it woks.
Any idea why?
--- End Message ---
--- Begin Message ---
Hello everybody.
I have the following class method:
function HTTPValidator($method)
{
$this->data = ${'_'.$method};
$this->rules = array();
$this->required = array();
}
data, rules and required are arrays. The parameter
$method can have the values: GET or POST. I'm trying
to store the superglobal array in the data class
property.
To get the superglobal array ($_GET or $_POST), I try
to build these strings '_'.$method. I'm sure this part
works, PHP builds the string _GET or _POST according
to the $method parameter.
I use ${'_'.$method} to get the contents of the
superglobal. But this piece of code doesn't work. It
seems like PHP doesn't build the $_GET or $_POST
string.
Funny thing, I tried the same code on another script
and worked. Here's that script:
<?php
echo '<pre>';
print_r($_POST);
echo '</pre><br><br>';
$method = 'POST';
$data = ${'_'.$method};
echo '<pre>';
print_r($data);
echo '</pre><br><br>';
?>
(I even tried to send the $method parameter as '_GET'
and '_POST', and didn't work either).
I'm very confused. Thanks for any help.
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---
hi there , i am about to build a shopping cart which will interact with a
paypal payment system , the cart will use sessions to store the items and
basket information before checking out and posting to the paypal form , what
i'd like to know is would the cart require a login system to track users and
to prevent ppl from making dodgy orders , if not can a session easily be
hijacked at all ? better still is there anyone out there who has intergrated
their users with the paypal login, so say they login to your shopping cart
to start making payments they are alreayd logged into paypal aswell this
would be ideal :D
--- End Message ---
--- Begin Message ---
Hi,
I am using W2000pro. I have Apache 1.3.2 and Mysql 4 servers. I am using PHP
4.2.3.
I have an EXE file. When I run it from command line it works perfect. But
with PHP system command I got this error message.
Untrapped exception :Access violation at address 0049403A in module
run.exe'. Read of address FFFFFFFF
TIA
--- End Message ---
--- Begin Message ---
The EXE file has been made by Delphi 6. A command line tool. (as far as I
know)
--- End Message ---
--- Begin Message ---
I want to do one of those redirect pages where a php script prints HTML
saying "sorry we're not here, we're redirecting you to the right location"
and then after about 2-3 seconds a new location header gets printed and you
are transported to the new location. I see this everywhere but don't know
how it's done.
I tried this by printing the "Location" header first and then the text and
it just
relocated me without seeing the text. I tried printing the text first and
then the "Location" header and php complains that my header was already sent
and I
can't modify it to relocate.
How do you do this?? Is there something in the header I have to specify to
wait before it relocates? Do I have to do it manually by printing the text..
tell the script to wait and then clear the header somehow and send a new one
(can that be done?) I looked at HTTP1.1 docs and I didn't really get
anywhere.
Any ideas?
Carl.
--- End Message ---
--- Begin Message ---
On Fri, 13 Jun 2003 12:22:44 -0400, Carl Furst wrote:
>How do you do this?
Use JavaScript. :)
--- End Message ---
--- Begin Message ---
try a delayed javascript redirect. location header must be in the header
whichprevents your visitor from seeing html...thats irritating. i miss the
ASP "response.redirect" which can be placed anywhere
J
-----Original Message-----
From: Carl Furst [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 9:23 AM
To:
Subject: [PHP] Redirects in PHP
I want to do one of those redirect pages where a php script prints HTML
saying "sorry we're not here, we're redirecting you to the right location"
and then after about 2-3 seconds a new location header gets printed and you
are transported to the new location. I see this everywhere but don't know
how it's done.
I tried this by printing the "Location" header first and then the text and
it just
relocated me without seeing the text. I tried printing the text first and
then the "Location" header and php complains that my header was already sent
and I
can't modify it to relocate.
How do you do this?? Is there something in the header I have to specify to
wait before it relocates? Do I have to do it manually by printing the text..
tell the script to wait and then clear the header somehow and send a new one
(can that be done?) I looked at HTTP1.1 docs and I didn't really get
anywhere.
Any ideas?
Carl.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Build a JavaScript and have it execute as the document loads... i.e. in the
body tag with an onLoad event...
the header function in php will not do anything if you have sent output
already
-----Original Message-----
From: Carl Furst [mailto:[EMAIL PROTECTED]
Sent: June 13, 2003 9:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Redirects in PHP
I want to do one of those redirect pages where a php script prints HTML
saying "sorry we're not here, we're redirecting you to the right location"
and then after about 2-3 seconds a new location header gets printed and you
are transported to the new location. I see this everywhere but don't know
how it's done.
I tried this by printing the "Location" header first and then the text and
it just
relocated me without seeing the text. I tried printing the text first and
then the "Location" header and php complains that my header was already sent
and I
can't modify it to relocate.
How do you do this?? Is there something in the header I have to specify to
wait before it relocates? Do I have to do it manually by printing the text..
tell the script to wait and then clear the header somehow and send a new one
(can that be done?) I looked at HTTP1.1 docs and I didn't really get
anywhere.
Any ideas?
Carl.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I miss the response.redirect in Python and DTML which can be placed
anywhere as well.
Michael
On Friday 13 June 2003 10:28 am, Johnny Martinez wrote:
> try a delayed javascript redirect. location header must be in the header
> whichprevents your visitor from seeing html...thats irritating. i miss the
> ASP "response.redirect" which can be placed anywhere
>
> J
>
> -----Original Message-----
> From: Carl Furst [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 13, 2003 9:23 AM
> To:
> Subject: [PHP] Redirects in PHP
>
>
> I want to do one of those redirect pages where a php script prints HTML
> saying "sorry we're not here, we're redirecting you to the right location"
> and then after about 2-3 seconds a new location header gets printed and you
> are transported to the new location. I see this everywhere but don't know
> how it's done.
>
> I tried this by printing the "Location" header first and then the text and
> it just
> relocated me without seeing the text. I tried printing the text first and
> then the "Location" header and php complains that my header was already
> sent and I
> can't modify it to relocate.
>
> How do you do this?? Is there something in the header I have to specify to
> wait before it relocates? Do I have to do it manually by printing the
> text.. tell the script to wait and then clear the header somehow and send a
> new one (can that be done?) I looked at HTTP1.1 docs and I didn't really
> get anywhere.
>
> Any ideas?
>
>
> Carl.
--- End Message ---
--- Begin Message ---
Javascript.. bah humbug. :)
Carl, you can avoid these issues by using output buffering allowing you to
call header() whever you want in your script.
<? // example..
ob_start(); // buffer output
echo "this is output you'll never see";
header("Location: thankyou.html"); // header redirect
ob_end_flush(); // flush output
?>
- Kevin
----- Original Message -----
From: "Johnny Martinez" <[EMAIL PROTECTED]>
To: "'Carl Furst'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, June 13, 2003 10:28 AM
Subject: RE: [PHP] Redirects in PHP
> try a delayed javascript redirect. location header must be in the header
> whichprevents your visitor from seeing html...thats irritating. i miss the
> ASP "response.redirect" which can be placed anywhere
>
> J
>
> -----Original Message-----
> From: Carl Furst [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 13, 2003 9:23 AM
> To:
> Subject: [PHP] Redirects in PHP
>
>
> I want to do one of those redirect pages where a php script prints HTML
> saying "sorry we're not here, we're redirecting you to the right location"
> and then after about 2-3 seconds a new location header gets printed and
you
> are transported to the new location. I see this everywhere but don't know
> how it's done.
>
> I tried this by printing the "Location" header first and then the text and
> it just
> relocated me without seeing the text. I tried printing the text first and
> then the "Location" header and php complains that my header was already
sent
> and I
> can't modify it to relocate.
>
> How do you do this?? Is there something in the header I have to specify to
> wait before it relocates? Do I have to do it manually by printing the
text..
> tell the script to wait and then clear the header somehow and send a new
one
> (can that be done?) I looked at HTTP1.1 docs and I didn't really get
> anywhere.
>
> Any ideas?
>
>
> Carl.
>
>
>
> --
> 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
>
>
--- End Message ---
--- Begin Message ---
On 2003-06-13 10:54-0600, Kevin Stone wrote:
> Carl, you can avoid these issues by using output buffering allowing you to
> call header() whever you want in your script.
This will not solve the OP's problem; the header will still be output
first, and the client will be immediately redirected. I am curious
though; why is everyone suggesting to use JavaScript when the following
in the <head> section of the HTML document will work just as well?
<meta http-equiv="refresh"
content="3;URL=http://example.com/new-page.html" />
Am I missing something?
-Zak
--- End Message ---
--- Begin Message ---
On Fri, 13 Jun 2003 10:54:39 -0600, Kevin Stone wrote:
>Javascript.. bah humbug. :)
>
>Carl, you can avoid these issues by using output buffering allowing you to
>call header() whever you want in your script.
But he doesn't get to see the printed info - so it's basically the same
difference. I think either JavaScipt is probably the solution
I have also found reference to the following:
<meta http-equiv="Refresh" content="8;URL=http://
www.example.com/somepage.html">
It is supposed to do what is wanted but it's not W3C standard.
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Zak Johnson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 13, 2003 11:00 AM
Subject: Re: [PHP] Redirects in PHP
> On 2003-06-13 10:54-0600, Kevin Stone wrote:
> > Carl, you can avoid these issues by using output buffering allowing you
to
> > call header() whever you want in your script.
>
> This will not solve the OP's problem; the header will still be output
> first, and the client will be immediately redirected. I am curious
> though; why is everyone suggesting to use JavaScript when the following
> in the <head> section of the HTML document will work just as well?
>
> <meta http-equiv="refresh"
> content="3;URL=http://example.com/new-page.html" />
>
> Am I missing something?
>
> -Zak
Oh you're right I didn't read the original post. You can still use the OB
method and redirect to an HTML page containing the "sorry we're not here,
we're redirecting you to the right location" message and meta refresh
without goofing up the output in the original script. It's a straight
forward and clean transition.
- Kevin
--- End Message ---
--- Begin Message ---
It's like a meta tag...<meta http-equiv="Refresh" content="5;url=FILE.PHP">
JavaScript version:
<script language="javascript">
function deelay(secs)
{
setTimeout("goto_url()",secs*1000)
}
function goto_url()
{
location.href="FILE.PHP"
}
</script>
<body onload="deelay(2)">
"Carl Furst" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> I want to do one of those redirect pages where a php script prints HTML
> saying "sorry we're not here, we're redirecting you to the right location"
> and then after about 2-3 seconds a new location header gets printed and
you
> are transported to the new location. I see this everywhere but don't know
> how it's done.
>
> I tried this by printing the "Location" header first and then the text and
> it just
> relocated me without seeing the text. I tried printing the text first and
> then the "Location" header and php complains that my header was already
sent
> and I
> can't modify it to relocate.
>
> How do you do this?? Is there something in the header I have to specify to
> wait before it relocates? Do I have to do it manually by printing the
text..
> tell the script to wait and then clear the header somehow and send a new
one
> (can that be done?) I looked at HTTP1.1 docs and I didn't really get
> anywhere.
>
> Any ideas?
>
>
> Carl.
>
>
--- End Message ---
--- Begin Message ---
Search engines frown on using meta refresh because of
abuse problems. Some engines won't index the page
period and all of them penalize you at the very least.
While it will work as you described, you're sacrificing
search engine positioning to use it. You need to weigh
the trade-offs
Michael
On Friday 13 June 2003 11:00 am, Zak Johnson wrote:
> <meta http-equiv="refresh"
> content="3;URL=http://example.com/new-page.html" />
--- End Message ---
--- Begin Message ---
On 2003-06-13 10:34-0600, Michael wrote:
> Search engines frown on using meta refresh because of
> abuse problems. Some engines won't index the page
> period and all of them penalize you at the very least.
> While it will work as you described, you're sacrificing
> search engine positioning to use it.
How many search engines do you know of that will parse and follow the
JavaScript location.href redirection suggested earlier?
-Zak
--- End Message ---
--- Begin Message ---
You're absolutely right. Thus, the need for a server-side
redirect. You can use meta refresh as long as the time is
set to around 10 seconds without being penalized. I
guess you could include a message that you are going to
be transferred in 10 seconds, then provide a link for the
impatient types, like myself, to get there quicker.
michael
On Friday 13 June 2003 11:30 am, Zak Johnson wrote:
> On 2003-06-13 10:34-0600, Michael wrote:
> > Search engines frown on using meta refresh because of
> > abuse problems. Some engines won't index the page
> > period and all of them penalize you at the very least.
> > While it will work as you described, you're sacrificing
> > search engine positioning to use it.
>
> How many search engines do you know of that will parse and follow the
> JavaScript location.href redirection suggested earlier?
>
> -Zak
--- End Message ---
--- Begin Message ---
echo ob_get_level(); returns 1
but the next line:
ob_end_clean(); returns
Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer default
output handler.
Any ideas?
Thanks!
Shawn
--- End Message ---
--- Begin Message ---
sorry, It´s only a test!!
--- End Message ---