|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 3 Oct 2005 03:40:04 -0000 Issue 3716
php-general-digest-help
lists.php.net
Date: Sun Oct 02 2005 - 22:40:04 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 3 Oct 2005 03:40:04 -0000 Issue 3716
Topics (messages 223530 through 223545):
Re: "Sanitize" paths
223530 by: Robert Cummings
convert array to HTML GET request
223531 by: Martin van den Berg
223532 by: Jasper Bryant-Greene
223534 by: M. Sokolewicz
223535 by: Chris
223538 by: adriano ghezzi
Re: PHP 5 Hosting
223533 by: Oliver Grätz
223536 by: Torgny Bjers
Re: anyone want to teach php?
223537 by: John Taylor-Johnston
HTML Header Location - relative URI issue
223539 by: Jaepil Kim
223540 by: Jasper Bryant-Greene
223541 by: Jaepil Kim
Image resizing...
223542 by: Sonia
Re: php5<-->com terribly wrong ?
223543 by: Sonia
Re: session_name("CCLTrolley")
223544 by: John Taylor-Johnston
buffer problem having a mind of its own
223545 by: matt VanDeWalle
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Sun, 2005-10-02 at 11:26, Philip Hallstrom wrote:
> >> realpath() is your friend...
> >
> > That has been my first impression too, but...
> >
> >> realpath() expands all symbolic links
> >
> > I am actually using symlinks :)
> >
> > I trust the files on my server so "local redirects" via symlinks are no
> > problem, the user submitted data is.
The following might help you write your own:
http://www.interjinn.com/jinnDoc/interjinn.function.jinn____fullRelativePath.phtml
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Newbe question:
How does one convert an array into a HTML GET request easely? Are
there any standard functions?
Same for HTML POST requests.
Thanks,
Martin.
attached mail follows:
Martin van den Berg wrote:
> How does one convert an array into a HTML GET request easely? Are
> there any standard functions?
>
> Same for HTML POST requests.
HTTP GET and POST requests are formatted the same, just sent in
different ways. I don't know if there's a function; I'd just use:
<?php
$myArray = array(
'apples' => 'oranges',
'pears' => 'peaches',
);
$queryParts = array();
foreach( $myArray as $key=>$value ) {
$queryParts[] = "$key=$value";
}
$query = implode( '&', $queryParts );
// For GET, use e.g.:
$data = file_get_contents( "http://www.example.com/?$query" );
// For POST, pass $query to curl_setopt for an HTTP POST (see CURL docs)
?>
Disclaimer: I typed this from memory and haven't tested it, so there
might be minor errors, but you get the picture.
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
attached mail follows:
Jasper Bryant-Greene wrote:
> Martin van den Berg wrote:
>
>> How does one convert an array into a HTML GET request easely? Are
>> there any standard functions?
>>
>> Same for HTML POST requests.
>
>
> HTTP GET and POST requests are formatted the same, just sent in
> different ways. I don't know if there's a function; I'd just use:
>
> <?php
> $myArray = array(
> 'apples' => 'oranges',
> 'pears' => 'peaches',
> );
>
> $queryParts = array();
> foreach( $myArray as $key=>$value ) {
> $queryParts[] = "$key=$value";
you might also want to use urlencode() in here to make sure the URL
stays valid.
- tul
> }
>
> $query = implode( '&', $queryParts );
>
> // For GET, use e.g.:
> $data = file_get_contents( "http://www.example.com/?$query" );
>
> // For POST, pass $query to curl_setopt for an HTTP POST (see CURL docs)
> ?>
>
> Disclaimer: I typed this from memory and haven't tested it, so there
> might be minor errors, but you get the picture.
attached mail follows:
PHP 5 has the http_build_query function which does exactly what you want:
http://www.php.net/http_build_query
Chris
Martin van den Berg wrote:
>Newbe question:
>
>How does one convert an array into a HTML GET request easely? Are
>there any standard functions?
>
>Same for HTML POST requests.
>
>Thanks,
>
>Martin.
>
>
>
attached mail follows:
if i understand well you need to get an array from html post
if you use the same name for your html fields you automatically have
an array in $_POST
eg
input type=text name=myfield value="field_1"
input type=text name=myfield value="field_2"
you'll get the array ar_myfield = $_POS['myfield']
you should achieve the same result using myfield[key] in the name of html
hyh
by ag.
2005/10/2, Martin van den Berg <martinvdberg
gmail.com>:
> Newbe question:
>
> How does one convert an array into a HTML GET request easely? Are
> there any standard functions?
>
> Same for HTML POST requests.
>
> Thanks,
>
> Martin.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Sheesh! No week passing by without people complaining about hosters
missiong out on PHP5. This is one point where we in Germany seem to be
lucky. The two biggest german hosters 1&1 (about 4 million domains) and
Strato (about 2.5 million domains) both offer SSH and the possibility to
chosse the PHP version on a per directory basis (via .htaccess). Strato
offers PHP 3.x, 4.0.x, 4.3.x and 5.0.x in parallel. Perhaps you should
think about "outsourcing" your hosting *g*.
For about 13 EUR per month you get PHP3, 4, 5 and even Ruby, SSH access,
MySQL access, 4 Domains, 600MB space and 30 GB free traffic.
AllOLLi
attached mail follows:
Oliver Grätz wrote:
>Sheesh! No week passing by without people complaining about hosters
>missiong out on PHP5. This is one point where we in Germany seem to be
>lucky. The two biggest german hosters 1&1 (about 4 million domains) and
>Strato (about 2.5 million domains) both offer SSH and the possibility to
>chosse the PHP version on a per directory basis (via .htaccess). Strato
>offers PHP 3.x, 4.0.x, 4.3.x and 5.0.x in parallel. Perhaps you should
>think about "outsourcing" your hosting *g*.
>
>
I am assuming they're running PHP through CGI in this case, am I
correct, or are they hosting on Windows to achieve the multiple PHP
versions? If CGI, that rather affects performance of larger
applications, it especially impact render time of more complex templates
and forms. During my own testing we gained lots of time by just running
it as a compiled Apache module instead of through CGI and in .htaccess.
On our hosting servers we solved it by running a compiled PHP 5 Apache
module on one server, and regular on the others. This way, if someone
requests PHP 5, they can be put on the server that supports it, and if
somebody wants to switch server from PHP 4 to PHP 5, it's an easy enough
task. Or, of course, we have the CGI option to fall back on.
Regards,
Torgny
attached mail follows:
Karl,
I cannot make promises, but I might have someone. If he answers me, I'll
let you know.
He got me started a few years ago. Excellent teacher, and author of
phpMyAdmin :-P
John
Karl James wrote:
>Hello Team,
>
>I was wondering if there is anyone that would like to teach
>Me the language as a teacher of a class would. Like
>Giving assignments and stuff.
>
>I tried to learn from books and website tutorials but it doesn't
>Seem to do the trick for me.
>
>Would anybody be willing to do this, if so please email me
>Off list, and directly to my verizon.net address listed below.
>
>I would be willing to pay somebody for their services.
>I would like to keep it reasonable please. I am live from check
>To check. I understand most of the basics. I will have to refresh
>My self with the basics again but it shouldn't take to much time.
>
>Please let me know your thoughts if any one can help me.
>
>Karl James ("The Saint")
>karl.james
verizon.net
>karl.james
verizonwireless.com
>http://www.theufl.com/
>
>
attached mail follows:
Hi
HTML 1.1 specifies that Location in HTML Header should be absolute URI.
Also says that some of the browsers will not work with relative URI.
Can anyone show me which browsers fail to work with *relative URI* in a
HTML Header Location?
Regards,
Jaepil
attached mail follows:
Jaepil Kim wrote:
> HTML 1.1 specifies that Location in HTML Header should be absolute URI.
> Also says that some of the browsers will not work with relative URI.
>
> Can anyone show me which browsers fail to work with *relative URI* in a
> HTML Header Location?
I assume you mean HTTP 1.1, not HTML 1.1. IMHO the question you should
be asking is why would you want to knowingly disobey the standard and
send a relative URI? It's not exactly difficult to send an absolute URI
in any circumstance I can think of.
There is no guarantee that future user agents will continue to work with
your website if you do send a relative URI, as they are usually (albeit
loosely) based around the standards, which require an absolute URI [1].
[1] http://w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
attached mail follows:
Jasper Bryant-Greene wrote:
> Jaepil Kim wrote:
>
>> HTML 1.1 specifies that Location in HTML Header should be absolute URI.
>> Also says that some of the browsers will not work with relative URI.
>>
>> Can anyone show me which browsers fail to work with *relative URI* in a
>> HTML Header Location?
>
>
> I assume you mean HTTP 1.1, not HTML 1.1. IMHO the question you should
> be asking is why would you want to knowingly disobey the standard and
> send a relative URI? It's not exactly difficult to send an absolute URI
> in any circumstance I can think of.
>
> There is no guarantee that future user agents will continue to work with
> your website if you do send a relative URI, as they are usually (albeit
> loosely) based around the standards, which require an absolute URI [1].
>
> [1] http://w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
Thanks for the reply.
The situation is that I'm working with code that was written by someone
else. And relative URIs were used all over the place.
I had to decide how serious this is, that's why I had to ask a rather
stupid question.
Regards,
Jaepil
attached mail follows:
Hi All
I've been working on finishing a project SGML2IMAGE and I am sort of having
trouble with resizing of images. I am trying to just use the GD library so
when I distro the package it will not need any other things installed to be
used. Now I am using...
imagecreatetruecolor ();
imagecreatefrom___ ();
imagecopyresampled ();
image___ ();
But the thumbnails look blurry for any image less than 50% of the original
image created by the PHP SGML parser. So my question seeing I am not very
good with the GD library. Am I using the best functions to do the resize or
should I be using some other image function(s) that may give better results!
To give you a idea of what I am doing see the demo running on my note
book....
http://24.218.192.217/capture.php
Thanks....
sonia
attached mail follows:
If you need this functionality then you should go back to PHP 4 the version
that worked for you. I also have problems with this and winmgmts object.
some classes work others don't, most times it's a VARIANT type problems. I
know Wez is really busy but if you keep checking the snap shots you will see
he is fixing things as they come in. A good idea is to check bugs.php.net
before upgrading as it will help determine if a update is a wise decision!
Sonia
attached mail follows:
Robert Cummings wrote:
>Is there a reason you're using a comma delimited string? I would
>recommend using an array instead:
>
><?php
>session_name( 'CCLTrolley' );
>session_start();
>// Initialize the trolley.
>if( !isset( $_SESSION['TrolleyContents'] ) )
>{
> $_SESSION['TrolleyContents'] = array();
>}
>// Add new entry.
>if( isset( $_POST['RNum'] ) )
>{
> $_SESSION['TrolleyContents'][$_POST['RNum']] = $_POST['RNum'];
>}
>echo implode( ',', $_SESSION['TrolleyContents'] );
>print_r($_SESSION);
>?>
>
>Cheers,
>Rob.
>
>
Hi,
Still absorbing this array stuff :).
I'm getting this error. And when RNum = 1 or = 16 or = 116, it only
registers '1', or whatever the first digit is.
Warning: Bad arguments to implode() in /var/.../printtrolley.php on line 14
Array ( [TrolleyContents] => 1 3 4 4 5 6 )
I was expecting to see soemthing like:
TrolleyContents[16]
TrolleyContents[32]
TrolleyContents[45]
TrolleyContents[48]
TrolleyContents[55]
TrolleyContents[116]
if I have done my homework, since last night ;), correctly?
The manual example says:
<?php
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);
echo $comma_separated; // lastname,email,phone
?>
What is my correct seperator? And why does only one digit get registered?
Thanks,
John
attached mail follows:
hello again
I was writing and rewriting my user function for my chat server trying to
crush this bug but its beyond me whats going on. basically I have it so
if a new user comes on, we know that if they type "new" at the prompt so
it goes to the newuser function, asks for a username, accepts that
alright, but when I ask for a password(echoed or not), even if i ask for
anything else, just the second input of the function, it skips right
threw that, prompts for it but apparently the buffer still has a \n in it
so it is assuming that is the password and going right onto the 3rd signup
prompt, i could stick with the default password being a random number and
avoiding this whole problem, but i actually don't, the buffer is still
full of whatever, and would ask the 3rd prompt but just drop right threw,
I turned on implicit_flush in php.ini, just as a second measure, I call
ob_implicit_flush() after reading from the socket each time, but the '\n'
or whatever mysterious character, still seems to be there, also, I know
too because before i started working on redoing the logon function, i
would log on and i would automatically have a character sent but i didn't
type anything so something is really screwy or am I just not clearing the
buffers the right way?
oh yes, as you may have assumed from what I wrote, or may not have, after
the password or otherwise 2nd prompt, things work as expected with the
other prompts,
if this helps, I am using php 4.3.10 in command line interface
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]