php-general Digest 13 Aug 2003 17:54:24 -0000 Issue 2234
Topics (messages 159395 through 159462):
Re: [PEAR-DOC] standardize @throws for phpdocumentor 2.0?
159395 by: Greg Beaver
159399 by: Alexander Merz
Re: Forms
159396 by: Robert Cummings
how to change index.php?passwd to index.php in the address bar
159397 by: murugesan
159402 by: Peter James
159407 by: murugesan
159410 by: murugesan
159413 by: Ivo Fokkema
159416 by: David Otton
159418 by: murugesan
159419 by: David Otton
Re: string concatenation from array
159398 by: Fabio Rotondo
how to use array_map() with a class callback function?
159400 by: Jean-Christian IMbeault
159401 by: Peter James
159405 by: Jean-Christian IMbeault
Re: Cache Question
159403 by: Ivo Fokkema
Re: Adding days to a date
159404 by: John Manko
Re: HTML equivalents of accented characters
159406 by: Ivo Fokkema
159422 by: Liam Gibbs
159423 by: Ivo Fokkema
Re: PHP and SQL Server
159408 by: Ben
Re: Cannot add header information - headers already sent
159409 by: frederik feys
159412 by: Marek Kilimajer
counting files, choosing at random
159411 by: Adam i Agnieszka Gasiorowski FNORD
159414 by: David Otton
159421 by: Adam i Agnieszka Gasiorowski FNORD
Re: discussion forum from j. meloni's book
159415 by: Ford, Mike [LSS]
159424 by: Anthony Ritter
159425 by: Anthony Ritter
saving images into pdf file using PDFlib
159417 by: jan
159420 by: Jay Blanchard
159426 by: jan
Location referer header
159427 by: Uros
159429 by: Uros
159433 by: Marek Kilimajer
Config files
159428 by: Hardik Doshi
159430 by: Chris Boget
159431 by: CPT John W. Holmes
global scope issue
159432 by: Shawn McKenzie
159435 by: Ivo Fokkema
159436 by: Shawn McKenzie
159438 by: Robert Cummings
159439 by: Ford, Mike [LSS]
159441 by: Curt Zirzow
159445 by: Shawn McKenzie
159447 by: Shawn McKenzie
setting allow_call_time_pass_reference to true
159434 by: Merlin
159437 by: Curt Zirzow
Re: how do I spoof a get request
159440 by: Chris Shiflett
159443 by: Analysis & Solutions
159448 by: Chris Shiflett
159450 by: Analysis & Solutions
Re: MIME-type to file extension
159442 by: Ney André de Mello Zunino
Re: Simple HTTP request, with "Range" header
159444 by: Chris Shiflett
159446 by: Chris Shiflett
fsockopen/ssl
159449 by: Wendy Reetz
159459 by: Scott Fletcher
Display variable with spaces
159451 by: Pushpinder Singh Garcha
159452 by: Analysis & Solutions
159453 by: Larry E. Ullman
Parsing problem with character '>'
159454 by: FMM Schillemans
159455 by: Analysis & Solutions
Precision value in PHP??
159456 by: Scott Fletcher
159457 by: Chris W. Parker
159458 by: Chris Boget
Re: Display variable with spaces -SOLVED
159460 by: Pushpinder Singh Garcha
OT - my apologies
159461 by: Ryan.K.Look.courts.state.hi.us
159462 by: Matt Babineau
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 ---
Alex:
What do you think of allowing shortened syntax, since @package is
implied. In other words, all packages have to have a @package tag for
all classes, so we can safely assume that a package will throw a
package_error or a package_warning, etc. then, if we encounter:
@throws error::NOT_FOUND
it can be expanded to:
@throws package_error::PACKAGE_ERROR_NOT_FOUND
Does that sound reasonable?
Greg
Alexander Merz wrote:
Greg Beaver wrote:
We are thinking of standardizing the format of @throws for
phpDocumentor 2.0. The possible format we'd like to use is:
@throws constant|classname [description]
@throws error_class::constant description
ie @throws PEAR_Error::NOT_FOUND ....
--- End Message ---
--- Begin Message ---
Greg Beaver wrote:
What do you think of allowing shortened syntax, since @package is
implied. In other words, all packages have to have a @package tag for
all classes, so we can safely assume that a package will throw a
package_error or a package_warning, etc. then, if we encounter:
I doesn't want to stick to this behavoir, better we allow @throw for the
@package doc section. This @throws define a standard namespace/class for
the @throws in function scope, ie:
* @package myPackage
* @throws PEAR_Error
*/
...
* @throws NOT_FOUND -> PEAR_Error::NOT_FOUND
*/
function ...
* @throws DB_Error::MISSING_DSN
*/
function ...
--- End Message ---
--- Begin Message ---
As I mentioned already you would be best not using Javascript and
performing the submission via PHP. I wrote the following snippet in the
past to do something similar to what you are asking. Study it and see if
you can adapt it to your own needs. You should be able to loop on the
form submission but you may want to disable script time limit if you
expect that this will take a while.
function submitForm( $host, $path, $data )
{
$headerString =
'POST '.$path.' HTTP/1.0' ."\r\n"
.'User-Agent: Lynx ;)' ."\r\n"
.'Host: '.$host ."\r\n"
.'Accept: */*' ."\r\n"
.'Content-type: application/x-www-form-urlencoded' ."\r\n"
.'Content-length: ';
$postData = '';
foreach( $data as $key => $value )
{
$postData .= urlencode( $key ).'='.urlencode( $value ).'&';
}
$postData = ereg_replace( '.$', '', $postData );
$headerString .= ''.strlen( $postData )."\r\n\r\n";
$headerString .= $postData."\r\n";
$content = sendRequest( $host, $headerString );
$content = implode( "\n", $content );
echo 'CONTENT'."\n\n".$content."\n\n";
}
function sendRequest( $host, $header )
{
$fp = fsockopen
(
$host,
80,
$errno,
$errstr,
30
);
$data = '';
if( !$fp )
{
echo "Error: $errstr ($errno)\n";
}
else
{
fputs( $fp, $header );
while( !feof( $fp ) )
{
$data .= fgets( $fp, 128 );
}
fclose( $fp );
}
return explode( "\n", $data );
}
Cheers,
Rob.
On Tue, 2003-08-12 at 20:45, Kris Reid wrote:
>
> ----- Original Message -----
> From: "Robert Cummings" <[EMAIL PROTECTED]>
>
> > If I understand your question correctly it sounds like you want to
> > populate a database on Server A with data residing in a database on
> > server B via a form hosted on server A *grin*. Obviously this is
> > tedious, and if there are a lot of entries then I would suggest writing
> > a script to populate and submit the form automatically. If you are lucky
> > everything will be done via HTML GET method (URL parameters); however,
> > it is more likely that it uses the POST method. You can do some reading
> > into posting data via HTML request headers, or you can look and see if
> > there is a class that does what you want in PEAR or PHP Classes.
> >
> > HTH,
> > Rob.
> >
>
> Robert
>
> Thanks for explaining my situation better. That's spot on.
> I have php grabbing data from my database and filling the form. Then
> JavaScript automatically submits the form.
> However once the form is submitted. Server A forwards the browser else
> where. So I have to type in my URL again.
>
> Is there some way I can more or less dump my database into theirs via the
> form. There are a #$%^ load of records.
>
> Thanks
>
> Kris
>
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--- End Message ---
--- Begin Message ---
Hello all,
When go to a new page from login page the address bar has
localhost/regsuccess.php?password="ASD"
I don't want the things that comes after ? in the URL
How can I resolve this issue?.
Thanks in advance,
Murugesan
--- End Message ---
--- Begin Message ---
Use the post method?
--
Peter James
Editor-in-Chief, php|architect Magazine
[EMAIL PROTECTED]
php|architect
The Magazine for PHP Professionals
http://www.phparch.com
----- Original Message -----
From: "murugesan" <[EMAIL PROTECTED]>
To: "Robert Cummings" <[EMAIL PROTECTED]>; "Kris Reid" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 12:28 AM
Subject: [PHP] how to change index.php?passwd to index.php in the address
bar
> Hello all,
> When go to a new page from login page the address bar has
> localhost/regsuccess.php?password="ASD"
> I don't want the things that comes after ? in the URL
> How can I resolve this issue?.
>
> Thanks in advance,
> Murugesan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Can you explain me in detail to use the post method.
Thanks,
Murugesan
----- Original Message -----
From: "Peter James" <[EMAIL PROTECTED]>
To: "murugesan" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 12:12 PM
Subject: Re: [PHP] how to change index.php?passwd to index.php in the
address bar
> Use the post method?
>
> --
> Peter James
> Editor-in-Chief, php|architect Magazine
> [EMAIL PROTECTED]
>
> php|architect
> The Magazine for PHP Professionals
> http://www.phparch.com
>
>
> ----- Original Message -----
> From: "murugesan" <[EMAIL PROTECTED]>
> To: "Robert Cummings" <[EMAIL PROTECTED]>; "Kris Reid"
<[EMAIL PROTECTED]>
> Cc: "PHP List" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 13, 2003 12:28 AM
> Subject: [PHP] how to change index.php?passwd to index.php in the address
> bar
>
>
> > Hello all,
> > When go to a new page from login page the address bar has
> > localhost/regsuccess.php?password="ASD"
> > I don't want the things that comes after ? in the URL
> > How can I resolve this issue?.
> >
> > Thanks in advance,
> > Murugesan
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
--- End Message ---
--- Begin Message ---
I used the post method in the form tag. But I am getting the following error
Method Not Allowed
The requested method POST is not allowed for the URL /products.html.
Apache/1.3.19 Server at localhost
Any one is there to reaolve my problem
Regards,
Murugesan.
----- Original Message -----
From: "Peter James" <[EMAIL PROTECTED]>
To: "murugesan" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 12:12 PM
Subject: Re: [PHP] how to change index.php?passwd to index.php in the
address bar
> Use the post method?
>
> --
> Peter James
> Editor-in-Chief, php|architect Magazine
> [EMAIL PROTECTED]
>
> php|architect
> The Magazine for PHP Professionals
> http://www.phparch.com
>
>
> ----- Original Message -----
> From: "murugesan" <[EMAIL PROTECTED]>
> To: "Robert Cummings" <[EMAIL PROTECTED]>; "Kris Reid"
<[EMAIL PROTECTED]>
> Cc: "PHP List" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 13, 2003 12:28 AM
> Subject: [PHP] how to change index.php?passwd to index.php in the address
> bar
>
>
> > Hello all,
> > When go to a new page from login page the address bar has
> > localhost/regsuccess.php?password="ASD"
> > I don't want the things that comes after ? in the URL
> > How can I resolve this issue?.
> >
> > Thanks in advance,
> > Murugesan
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
--- End Message ---
--- Begin Message ---
You will really need the post protocol if you don't want anything from a
form displayed in the url.
Apparently, Apache is not allowing the POST protocol for that
directory/file. Is this a local server or don't you have access to the
Apache config file? If it's a local server, fix this setting. This is not a
standard setting AFAIK.
HTH,
--
Ivo
"Murugesan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I used the post method in the form tag. But I am getting the following
error
>
> Method Not Allowed
> The requested method POST is not allowed for the URL /products.html.
> Apache/1.3.19 Server at localhost
> Any one is there to reaolve my problem
>
> Regards,
> Murugesan.
>
> ----- Original Message -----
> From: "Peter James" <[EMAIL PROTECTED]>
> To: "murugesan" <[EMAIL PROTECTED]>
> Cc: "PHP List" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 13, 2003 12:12 PM
> Subject: Re: [PHP] how to change index.php?passwd to index.php in the
> address bar
>
>
> > Use the post method?
> >
> > --
> > Peter James
> > Editor-in-Chief, php|architect Magazine
> > [EMAIL PROTECTED]
> >
> > php|architect
> > The Magazine for PHP Professionals
> > http://www.phparch.com
> >
> >
> > ----- Original Message -----
> > From: "murugesan" <[EMAIL PROTECTED]>
> > To: "Robert Cummings" <[EMAIL PROTECTED]>; "Kris Reid"
> <[EMAIL PROTECTED]>
> > Cc: "PHP List" <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 13, 2003 12:28 AM
> > Subject: [PHP] how to change index.php?passwd to index.php in the
address
> > bar
> >
> >
> > > Hello all,
> > > When go to a new page from login page the address bar has
> > > localhost/regsuccess.php?password="ASD"
> > > I don't want the things that comes after ? in the URL
> > > How can I resolve this issue?.
> > >
> > > Thanks in advance,
> > > Murugesan
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
>
--- End Message ---
--- Begin Message ---
On Wed, 13 Aug 2003 14:18:13 +0530, you wrote:
In your first post you say
> When go to a new page from login page the address bar has
>localhost/regsuccess.php?password="ASD"
But in your second,
>Method Not Allowed
>The requested method POST is not allowed for the URL /products.html.
> Apache/1.3.19 Server at localhost
>Any one is there to reaolve my problem
These are different files (regsuccess.php and products.html). It sounds like
the action attribute on your form is pointing to the wrong place. By default
Apache won't let HTML files deal with POST data, for obvious reasons.
--- End Message ---
--- Begin Message ---
Thanks for the message. Actually I tried only html files in the beginning.
Let me explain my problem.
I want to open a new window in a link with a function as
function newwindow()
{
window.open("/home.php?userid=user1","Homepage");
}
when I click the link
now the address bar has the following address
http://localhost/home.php?userid=user1
How can I remove the "?userid=user1" in the address bar.
I used method = POST for a button to go to new page. That worked well. So
with a link how can I achieve this.
-Murugesan
----- Original Message -----
From: "David Otton" <[EMAIL PROTECTED]>
To: "murugesan" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 3:48 PM
Subject: Re: [PHP] how to change index.php?passwd to index.php in the
address bar
> On Wed, 13 Aug 2003 14:18:13 +0530, you wrote:
>
> In your first post you say
>
> > When go to a new page from login page the address bar has
> >localhost/regsuccess.php?password="ASD"
>
> But in your second,
>
> >Method Not Allowed
> >The requested method POST is not allowed for the URL /products.html.
> > Apache/1.3.19 Server at localhost
> >Any one is there to reaolve my problem
>
> These are different files (regsuccess.php and products.html). It sounds
like
> the action attribute on your form is pointing to the wrong place. By
default
> Apache won't let HTML files deal with POST data, for obvious reasons.
>
>
--- End Message ---
--- Begin Message ---
On Wed, 13 Aug 2003 16:03:43 +0530, you wrote:
>Thanks for the message. Actually I tried only html files in the beginning.
>Let me explain my problem.
>
>I want to open a new window in a link with a function as
>function newwindow()
>{
> window.open("/home.php?userid=user1","Homepage");
>}
This is Javascript, right? This is a PHP list.
>when I click the link
>
> now the address bar has the following address
>
>http://localhost/home.php?userid=user1
>
>How can I remove the "?userid=user1" in the address bar.
If you're passing that kind of data back and forth to the client I strongly
advise you to use sessions instead, as your current scripts have some fairly
major security holes that changing from GET to POST won't fix.
http://uk2.php.net/manual/en/ref.session.php
>I used method = POST for a button to go to new page. That worked well. So
>with a link how can I achieve this.
But to answer your immediate question, this seems to be a Javascript thing
(or just use an image instead of a button).
I would create a hidden form in the page and hook an onClick() event onto a
link which performs the form submit.
<?
if (isset ($userid))
{
echo ($userid);
}
?>
<script language="JavaScript">
function newPage()
{
document.getElementById("userForm").target = "_blank";
document.getElementById("userForm").submit();
}
</script>
<form method="post" action="<? echo ($PHP_SELF); ?>" id="userForm">
<input type="hidden" name="userid" value="user1">
</form>
<a href="#" onClick="javascript:newPage()">click me</a>
If you want any more information on this, I think you've reached the point
where you should be asking on a Javascript list.
--- End Message ---
--- Begin Message ---
Micah Montoy wrote:
I'm having a bit of difficulty getting a string to attach to itself from an
array. Here is the bit of code I'm working on.
$wresult = "";
foreach ($search_string as $word_result){
$wresult = $wresult & " " & $word_result;
}
what about:
$wresult = join ( " ", $search_string );
Ciao,
Fabio
--- End Message ---
--- Begin Message ---
I'd like to use array map with the callback function being a static
function in a class. How can I do that?
I have tried:
class Maker {
function sGetNameId($a) {
return 1;
}
}
array_map("Maker::sGetNameId", array("1") )
But I get this error:
array_map(): The first argument, 'Maker::sGetNameId', should be either
NULL or a valid callback
Is it possible to use class functions as callback functions?
Thanks,
Jean-Christian Imbeault
--- End Message ---
--- Begin Message ---
array_map(array('Maker', 'sGetNameId'), array("1") )
Have a look at the callback type, here:
http://www.php.net/manual/en/language.pseudo-types.php
--
Peter James
Editor-in-Chief, php|architect Magazine
[EMAIL PROTECTED]
php|architect
The Magazine for PHP Professionals
http://www.phparch.com
----- Original Message -----
From: "Jean-Christian IMbeault" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 12:33 AM
Subject: [PHP] how to use array_map() with a class callback function?
> I'd like to use array map with the callback function being a static
> function in a class. How can I do that?
>
> I have tried:
>
> class Maker {
> function sGetNameId($a) {
> return 1;
> }
> }
>
> array_map("Maker::sGetNameId", array("1") )
>
> But I get this error:
>
> array_map(): The first argument, 'Maker::sGetNameId', should be either
> NULL or a valid callback
>
> Is it possible to use class functions as callback functions?
>
> Thanks,
>
> Jean-Christian Imbeault
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Peter James wrote:
> array_map(array('Maker', 'sGetNameId'), array("1") )
>
> Have a look at the callback type, here:
> http://www.php.net/manual/en/language.pseudo-types.php
Thanks! That did it.
Now if only PHP could treat class functions first-class citizens instead
of having making us jump through hoops ;)
Jc
--- End Message ---
--- Begin Message ---
Hi Tony,
Chris explained a lot about this... I'm not an expert on this, but you might
want to give a try to embed something like :
"<embed src='mp3.php?mp3=filename' autostart=true>";
And then let mp3.php send all of the no-cache headers together with the
contents of the filename.mp3.
It might work, I would give it a try...
HTH,
--
Ivo
"Tony Tzankoff" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a webpage written in the latest version of PHP and need a little
bit
> of help with a rather pesky cache issue. Part of the source code is as
> follows:
>
> page.php
> <?
> echo "<meta http-equiv=pragma content=no-cache>";
> echo "<meta http-equiv=expires content='-1'>";
> .
> .
> .
> echo "<embed src=filename.mp3 autostart=true>";
> ?>
>
> The page does not cache (which is good), but the MP3 file does (which is
> bad). Is there a way to NOT cache the MP3 file? I would like to keep the
> file embedded within the page, if possible. Thanks!
>
>
--- End Message ---
--- Begin Message ---
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=php+add+days+date&btnG=Google+Search
Donpro wrote:
I have a piece of code like so:
$today =- getdate();
I am looking for a function that will add a variable number of days and
return a valid date, i.e., the array elements for "mday", "mon" and "year"
are reset as needed. Is this possible?
Thanks,
Don
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003
--- End Message ---
--- Begin Message ---
"Liam Gibbs" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > I think php.net/htmlentities will do this.
>
> Apparently it *is*, but it won't for me. Any problems with this code?
>
> $result[] = "é";
> $result[1] = htmlspecialchars($result[0]);
> $result[2] = htmlentities($result[0]);
>
> Both return the accented E unchanged.
I bet they do, did you check the HTML source as well? My guess is that the
source is reading the actual expected output, but your browser views "é", as
it should of course.
HTH,
--
Ivo
--- End Message ---
--- Begin Message ---
> I bet they do, did you check the HTML source as well? My guess is that the
> source is reading the actual expected output, but your browser views "é",
as
> it should of course.
Sorry, should have mentioned. The source code reads the actual character,
not the é.
--- End Message ---
--- Begin Message ---
"Liam Gibbs" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > I bet they do, did you check the HTML source as well? My guess is that
the
> > source is reading the actual expected output, but your browser views
"é",
> as
> > it should of course.
> Sorry, should have mentioned. The source code reads the actual character,
> not the é.
Hmmm... interesting... I tested your exact code in this format :
<?php
$result[] = "é";
$result[1] = htmlspecialchars($result[0]);
$result[2] = htmlentities($result[0]);
foreach ($result as $val) {
print ("[" . $val . "]");
}
?>
which returned (sourcecode)
[é][é][é]
So with me, htmlentities works. Did you try this :
$a = get_html_translation_table(HTML_ENTITIES);
var_dump($a);
? With me, it returns a 99 elements array with loads of characters,
including the "é". (PHP/4.2.3 on Win2000)
I have no idea what might be the problem, what does your translation table
look like?
--
Ivo Fokkema
--- End Message ---
--- Begin Message ---
Todd
I use the ODBC drivers to connect a w2k server running PHP to a w2k server running
MSSql. It is used mainly for real time reports on sales etc.
I have had trouble in the past connecting. Downloading & installing MDAC from MS on
the php server helped.
Not much data is transferred, so never really run into performance problems.
$db = "odbbcname";
$cx=odbc_connect($db,'sa','password');
$sql = "select * from table";
$cur=odbc_exec($cx,$sql);
while(odbc_fetch_row($cur)){
$rep=odbc_result($cur,1);
}
"Todd Cary" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
I have a client that insists that I use SQL Server as the DB (vs. MySQL or
Interbase). I have not used PHP's ODBC interface and I am wondering if anyone on this
list has had experience with ODBC and SQL Server.
--- End Message ---
--- Begin Message ---
Hi Marek, hi all,
What do you mean by "says it all"? On that line the page title is
outputted.
I suspect something is wrong with the handler file:
http://www.aurelis.org/store/checkout_form_handler.txt
When i call http://www.aurelis.org/store/checkout_form.txt
for step 1 (i.e. client personal register form) checkout_form gives no "
headers already sent". When the client proceeds to step 2 (i.e. an
overview of purchase) the checkout_form_handler file is called.
This does some calculations, etc.. and then redirects user to proper
page using an header(location:) call.
I suspect this step gives the "header already sent".
Any help appreciated!
Fré
-----Original Message-----
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: dinsdag 12 augustus 2003 12:15
To: frederik feys
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Cannot add header information - headers already sent
output started at
/usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95
says it all. Look into the file at line 95.
frederik feys wrote:
> Hi all,
>
> I’m stuck with this one:
> I have an checkout procedure: when people come to the overview
page(step
> 2), they get:
>
> Warning: Cannot add header information - headers already sent by
(output
> started at
> /usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95) in
>
/usr/local/www/vhosts/aurelis.org/htdocs/store/includes/functions/get_ca
> rtID.php on line 14
>
> header_aurelis.php is where actual html output starts (template)
> i had a similar problem in my cart. I solved this by adding at the top
> of my script:
> $cookie = GetCartId();
> This doesn’t do the trick now :-(
>
> For your convenience i put the code here:
> http://www.aurelis.org/store/checkout_form.txt
> and a handler file:
> http://www.aurelis.org/store/checkout_form_handler.txt
>
> Can anyone shed some light on this?
>
> Thanks!
> Fré
>
>
--- End Message ---
--- Begin Message ---
You need to rethink your code logic. Any headers, be it cookies, cookies
from session_start(), header() calls, must be send before any content,
content is what you can see if you select "view source" and comes from
echo, print, printf, errors and warnings, or anything that is outside of
<?php ?>. Or use output buffering.
frederik feys wrote:
Hi Marek, hi all,
What do you mean by "says it all"? On that line the page title is
outputted.
I suspect something is wrong with the handler file:
http://www.aurelis.org/store/checkout_form_handler.txt
When i call http://www.aurelis.org/store/checkout_form.txt
for step 1 (i.e. client personal register form) checkout_form gives no "
headers already sent". When the client proceeds to step 2 (i.e. an
overview of purchase) the checkout_form_handler file is called.
This does some calculations, etc.. and then redirects user to proper
page using an header(location:) call.
I suspect this step gives the "header already sent".
Any help appreciated!
Fré
-----Original Message-----
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: dinsdag 12 augustus 2003 12:15
To: frederik feys
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Cannot add header information - headers already sent
output started at
/usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95
says it all. Look into the file at line 95.
frederik feys wrote:
Hi all,
I’m stuck with this one:
I have an checkout procedure: when people come to the overview
page(step
2), they get:
Warning: Cannot add header information - headers already sent by
(output
started at
/usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95) in
/usr/local/www/vhosts/aurelis.org/htdocs/store/includes/functions/get_ca
rtID.php on line 14
header_aurelis.php is where actual html output starts (template)
i had a similar problem in my cart. I solved this by adding at the top
of my script:
$cookie = GetCartId();
This doesn’t do the trick now :-(
For your convenience i put the code here:
http://www.aurelis.org/store/checkout_form.txt
and a handler file:
http://www.aurelis.org/store/checkout_form_handler.txt
Can anyone shed some light on this?
Thanks!
Fré
--- End Message ---
--- Begin Message ---
I want to choose a file at random from a
directory which adheres to certain naming scheme.
I can't get it to work. It's probably something
simple...Here is a relevant snippet:
<img src="/szukaj/images/i
<?
chdir('./szukaj/images/');
echo mt_rand(0, count(glob('i*.gif', GLOB_NOSORT)) - 1);
?>
.gif" width="120" height="151" alt=""
title="PropaGanda" border="0" />
(the files are all called i??.gif and
located in a directory /images/, which is a
subdirectory of directory where the script
is located (/szukaj/)).
Can you help?
--
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info / ALinkA / bOrk! * WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kształty... http://www.opera.com 007
--- End Message ---
--- Begin Message ---
On Wed, 13 Aug 2003 10:54:58 +0200, you wrote:
>
> I want to choose a file at random from a
> directory which adheres to certain naming scheme.
> I can't get it to work. It's probably something
> simple...Here is a relevant snippet:
>
><img src="/szukaj/images/i
><?
>chdir('./szukaj/images/');
>echo mt_rand(0, count(glob('i*.gif', GLOB_NOSORT)) - 1);
>?>
Wrapping the glob() in the count() is just throwing away the filenames. Try
something more like this.
$names = glob('i*.gif', GLOB_NOSORT);
if (sizeof ($names))
{
$offset = mt_rand (0, sizeof ($names));
$name = $names[$offset];
} else {
$name = 'not found';
}
echo ($name);
--- End Message ---
--- Begin Message ---
David Otton wrote:
> On Wed, 13 Aug 2003 10:54:58 +0200, you wrote:
>
> >
> > I want to choose a file at random from a
> > directory which adheres to certain naming scheme.
> > I can't get it to work. It's probably something
> > simple...Here is a relevant snippet:
> >
> ><img src="/szukaj/images/i
> ><?
> >chdir('./szukaj/images/');
> >echo mt_rand(0, count(glob('i*.gif', GLOB_NOSORT)) - 1);
> >?>
>
> Wrapping the glob() in the count() is just throwing away the filenames. Try
> something more like this.
>
> $names = glob('i*.gif', GLOB_NOSORT);
> if (sizeof ($names))
> {
> $offset = mt_rand (0, sizeof ($names));
> $name = $names[$offset];
> } else {
> $name = 'not found';
> }
> echo ($name);
Thank you, it solved my problem (after
minor tweaking). This list is just so great! :8].
--
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info / ALinkA / bOrk! * WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kształty... http://www.opera.com 007
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Anthony Ritter [mailto:[EMAIL PROTECTED]
> Sent: 13 August 2003 02:57
>
> Jennifer Goodie" <[EMAIL PROTECTED]> writes:
>
> > You didn't switch the aliases around, you just switched the
> join order.
> > This will provide unexpected results. In order to
> understand it, you
> should
> > read up on left joins.
> > http://www.mysql.com/doc/en/JOIN.html
> ............................
> Thank you. But...
>
> // the query
>
> $verify = "select ft.topic_id, ft.topic_title from
> forum_posts as fp left
> join forum_topics as ft on fp.topic_id = ft.topic_id where
> fp.post_id =
> $_GET[post_id]";
> ...........................
>
> My question: why - or how can - the columns ft.topic_id and
> ft.topic_title
> come from the table forum_posts?
You have a conceptual misconception. In effect, you need to read that query
as:
"select ft.topic_id, ft.topic_title
from ( forum_posts as fp
left join forum_topics as ft
on fp.topic_id = ft.topic_id
)
where fp.post_id = $_GET[post_id]"
In other words, the left join of the two tables is treated as a single
virtual table, from which you could select any column of either original
table.
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 ---
Ford, Mike [LSS]" <[EMAIL PROTECTED]> writes:
> You have a conceptual misconception. In effect, you need to read that
query
> as:
>
> "select ft.topic_id, ft.topic_title
> from ( forum_posts as fp
> left join forum_topics as ft
> on fp.topic_id = ft.topic_id
> )
> where fp.post_id = $_GET[post_id]"
>
> In other words, the left join of the two tables is treated as a single
> virtual table, from which you could select any column of either original
> table.
..................
Thanks Mike for the clear explanation.
TR
---
[This E-mail scanned for viruses by gonefishingguideservice.com]
--- End Message ---
--- Begin Message ---
Ford, Mike [LSS]" <[EMAIL PROTECTED]> writes:
> You have a conceptual misconception. In effect, you need to read that
query
> as:
>
> "select ft.topic_id, ft.topic_title
> from ( forum_posts as fp
> left join forum_topics as ft
> on fp.topic_id = ft.topic_id
> )
> where fp.post_id = $_GET[post_id]"
>
> In other words, the left join of the two tables is treated as a single
> virtual table, from which you could select any column of either original
> table.
..................
Thanks Mike for the clear explanation.
TR
--- End Message ---
--- Begin Message ---
Hi
im saving image into pdf with:
$image = pdf_load_image($p, 'jpeg', $picture_path, "");
pdf_fit_image($p, $image, $x_im, $y_im, "");
pdf_close_image($p, $image);
image is 150px x 100px but in genereted pdf file it looks much smaller.
im viewing mentioned pdf file with 100% view ratio.
i've tried it with several other images and im getting same result.
any idea what's wrong ?
i tried workaround with:
pdf_fit_image($p, $image, $x_im, $y_im, "boxsize {150 100} position 0
fitmethod meet");
however it doesnt look so good
thanks
Jan
--- End Message ---
--- Begin Message ---
[snip]
im saving image into pdf with:
$image = pdf_load_image($p, 'jpeg', $picture_path, "");
pdf_fit_image($p, $image, $x_im, $y_im, "");
pdf_close_image($p, $image);
image is 150px x 100px but in genereted pdf file it looks much smaller.
im viewing mentioned pdf file with 100% view ratio.
i've tried it with several other images and im getting same result.
any idea what's wrong ?
[/snip]
It is probably because of differences between print pixels (PDF) and
view pixels (monitor). Create a 150 x 100 image file. Open the PDF and
place the image file next to the image in the PDF. You will see
differences. another thing to note is that you are viewing the PDF at a
certain screen resolution which may not be the same resolution that your
users will be viewing the PDF.
--- End Message ---
--- Begin Message ---
Yes, it looks like that's the problem (print pixels vs. view pixels).
i've found out that PDFlib is importing images as 72dpi images no matter
if they really are 72dpi or not :(
so now my images are about 4-times smaller as they should be.
any suggestions ? :
Regards
Jan
On Wed, 2003-08-13 at 13:48, Jay Blanchard wrote:
> [snip]
> im saving image into pdf with:
>
> $image = pdf_load_image($p, 'jpeg', $picture_path, "");
> pdf_fit_image($p, $image, $x_im, $y_im, "");
> pdf_close_image($p, $image);
>
> image is 150px x 100px but in genereted pdf file it looks much smaller.
> im viewing mentioned pdf file with 100% view ratio.
>
> i've tried it with several other images and im getting same result.
>
> any idea what's wrong ?
> [/snip]
>
> It is probably because of differences between print pixels (PDF) and
> view pixels (monitor). Create a 150 x 100 image file. Open the PDF and
> place the image file next to the image in the PDF. You will see
> differences. another thing to note is that you are viewing the PDF at a
> certain screen resolution which may not be the same resolution that your
> users will be viewing the PDF.
--- End Message ---
--- Begin Message ---
Hello!
Is it possible to fake Referer header when redirecting to another URL.
I need this because of some redirection script in our directory. Because I
want that user ger referer from search query not that redirect script
generate.
for example:
redir.php?url=www.somehost.com
and at www.somehost.com get referer this redir.php
What I want is to send referer search.php?q=test&pos=2
--
Best regards,
Uros
--- End Message ---
--- Begin Message ---
Hi,
Anybody have any sugestion how to pass this data.
My only idea is something like this.
redir.php?url=www.somehost.com&q=test&pos=1
That way i can count click and also send referer with query data.
Wednesday, August 13, 2003, 3:27:10 PM, you wrote:
DO> On Wed, 13 Aug 2003 15:22:42 +0200, you wrote:
>>Is it possible to fake Referer header when redirecting to another URL.
>>
>>I need this because of some redirection script in our directory. Because I
>>want that user ger referer from search query not that redirect script
>>generate.
DO> No. Referer is set by the client, not the server.
--
Best regards,
Uros mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
No way.
Uros wrote:
Hi,
Anybody have any sugestion how to pass this data.
My only idea is something like this.
redir.php?url=www.somehost.com&q=test&pos=1
That way i can count click and also send referer with query data.
--- End Message ---
--- Begin Message ---
Hi Group,
I have following options for working with the
configuration files with the relatively large web
application.
1. Configuration variables using the DEFINE.
2. Array - Each configuration variable as an array
element.
3. PHP.INI like config files.
Please let me know which one is the best
approach..Also let me know if you guys have some other
good options.
Please provide some references if you find it
interesting for the config variables.
Thanks
Hardik
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
> I have following options for working with the
> configuration files with the relatively large web
> application.
For additional reference, you might want to check out
PEAR's Configuration package. It's fairly flexable and
work's pretty good. Although, I have found some oddness
when it's working with an XML configuration file. It works
fine. Just works oddly and unintuitively.
Chris
--- End Message ---
--- Begin Message ---
From: "Hardik Doshi" <[EMAIL PROTECTED]>
> I have following options for working with the
> configuration files with the relatively large web
> application.
>
> 1. Configuration variables using the DEFINE.
>
> 2. Array - Each configuration variable as an array
> element.
>
> 3. PHP.INI like config files.
A combination of #3 and #2. Store the data in a php.ini-style config file
and use parse_ini_file() to read it into an array.
You could even merge the array into the $_SERVER (or any other superglobal)
array so that your config vars are available in functions without having to
make anything global.
---John Holmes...
--- End Message ---
--- Begin Message ---
I'm having problems using global vars. I have read the docs and all of the
notes but it's not helping. Simplified example:
/dir1/script2.php
<?php
$test = array ( 'a' => '1', 'b' => '2');
?>
/dir1/script1.php
<?php
include("/dir1/script2.php");
print_r($test); //works great
print_r($GLOBALS['test']); //does not work
?>
This is a local include so the vars should be in the global scope right?
Any help please?
TIA
-Shawn
--- End Message ---
--- Begin Message ---
"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm having problems using global vars. I have read the docs and all of
the
> notes but it's not helping. Simplified example:
>
> /dir1/script2.php
> <?php
> $test = array ( 'a' => '1', 'b' => '2');
> ?>
>
> /dir1/script1.php
> <?php
> include("/dir1/script2.php");
> print_r($test); //works great
> print_r($GLOBALS['test']); //does not work
> ?>
>
> This is a local include so the vars should be in the global scope right?
> Any help please?
As far as I know, no defined variable is global by default. If you would
really need this variable to be global, you'll need to do a
global $test;
to make $test global.
HTH,
Ivo
--- End Message ---
--- Begin Message ---
OK, so what's the use of having the autoglobal $GLOBALS???
This is contrary to the docs.
-Shawn
"Ivo Fokkema" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I'm having problems using global vars. I have read the docs and all of
> the
> > notes but it's not helping. Simplified example:
> >
> > /dir1/script2.php
> > <?php
> > $test = array ( 'a' => '1', 'b' => '2');
> > ?>
> >
> > /dir1/script1.php
> > <?php
> > include("/dir1/script2.php");
> > print_r($test); //works great
> > print_r($GLOBALS['test']); //does not work
> > ?>
> >
> > This is a local include so the vars should be in the global scope right?
> > Any help please?
> As far as I know, no defined variable is global by default. If you would
> really need this variable to be global, you'll need to do a
>
> global $test;
>
> to make $test global.
>
> HTH,
>
> Ivo
>
>
--- End Message ---
--- Begin Message ---
The script below works fine for me. Do you have track_vars set to "On"?
I'm not 100% sure it's related, but it might be since I don't have any
problem with your sample script.
Cheers,
Rob.
On Wed, 2003-08-13 at 10:26, Shawn McKenzie wrote:
> I'm having problems using global vars. I have read the docs and all of the
> notes but it's not helping. Simplified example:
>
> /dir1/script2.php
> <?php
> $test = array ( 'a' => '1', 'b' => '2');
> ?>
>
> /dir1/script1.php
> <?php
> include("/dir1/script2.php");
> print_r($test); //works great
> print_r($GLOBALS['test']); //does not work
> ?>
>
> This is a local include so the vars should be in the global scope right?
> Any help please?
>
> TIA
> -Shawn
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ivo Fokkema [mailto:[EMAIL PROTECTED]
> Sent: 13 August 2003 15:45
>
> "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I'm having problems using global vars. I have read the
> docs and all of
> the
> > notes but it's not helping. Simplified example:
> >
> > /dir1/script2.php
> > <?php
> > $test = array ( 'a' => '1', 'b' => '2');
> > ?>
> >
> > /dir1/script1.php
> > <?php
> > include("/dir1/script2.php");
> > print_r($test); //works great
> > print_r($GLOBALS['test']); //does not work
> > ?>
> >
> > This is a local include so the vars should be in the global
> scope right?
> > Any help please?
> As far as I know, no defined variable is global by default.
> If you would
> really need this variable to be global, you'll need to do a
>
> global $test;
>
> to make $test global.
Absolute rubbish!! ALL variables used in the global scope are automatically
global and available in the superglobal array $GLOBALS. You're confusing
this with the issue that global variables are not automatically accessible
within functions but must be "imported" with the global statement. (And a
global statement in the gloabl scope has absolutely no effect whatsoever.)
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 ---
* Thus wrote Ford, Mike [LSS] ([EMAIL PROTECTED]):
> > -----Original Message-----
> > From: Ivo Fokkema [mailto:[EMAIL PROTECTED]
> > Sent: 13 August 2003 15:45
> >
> > "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> > As far as I know, no defined variable is global by default.
> > If you would
> > really need this variable to be global, you'll need to do a
> >
> > global $test;
> >
> > to make $test global.
>
> Absolute rubbish!! ALL variables used in the global scope are automatically
> global and available in the superglobal array $GLOBALS. You're confusing
> this with the issue that global variables are not automatically accessible
> within functions but must be "imported" with the global statement. (And a
> global statement in the gloabl scope has absolutely no effect whatsoever.)
I also believe php gives a warning/error about globaling a global
var in global scope.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
does it matter if a global command has bee issued before with vars other
than the $test var? i.e before the include if there is a global $somevar;
-Shawn
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Ford, Mike [LSS] ([EMAIL PROTECTED]):
> > > -----Original Message-----
> > > From: Ivo Fokkema [mailto:[EMAIL PROTECTED]
> > > Sent: 13 August 2003 15:45
> > >
> > > "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > >
> > > As far as I know, no defined variable is global by default.
> > > If you would
> > > really need this variable to be global, you'll need to do a
> > >
> > > global $test;
> > >
> > > to make $test global.
> >
> > Absolute rubbish!! ALL variables used in the global scope are
automatically
> > global and available in the superglobal array $GLOBALS. You're
confusing
> > this with the issue that global variables are not automatically
accessible
> > within functions but must be "imported" with the global statement. (And
a
> > global statement in the gloabl scope has absolutely no effect
whatsoever.)
>
> I also believe php gives a warning/error about globaling a global
> var in global scope.
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Sorry... nevermind. I was developing as part of a team and it seems that my
script is included in a function written by someone else. So my vars from
my included files are local to the other function and not global.
Thanks!
Shawn
"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> does it matter if a global command has bee issued before with vars other
> than the $test var? i.e before the include if there is a global $somevar;
>
> -Shawn
>
> "Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > * Thus wrote Ford, Mike [LSS] ([EMAIL PROTECTED]):
> > > > -----Original Message-----
> > > > From: Ivo Fokkema [mailto:[EMAIL PROTECTED]
> > > > Sent: 13 August 2003 15:45
> > > >
> > > > "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> > > > news:[EMAIL PROTECTED]
> > > >
> > > > As far as I know, no defined variable is global by default.
> > > > If you would
> > > > really need this variable to be global, you'll need to do a
> > > >
> > > > global $test;
> > > >
> > > > to make $test global.
> > >
> > > Absolute rubbish!! ALL variables used in the global scope are
> automatically
> > > global and available in the superglobal array $GLOBALS. You're
> confusing
> > > this with the issue that global variables are not automatically
> accessible
> > > within functions but must be "imported" with the global statement.
(And
> a
> > > global statement in the gloabl scope has absolutely no effect
> whatsoever.)
> >
> > I also believe php gives a warning/error about globaling a global
> > var in global scope.
> >
> > Curt
> > --
> > "I used to think I was indecisive, but now I'm not so sure."
>
>
--- End Message ---
--- Begin Message ---
Hi there,
I am working on a webservice with a xmlrpc class of Keith D. It workes
nicely, but it generates tonns of error msg into the error log file.
Telling me to set allow_call_time_pass_reference to true.
As I do want to set it only true for one directory, I would like to put it
into a .htaccess file.
I tryed:
php_flag allow_call_time_pass_reference on
but this does not work, I have to switch it off in the php.ini file, but
this is exacly what I do not want to do.
Can anybody see why this is not working with the .htaccess file?
Thanx in advance,
Merlin
--- End Message ---
--- Begin Message ---
* Thus wrote Merlin ([EMAIL PROTECTED]):
> Hi there,
>
> I am working on a webservice with a xmlrpc class of Keith D. It workes
> nicely, but it generates tonns of error msg into the error log file.
> Telling me to set allow_call_time_pass_reference to true.
I would also suggest you contact the author and suggest he fix it
so the paramaters are passed properly. Or if you really feel
motivated fix it for him and send him a patch :)
>
> I tryed:
> php_flag allow_call_time_pass_reference on
>
> but this does not work, I have to switch it off in the php.ini file, but
> this is exacly what I do not want to do.
Is the .htaccess enabled for the server? A quick test would be to
put a invalid line in the .htaccess to cause a 500 error.
Most likely the You'll need to modify the Options in your http.conf
file.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
--- Analysis & Solutions <[EMAIL PROTECTED]> wrote:
> That's a good guess! Yet further proof that cookies suck, except
> the ones made with flour, shortening and sugar, of course.
That's a pretty harsh description of one of Netscape's greatest contributions
to the Web (the other being SSL). With a simple extension to HTTP, cookies
provide a method for uniquely identifying Web clients. They can persists across
browser sessions (or not), can be easily maintained by the user (I can choose
which sites remember me, how long my cookies last, etc.), and are integrated
directly into the protocol (no unique identifiers in the URL, proxy caches,
etc.).
You may have had bad experiences with them for one reason or another, but that
is no reason to try and blindly describe cookies as "sucking". If they suck,
why do sites such as Google, Amazon, TicketMaster, Yahoo!, and eBay use them?
Do you think you know something that they all don't? Anytime that I notice the
major Web sites doing something I am not, I try to figure out why.
If your argument against them has anything to do with users having the option
to disable them, then you should try to learn how to work with that choice
rather than writing off the entire technology. There are plenty of examples in
the archives for working with cookies.
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
On Wed, Aug 13, 2003 at 08:17:14AM -0700, Chris Shiflett wrote:
>
> why do sites such as Google, Amazon, TicketMaster, Yahoo!, and eBay use
> them?
The difficulty with cookies is when a site doesn't work without them.
Fortunately, Google works fine when cookies are disabled. Amazon is a
great example of how a complex transaction can be completed without the
use of even one cookie.
--Dan
--
FREE scripts that make web and database programming easier
http://www.analysisandsolutions.com/software/
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
--- End Message ---
--- Begin Message ---
--- Analysis & Solutions <[EMAIL PROTECTED]> wrote:
> The difficulty with cookies is when a site doesn't work without
> them.
Right, which is an example of developers that suck, not the technology.
By that logic, you would think that PHP sucks, because there are plenty of
sucky PHP applications. :-)
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
Hey Chris:
On Wed, Aug 13, 2003 at 08:44:40AM -0700, Chris Shiflett wrote:
> --- Analysis & Solutions <[EMAIL PROTECTED]> wrote:
> > The difficulty with cookies is when a site doesn't work without
> > them.
>
> Right, which is an example of developers that suck, not the technology.
You're right. When I say cookies suck, I'm being flippant. I really mean
the programmers suck.
> By that logic, you would think that PHP sucks, because there are plenty of
> sucky PHP applications. :-)
I've had folks say things along these lines. Considering the number of
PHP related vulnerabilities showing up in Bugtraq/Security Focus
newsletter, PHP must REALLY suck. :)
Enjoy,
--Dan
--
FREE scripts that make web and database programming easier
http://www.analysisandsolutions.com/software/
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
--- End Message ---
--- Begin Message ---
Chris Boget wrote:
How do you intend on using that information? Typically the mime types
are set up in one of apache's .conf files. The same file you set up the
PHP extension, if I remember correctly.
The actual use involves handling file uploads. The uploaded files must
be moved to a permanent location on the server, after being verified to
be valid submissions. The files are saved using a naming scheme defined
by the server scripts, i.e., they will not keep the same name as the
original, uploaded files. So, what I wanted to do was to use the
/MIME-type/ information that comes in the /$_FILES/ structure in order
to find the appropriate file extension for a given file on the platform
the application is running.
In the end, I decided to extract that extension from the original
filename, which is also available in the /$_FILES/ structure.
Thank you for your help,
--
Ney André de Mello Zunino
--- End Message ---
--- Begin Message ---
--- Ken <[EMAIL PROTECTED]> wrote:
> What I want to do is write something simple in PHP that makes
> an HTTPrequest, takes the data received, and passes it through.
>
> Specifically, I am hoping to retrieve just a part of a file
> from the web server. If I wanted the whole file I would just do
> header("Location:...");
Just to be clear (I'm honestly not trying to be picky), but you're describing
two separate things here, from my interpretation. I am interpreting your
description of "passing it through" to mean that you want to make an HTTP
request with your PHP script and return the content of that response as the
content of your own response to the user. Is this correct?
Using the Location header makes your response to the user a 300-level response
(though you have the option of specifying status code now), meaning you're
telling them that the resource that they want is somewhere else. That
"somewhere else" is specified in your Location header, and the user's browser
will automatically make another request to that URL. You are no longer part of
the picture at this point.
> I imagine I would want to form a basic get header request, with URL,
> whatever else I need, and a "Range:bytes=1000-2000" header. If I
> understand correctly, the (HTTP/1.1) web server would return the
> document I want, just bytes 1000-2000.
You need a space after your colon, but yeah. However, keep in mind that a Web
server that does not understand range requests will return the entire resource
in a 200 response. If it is a partial response, you will know, because it will
be a 206 response and should include a Content-Range header. This is all
assuming that you do not make an out-of-range request.
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
--- Curt Zirzow <[EMAIL PROTECTED]> wrote:
> The problem with dealing with HTTP/1.1 is you have to make sure
> your script is HTTP/1.1 compliant, which there are a lot of
> gotchas to deal with.
In most cases, extra features (or gotchas) in HTTP/1.1 have to be requested via
one of the Accept-* headers, so it's more forgiving than you might think if you
just use something very plain like:
GET / HTTP/1.1
Host: example.org
> For example, some web servers will send back the data in chunks
> instead of just stream the file to you. So you have to parse the
> size of the chunk and then fread that size into your buffer.
For this specific case, you have to tell the server that you can accept chunked
transfers. If you don't, it should just use Content-Length.
> Now I think you can get by with a range: header when you request
> a document as HTTP/1.0, its been a while since I've acually done
> that so cant remember if I had to use HTTP/1.1 or not.
It wasn't part of the HTTP/1.0 specification, but that doesn't mean a whole lot
when it comes to implementations. :-) Many HTTP/1.0 agents have had HTTP/1.1
features added. As an example, most HTTP/1.0 requests include the Host header,
because it is required in HTTP/1.1.
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
Using php 4.3.2, apache 1.3.27, openssl .9.7b
I'm trying to open a secure connection using fsockopen("ssl://"...,443...) as
described in http://us4.php.net/manual/en/function.fsockopen.php.
I keep getting an error: PRNG not seeded.
OpenSSL says http://www.openssl.org/support/faq.html#USER1 says:
If the default seeding file [/dev/random or /dev/urandom] does not exist or is too
short, the "PRNG not seeded" error message may occur.
Now, both of these exist, but I'm not sure how to tell if they are too short...
has anyone used fsockopen("ssl://"...) successfully? I've read through the php site,
apache, and openssl...but I'm not finding a solution. Is there something that may
have been overlooked when the 3 were compiled? Do you need to create a certificate?
The answer may be staring me right in the face & I'm just not seeing it.Any point in
the right direction would be appreciated.
Thanks,
Wendy
--- End Message ---
--- Begin Message ---
Try "https://" instead of "ssl://", this is what is normally done.
As for your problem. It look like the private key when generated was too
short, this can be overcomed by entering more characters at the time of the
generation of hte key. But from your comments, you mentioned that from the
article at OpenSSL that it either not exist or is too short and that you
mentioned that you have both. So, if this is the case, then it seem that it
had nothing to do with being too short. Just that there is no key, so that
in turn is too short because it isn't there.
I don't have an idea of what is going on.
"Wendy Reetz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Using php 4.3.2, apache 1.3.27, openssl .9.7b
I'm trying to open a secure connection using fsockopen("ssl://"...,443...)
as described in http://us4.php.net/manual/en/function.fsockopen.php.
I keep getting an error: PRNG not seeded.
OpenSSL says http://www.openssl.org/support/faq.html#USER1 says:
If the default seeding file [/dev/random or /dev/urandom] does not exist or
is too short, the "PRNG not seeded" error message may occur.
Now, both of these exist, but I'm not sure how to tell if they are too
short...
has anyone used fsockopen("ssl://"...) successfully? I've read through the
php site, apache, and openssl...but I'm not finding a solution. Is there
something that may have been overlooked when the 3 were compiled? Do you
need to create a certificate?
The answer may be staring me right in the face & I'm just not seeing it.Any
point in the right direction would be appreciated.
Thanks,
Wendy
--- End Message ---
--- Begin Message ---
Hello,
I am trying to display the rows of a MySql Query in a table. I
retrieve the result using the query :
while ($row = mysql_fetch_array($result1, MYSQL_ASSOC))
{
$email_1 = $row["email_1"];
}
And I try to display it in the table using this :
<input name="email_1" type="text" id="email_1" size="50" value = <?
echo "$email_1"; ?>>