|
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 7 Aug 2006 20:52:14 -0000 Issue 4280
php-general-digest-help
lists.php.net
Date: Mon Aug 07 2006 - 15:52:14 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 7 Aug 2006 20:52:14 -0000 Issue 4280
Topics (messages 240220 through 240281):
Re: shebang line drive me nuts.
240220 by: Jochem Maas
240222 by: Chris
240223 by: Jochem Maas
240224 by: Sameer N Ingole
240225 by: Colin Guthrie
240226 by: Chris
240227 by: Duncan Hill
240228 by: Stut
Re: Image list performance ISSUE
240221 by: Andy
240231 by: David Tulloh
240281 by: Richard Lynch
Ru locale + UTF-8
240229 by: Tony Aldrich
[Solved] Re: [PHP] shebang line drive me nuts.
240230 by: Jochem Maas
Re: looking for a short/simple kind of app...
240232 by: David Robley
PDO and PGSQL: ERROR: syntax error at or near "SET"
240233 by: Erik Gyepes
240246 by: David Tulloh
saving and retrieving an array from a database
240234 by: Ross
240236 by: Jim Moseby
240237 by: Ross
240238 by: Andrei
240239 by: Peter Lauri
240251 by: Colin Guthrie
yahoo thinks html mail is spam, what's wrong with header?
240235 by: blackwater dev
240247 by: Colin Guthrie
240250 by: Austin Denyer
Declaring variables from the url
240240 by: Dave M G
240241 by: Jay Blanchard
240242 by: Jim Moseby
240244 by: Andrei
240263 by: Adam Zey
php and printing
240243 by: Jef Sullivan
240245 by: Peter Lauri
Re: design?
240248 by: Sjef
Is this really a pdf?
240249 by: Sjef
240252 by: Barry
240254 by: Ed Curtis
240255 by: Colin Guthrie
240262 by: Rory Browne
240266 by: Colin Guthrie
How to get rid off empty elements of an array?
240253 by: afan.afan.net
240265 by: John Wells
240267 by: Martin Alterisio
SOLVED (spelling error) - Re: [PHP] How to get rid off empty elements of an array?
240256 by: afan.afan.net
Re: POST on redirects?
240257 by: Chris Shiflett
240258 by: Chris Shiflett
240260 by: Adam Zey
session array
240259 by: Ross
240261 by: Stut
240268 by: Jochem Maas
session arrays
240264 by: Ross
stupid question...compiling php
240269 by: blackwater dev
240270 by: Jochem Maas
240271 by: blackwater dev
240272 by: Jochem Maas
php/ajax..
240273 by: bruce
240274 by: Jay Blanchard
240275 by: Robert Cummings
240276 by: Mariano Guadagnini
240277 by: Peter Lauri
240278 by: Adam Zey
240279 by: Robert Cummings
240280 by: bruce
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:
Robert Cummings wrote:
> On Mon, 2006-08-07 at 09:59 +0200, Jochem Maas wrote:
>> I have a php shell script (the execute bit of the file is set)
>> of which the first line is this:
>>
>> #!/usr/lib/php5/bin/php -q
>>
>> or this:
>>
>> #!/usr/bin/php -q
>>
>> or this:
>>
>> #!php -q
>>
>>
>> in all cases I get the following error when I run (as root) the script:
>>
>> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission denied
>>
>>
>> php is where I think it is:
>>
>> # which php
>> /usr/bin/php
>> # ls -lart /usr/bin/php
>> lrwxrwxrwx 1 root root 21 May 9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php
>>
>> any know what idiot thing I'm doing wrong?
>
> Check the permissions on /usr/lib/php5 and on /usr/lib/php5/bin and
> on /usr/lib/php5/bin/php
>
> Any one of those being set incorrectly can deny you access.
all dirs in that path are readable by everyone (read and execute flag set),
the executable is also readable & executable by everyone.
that is correct right?
>
> Cheers,
> Rob.
attached mail follows:
Jochem Maas wrote:
> Robert Cummings wrote:
>> On Mon, 2006-08-07 at 09:59 +0200, Jochem Maas wrote:
>>> I have a php shell script (the execute bit of the file is set)
>>> of which the first line is this:
>>>
>>> #!/usr/lib/php5/bin/php -q
>>>
>>> or this:
>>>
>>> #!/usr/bin/php -q
>>>
>>> or this:
>>>
>>> #!php -q
>>>
>>>
>>> in all cases I get the following error when I run (as root) the script:
>>>
>>> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission denied
>>>
>>>
>>> php is where I think it is:
>>>
>>> # which php
>>> /usr/bin/php
>>> # ls -lart /usr/bin/php
>>> lrwxrwxrwx 1 root root 21 May 9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php
>>>
>>> any know what idiot thing I'm doing wrong?
>> Check the permissions on /usr/lib/php5 and on /usr/lib/php5/bin and
>> on /usr/lib/php5/bin/php
>>
>> Any one of those being set incorrectly can deny you access.
>
> all dirs in that path are readable by everyone (read and execute flag set),
> the executable is also readable & executable by everyone.
>
> that is correct right?
Yeh, dirs should be 755, the file should be at least 755.
What o/s is this? If it's fedora 4+ do you have seLinux enabled or
something? I wonder if something else is getting in the way..
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Chris wrote:
> Jochem Maas wrote:
>> Robert Cummings wrote:
>>> On Mon, 2006-08-07 at 09:59 +0200, Jochem Maas wrote:
>>>> I have a php shell script (the execute bit of the file is set)
>>>> of which the first line is this:
>>>>
>>>> #!/usr/lib/php5/bin/php -q
>>>>
>>>> or this:
>>>>
>>>> #!/usr/bin/php -q
>>>>
>>>> or this:
>>>>
>>>> #!php -q
>>>>
>>>>
>>>> in all cases I get the following error when I run (as root) the script:
>>>>
>>>> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter:
>>>> Permission denied
>>>>
>>>>
>>>> php is where I think it is:
>>>>
>>>> # which php
>>>> /usr/bin/php
>>>> # ls -lart /usr/bin/php
>>>> lrwxrwxrwx 1 root root 21 May 9 11:40 /usr/bin/php ->
>>>> /usr/lib/php5/bin/php
>>>>
>>>> any know what idiot thing I'm doing wrong?
>>> Check the permissions on /usr/lib/php5 and on /usr/lib/php5/bin and
>>> on /usr/lib/php5/bin/php
>>>
>>> Any one of those being set incorrectly can deny you access.
>>
>> all dirs in that path are readable by everyone (read and execute flag
>> set),
>> the executable is also readable & executable by everyone.
>>
>> that is correct right?
>
> Yeh, dirs should be 755, the file should be at least 755.
>
> What o/s is this? If it's fedora 4+ do you have seLinux enabled or
> something? I wonder if something else is getting in the way..
it's debian, no selinux installed. the mystery continues :-)
>
attached mail follows:
Jochem Maas wrote:
> I have a php shell script (the execute bit of the file is set)
> of which the first line is this:
>
> #!/usr/lib/php5/bin/php -q
>
> or this:
>
> #!/usr/bin/php -q
>
> or this:
>
> #!php -q
>
>
> in all cases I get the following error when I run (as root) the script:
>
> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission denied
>
>
> php is where I think it is:
>
> # which php
> /usr/bin/php
> # ls -lart /usr/bin/php
> lrwxrwxrwx 1 root root 21 May 9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php
Does *any* php script give same error?
Even the simplest one like:
-- sample --
#!/path/to/php -q
<?
echo "something!!";
?>
-- end sample --
--
Sameer N. Ingole
http://weblogic.noroot.org/
---
Better to light one candle than to curse the darkness.
attached mail follows:
Jochem Maas wrote:
> in all cases I get the following error when I run (as root) the script:
>
> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission denied
Do you have root access on this machine? Perhaps the sysadmin as
configured bash to not accept "unknown" interpreters? I'd image that
this is fairly easy to do, tho' not looked into it before.
You could also try:
#!/usr/bin/env php
instead and see if that works.
Col.
attached mail follows:
Jochem Maas wrote:
> Chris wrote:
>> Jochem Maas wrote:
>>> Robert Cummings wrote:
>>>> On Mon, 2006-08-07 at 09:59 +0200, Jochem Maas wrote:
>>>>> I have a php shell script (the execute bit of the file is set)
>>>>> of which the first line is this:
>>>>>
>>>>> #!/usr/lib/php5/bin/php -q
>>>>>
>>>>> or this:
>>>>>
>>>>> #!/usr/bin/php -q
>>>>>
>>>>> or this:
>>>>>
>>>>> #!php -q
>>>>>
>>>>>
>>>>> in all cases I get the following error when I run (as root) the script:
>>>>>
>>>>> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter:
>>>>> Permission denied
>>>>>
>>>>>
>>>>> php is where I think it is:
>>>>>
>>>>> # which php
>>>>> /usr/bin/php
>>>>> # ls -lart /usr/bin/php
>>>>> lrwxrwxrwx 1 root root 21 May 9 11:40 /usr/bin/php ->
>>>>> /usr/lib/php5/bin/php
>>>>>
>>>>> any know what idiot thing I'm doing wrong?
>>>> Check the permissions on /usr/lib/php5 and on /usr/lib/php5/bin and
>>>> on /usr/lib/php5/bin/php
>>>>
>>>> Any one of those being set incorrectly can deny you access.
>>> all dirs in that path are readable by everyone (read and execute flag
>>> set),
>>> the executable is also readable & executable by everyone.
>>>
>>> that is correct right?
>> Yeh, dirs should be 755, the file should be at least 755.
>>
>> What o/s is this? If it's fedora 4+ do you have seLinux enabled or
>> something? I wonder if something else is getting in the way..
>
> it's debian, no selinux installed. the mystery continues :-)
damn ;)
maybe time to try strac'ing it?
strace ./file.php
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
On Monday 07 August 2006 09:11, Jochem Maas wrote:
> hi Robert,
>
> thanks for thinking with me ....
If the FS permissions to the binary are correct, odds are the file system is
actually mounted noexec.
attached mail follows:
Jochem Maas wrote:
> I wish it was the line endings - I checked and they where unix-style.
> I do edit on windows normally (unless it's some rush fix and then I'll
> use vi or nano) but I have the line-endings set to unix.
>
> vi gave no sign of a ^M and I rewrote the shebang there just to be
> safe.
>
> alas no joy.
>
There are only 2 other possibilities I can think of...
1) PHP CLI is not installed correctly
2) The mount you are executing it on is mounted noexec
-Stut
attached mail follows:
Thanks for the answers.
I will launch anyway this solution, it is more secure for us... I will
monitor the server to see if it can handle the load.
Regards,
Andy.
----- Original Message -----
From: "Chris" <dmagick
gmail.com>
To: "Andy" <frum
ar-sd.net>
Cc: "WeberSites LTD" <berber
weber-sites.com>; <php-general
lists.php.net>
Sent: Monday, August 07, 2006 10:58 AM
Subject: Re: [PHP] Image list performance ISSUE
> Andy wrote:
>> Sorry for the late answer,
>>
>> I have different applications and the users are kept in DB so I cannot
>> make for every user a directory.
>> I made a solution with .htaccess from apache and redirection to a php
>> script that outputs the image if the user has rights to the images.
>>
>> I will still have to check the performance of the system in this case,
>> but I think it will be the same.
>>
>> The performance Issue that I asked was:
>> Is there a difference if apache sends the image or If I output it with
>> php with readfile.
>
> Yes there will be a difference.
>
> If apache sends the image, it just does:
>
> - is the path valid?
> - send it.
>
> If you use readfile, apache has to fire up php, process the php script
> which then sends the image (which means another handle to read the file
> and so on), so there is a big difference between the two.
>
> Depending on how busy your server is, it may or may not be measurable but
> there is a big difference in terms of processing.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
attached mail follows:
Andy wrote:
> ...
> I want to know... is this a big performance issue or not(the image is handled by php and not by apache directly)
>
> OR...
>
> Is there any other way to handle this situation???
>
> Thanx,
> Andy.
I'd recomend doing a bit of benchmarking to figure out if the
performance hit is acceptable. Using php is the easiest solution.
Assuming that PHP is too slow for you, you can actually solve this issue
with some abuse of mod_rewrite.
You can use cookies to control the access by using the cookie variable
with mod_rewrite, it's accessible as HTTP_COOKIE. You will need to
parse the cookie string yourself.
This allows you to do something like link to user.png and set a cookie
user=35 and have mod_rewrite change it to access the 35.png file. You
can also do things like block anything that doesn't match 35.....png.
You can't do anything fancy like DB based permissions though.
Using cookies is still not secure however. You can obstuficate it
fairly well but a determined user can still get around any cookie
protections. You can beef up the mod_rewrite to handle this by using an
external program via RewriteMap and php session files, even database
access is possible. However 99% of the time I don't think that it would
be worth it.
David
attached mail follows:
On Mon, August 7, 2006 2:44 am, Andy wrote:
> The performance Issue that I asked was:
> Is there a difference if apache sends the image or If I output it with
> php
> with readfile.
Yes.
How much of a difference it makes depends on YOUR hardware.
Test it and see is the only sensible answer we can give.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Good day,
I try to set ru locale that is converted to UTF-8 in output.
I tried ru_ru.UTF-8 - with no results.
"ru" returns week and month names in win-1251.
What I missed?
Apache/2.0.55 Win32 PHP/5.1.2
Tony.
attached mail follows:
hi Duncan,
the disk the home dirs are situated on (where the script was living)
was indeed mounted as noexec.
THANK YOU for saving me hours of mental torture (and teaching me
something in the process), thanks to everyone else for giving
their time/energy.
kind regards,
Jochem
Duncan Hill wrote:
> On Monday 07 August 2006 09:11, Jochem Maas wrote:
>> hi Robert,
>>
>> thanks for thinking with me ....
>
> Answer to list doesn't seem to have arrived.
>
> Check that your filesystem isn't mounted noexec.
attached mail follows:
bruce wrote:
> hi...
>
> i'm looking for a short/simple kind of app to allow me to play around with
> some different tbls..
>
> basically.. i have a couple of tbls where i have a top level tbls, and a
> few subordinate child tbls
>
> parent
> child
> child
>
> i'd like to be able to add/modify/delete items from the various tbls.. i'd
> also like to be able to display a kind of breadcrumb across the top of the
> page allowing me to get back to the selected item/tbl...
>
> i'm willing to bet that there are numerous examples of this kind of app.
> i'm simply hoping that someone can point me to one that i can play around
> with...
>
> thanks
>
> -bruce
This is probably a good starting point:
http://www.sitepoint.com/article/hierarchical-data-database/3
and also, but you'll have to write your own script
http://www.dbazine.com/oracle/or-articles/tropashko4
Cheers
--
David Robley
I like to think of myself as a divide overflow.
Today is Prickle-Prickle, the 73rd day of Confusion in the YOLD 3172.
attached mail follows:
Hi all!
I'm trying to learn using PDO and PostgreSQL together a little bit and I
have some problems with (I thinks, auto incrementing fields)
I have the following sample DB:
CREATE TABLE users (
uid SERIAL UNIQUE NOT NULL,
login TEXT NOT NULL,
password TEXT NOT NULL,
PRIMARY KEY (uid)
);
and the following PHP code:
<?php
try {
$db = new PDO('pgsql:host=localhost;dbname=testing', 'XXXX', 'ZZZZZ');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = "INSERT INTO users SET uid = :uid, login = :login, password
= :password";
$stmt = $db->prepare($query);
$uid = "";
$login = "erik";
$password = "erikSecretPass";
$stmt->bindParam(':uid', $uid);
$stmt->bindParam(':login', $login);
$stmt->bindParam(':password', $password);
$stmt->execute();
$db = null;
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
When running the script I get the following error message: Error!:
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "SET" at
character 19
I know that I doing something bad, maybe with the udi column, how to use
auto incrementing columns with PDO?
Thanks very much for your time.
Erik Gyepes
attached mail follows:
Erik Gyepes wrote:
> ...
> $query = "INSERT INTO users SET uid = :uid, login = :login, password =
> :password";
> ...
> When running the script I get the following error message: Error!:
> SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "SET" at
> character 19
>
The INSERT INTO ... SET ... syntax is not standard SQL. It's a mysql
extension that isn't supported by any other sql databases, such as
postgresql.
The proper insert syntax is here:
http://www.postgresql.org/docs/8.0/interactive/dml.html#DML-INSERT
David
attached mail follows:
Hi,
I have an array of values. I want to save them with php to a single field in
my database and then retrieve them to an array.
What is the simplest way to achive this?
Ross
attached mail follows:
>
> Hi,
>
> I have an array of values. I want to save them with php to a
> single field in
> my database and then retrieve them to an array.
>
>
> What is the simplest way to achive this?
>
>
http://us3.php.net/serialize
Cheers!
JM
attached mail follows:
ok this seem to work but how do I bring it back? This is what I have so far.
<?
$first[] = array('appple', 'pear', 'banana');
$second = serialize($first);
$third[]= unserialize($second);
echo $second; //outputs serialized data
echo $third[1];
?>
----- Original Message -----
From: "Peter Lauri" <lists
dwsasia.com>
To: "'Ross'" <ross
aztechost.com>; <php-general
lists.php.net>
Sent: Monday, August 07, 2006 8:23 AM
Subject: RE: [PHP] saving and retrieving an array from a database
> http://se2.php.net/serialize
>
> /Peter
>
> -----Original Message-----
> From: Ross [mailto:ross
aztechost.com]
> Sent: Monday, August 07, 2006 7:19 PM
> To: php-general
lists.php.net
> Subject: [PHP] saving and retrieving an array from a database
>
> Hi,
>
> I have an array of values. I want to save them with php to a single field
> in
>
> my database and then retrieve them to an array.
>
>
> What is the simplest way to achive this?
>
>
> Ross
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Well it seems like u made a mess there with arrays...
<?
$first[] = array('appple', 'pear', 'banana');
$second = serialize($first);
$third[]= unserialize($second);
echo $second; //outputs serialized data
echo $third[1];
?>
From definition of first I understand it's an array of arrays with
element on position 0 (ZERO) set to an array of apple, pear, banana
elements.
If u serialize it and unserialize it you will obtain same thing...
so at the end of the script you should
echo $third[0];
Andy
ross
aztechost.com wrote:
> ok this seem to work but how do I bring it back? This is what I have so
> far.
>
> <?
> $first[] = array('appple', 'pear', 'banana');
> $second = serialize($first);
> $third[]= unserialize($second);
>
> echo $second; //outputs serialized data
> echo $third[1];
>
> ?>
> ----- Original Message ----- From: "Peter Lauri" <lists
dwsasia.com>
> To: "'Ross'" <ross
aztechost.com>; <php-general
lists.php.net>
> Sent: Monday, August 07, 2006 8:23 AM
> Subject: RE: [PHP] saving and retrieving an array from a database
>
>
>> http://se2.php.net/serialize
>>
>> /Peter
>>
>> -----Original Message-----
>> From: Ross [mailto:ross
aztechost.com]
>> Sent: Monday, August 07, 2006 7:19 PM
>> To: php-general
lists.php.net
>> Subject: [PHP] saving and retrieving an array from a database
>>
>> Hi,
>>
>> I have an array of values. I want to save them with php to a single
>> field in
>>
>> my database and then retrieve them to an array.
>>
>>
>> What is the simplest way to achive this?
>>
>>
>> Ross
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
attached mail follows:
http://se2.php.net/serialize
/Peter
-----Original Message-----
From: Ross [mailto:ross
aztechost.com]
Sent: Monday, August 07, 2006 7:19 PM
To: php-general
lists.php.net
Subject: [PHP] saving and retrieving an array from a database
Hi,
I have an array of values. I want to save them with php to a single field in
my database and then retrieve them to an array.
What is the simplest way to achive this?
Ross
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
ross
aztechost.com wrote:
> ok this seem to work but how do I bring it back? This is what I have so
> far.
>
> <?
> $first[] = array('appple', 'pear', 'banana');
> $second = serialize($first);
> $third[]= unserialize($second);
>
> echo $second; //outputs serialized data
> echo $third[1];
>
> ?>
I think you misunderstand how arrays work (at least in your example)
I think you really meant to try something like this:
<?
$first = array('appple', 'pear', 'banana');
$second = serialize($first);
$third= unserialize($second);
// $first == $third;
var_dump($first);
var_dump($third);
echo $first[1]; // pear
echo $third[1]; // pear
?>
attached mail follows:
Hello all,
When I try to send email from my server as html, my yahoo account and
several of my user's email accounts mark it as spam. I can send a normal
email via mail() just fine but when I try to to html, it's bad. I've played
with a few things but can't seem to figure it out. The html I am sending
just includes a table, no body, head, etc, just table html code.Here is what
I am using for the header:
$header="From:blackwaterdev
gmail.com <info
mlscore.com>
\r\nContent-Type:text/html\r\n";
Here are some of the headers from yahoo:
X-Apparently-To: blackwaterdev
yahoo.com via 66.196.97.50; Sun, 06 Aug 2006
13:46:30 -0700 X-YahooFilteredBulk: 64.140.230.68 X-Originating-IP: [
64.140.230.68] Return-Path: <root
localhost.localdomain>
Authentication-Results: mta333.mail.re4.yahoo.com from=bwdev.com;
domainkeys=neutral (no sig) Received: from 64.140.230.68 (EHLO
localhost.localdomain) (64.140.230.68) by mta333.mail.re4.yahoo.com with
SMTP; Sun, 06 Aug 2006 13:46:30 -0700 Received: from
localhost.localdomain(web5 [
127.0.0.1]) by localhost.localdomain (8.13.1/8.13.1) with ESMTP id
k76JlHch008629 for <blackwaterdev
yahoo.com>; Sun, 6 Aug 2006 15:47:17 -0400
Received: (from root
localhost) by localhost.localdomain (8.13.1/8.13.1/Submit)
id k76JlH8k008628; Sun, 6 Aug 2006 15:47:17 -0400 Date: Sun, 6 Aug 2006
15:47:17 -0400 Message-Id: <
200608061947.k76JlH8k008628
localhost.localdomain>
Thanks for any info!
attached mail follows:
blackwater dev wrote:
> Hello all,
>
> When I try to send email from my server as html, my yahoo account and
> several of my user's email accounts mark it as spam. I can send a normal
> email via mail() just fine but when I try to to html, it's bad. I've
> played
> with a few things but can't seem to figure it out. The html I am sending
> just includes a table, no body, head, etc, just table html code.Here is
> what
Some spam filters mark poorly formed HTML as SPAM, so make sure that
your message complies to the HTML standards. e.g. Just a table without a
body and opening html tags is probably invalid HTML...
Just a thought.
Col.
attached mail follows:
blackwater dev wrote:
> Hello all,
>
> When I try to send email from my server as html, my yahoo account and
> several of my user's email accounts mark it as spam. I can send a normal
> email via mail() just fine but when I try to to html, it's bad. I've
> played
> with a few things but can't seem to figure it out. The html I am sending
> just includes a table, no body, head, etc, just table html code.
<Snippage>
Well, html e-mail is generally a Bad Thing. Many people (myself
included) use applications such as SpamAssassin and html in e-mail
increases it's 'spamminess' from a scoring point of view.
Regards,
Austin.
attached mail follows:
PHP list,
I have many times set the value of a variable by declaring it in the
URL, like so:
http://www.domain.com/index.php?var=1
And then, to use the variable, all I have to do is use it in the script,
like so:
echo "This is the value of the variable: " . $var;
But, for some reason, in a script I'm writing now, this simple process
isn't working.
The only thing I can think of that is different between before and now
is that the new script is being executed in PHP5, whereas before was
with PHP4.
In my new script, I check the value of $_SERVER['QUERY_STRING'], the
value is contained in there, so it is being assigned and contained somehow.
What could I possibly be missing in what should be a super simple process?
--
Dave M G
attached mail follows:
[snip]
http://www.domain.com/index.php?var=1
And then, to use the variable, all I have to do is use it in the script,
like so:
echo "This is the value of the variable: " . $var;
[/snip]
echo $_GET['var'];
attached mail follows:
> PHP list,
>
> I have many times set the value of a variable by declaring it in the
> URL, like so:
>
> http://www.domain.com/index.php?var=1
>
> And then, to use the variable, all I have to do is use it in
> the script,
> like so:
>
> echo "This is the value of the variable: " . $var;
>
> But, for some reason, in a script I'm writing now, this
> simple process
> isn't working.
>
> The only thing I can think of that is different between
> before and now
> is that the new script is being executed in PHP5, whereas before was
> with PHP4.
>
> In my new script, I check the value of $_SERVER['QUERY_STRING'], the
> value is contained in there, so it is being assigned and
> contained somehow.
>
> What could I possibly be missing in what should be a super
> simple process?
To expand on Jay's excellent advice, you have been depending on "register
globals" to set the variable names for you. This is widely regarded as a
bad practice, because you don't know for sure where $var came from. You
should ALWAYS use $var=$_GET['var'] when taking values from the url to set a
variable.
For more information on the evils of register globals, STFA. There have
been many discussions in this list on that topic.
JM
attached mail follows:
Also check in php.ini register_globals to be On if you want to have vars
directly available in the script...
Andy
Jay Blanchard wrote:
> [snip]
> http://www.domain.com/index.php?var=1
>
> And then, to use the variable, all I have to do is use it in the script,
>
> like so:
>
> echo "This is the value of the variable: " . $var;
> [/snip]
>
> echo $_GET['var'];
>
attached mail follows:
Dave M G wrote:
> PHP list,
>
> I have many times set the value of a variable by declaring it in the
> URL, like so:
>
> http://www.domain.com/index.php?var=1
>
> And then, to use the variable, all I have to do is use it in the script,
> like so:
>
> echo "This is the value of the variable: " . $var;
>
> But, for some reason, in a script I'm writing now, this simple process
> isn't working.
>
> The only thing I can think of that is different between before and now
> is that the new script is being executed in PHP5, whereas before was
> with PHP4.
>
> In my new script, I check the value of $_SERVER['QUERY_STRING'], the
> value is contained in there, so it is being assigned and contained somehow.
>
> What could I possibly be missing in what should be a super simple process?
>
> --
> Dave M G
Before, you were relying on PHP's register_globals setting, which did
what you describe. Since the use of this setting is an enormous security
hole, and there is zero reason to use it outside of backwards
compatibility with old scripts, it has long since been disabled by default.
You should instead reference GET variables like so:
$_GET['var']
And POST like this:
$_POST['var']
This is much safer. If you REALLY want to turn on register_globals (And
I strongly recommend against it, it's a huge risk), information on how
to do this can be found in the PHP manual.
Regards, Adam.
attached mail follows:
Greetings to everyone,
I have been able to program the capability of printing several
end-of-month statements at the click of a
button using php. The problem I am faced with is when one of these
statements has more than one page.
Management would like to have the second page have a header similar to
the first page.
My question is this, has anyone here ever set up printing through php
(or javascript) and dealt with
multiple pages before? If so, where can you direct me for assistance?
Jef
attached mail follows:
Message-ID: <14.94.27091.BA747D44
pb1.pair.com>
From: "Peter Lauri" <lists
dwsasia.com>
To: "'Jef Sullivan'" <JefS
jmacradiator.com>,
<php-general
lists.php.net>
Date: Mon, 7 Aug 2006 16:00:30 +0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Subject: RE: [PHP] php and printing
You can generate a PDF with fpdf and then print that.
-----Original Message-----
From: Jef Sullivan [mailto:JefS
jmacradiator.com]
Sent: Monday, August 07, 2006 8:50 PM
To: php-general
lists.php.net
Subject: [PHP] php and printing
Greetings to everyone,
I have been able to program the capability of printing several
end-of-month statements at the click of a
button using php. The problem I am faced with is when one of these
statements has more than one page.
Management would like to have the second page have a header similar to
the first page.
My question is this, has anyone here ever set up printing through php
(or javascript) and dealt with
multiple pages before? If so, where can you direct me for assistance?
Jef
attached mail follows:
Thanks, John.
It's probably also a matter of how you name the classes. It needs to be a
clear name that describes what it 'is'. Hence, the depot name.
Anyway, indeed I have finished the concept of the app.
Sjef
""John Wells"" <wellsdjohn
gmail.com> schreef in bericht
news:f8306a9b0607021225x1a763048r522c50c6515cff49
mail.gmail.com...
> On 6/30/06, Sjef <manuals-scripts
planet.nl> wrote:
>> Thanks, John,
>> I'm not sure I completely get the idea of a pair class.
>>
>> As an question and answer are in the same database tabel I now created a
>> questionDepot class that gets the array from the db, does save and update
>> operations, and for example, sets a flag in the db tabel when a question
>> is
>> accepted for the list.
>>
>
> Hi Sjef,
>
> It sounds as if you've got the idea, even if I didn't explain myself
> well. My point was to *not* create a Question class that maintained
> an array of questions, which was only _implicitly_ related to a
> similarly-structured but disparate Answers class. An array of
> questions sitting beside an array of answers is, in my opinion, not a
> proper abstraction of the objects you're dealing with.
>
> Perhaps it is out of experience that I'm harping on this point,
> because I've been burned by a similar design before. One of my first
> OO projects was a weblog, and I had built a Post class, and then for
> posts with galleries, a separate Gallery class that contained *only*
> image information for it's parent Post.
>
> On it's own, this wasn't all bad, but the big mistake I made was how I
> handled multiple posts and multiple galleries (like for building out
> the homepage where I showed 5 recent posts and a thumbnail from each,
> if they were galleries). Within each Post and Gallery class, I turned
> the properties into _arrays_. So what originally was a string for the
> post's title, now became an array of strings for many posts. Likewise
> for the Gallery class. Arrays of thumbnails became arrays of arrays
> of thumbnails.
>
> I'm sure The List will shudder at this design, but hey, I've learned
> my lesson. Be-lieve-me. Anyway, the point is, your initial approach
> was the same (if I read it correctly). You suggested an array of
> questions, and an array of answers, which would only be implicitly
> related. Your design started with the concept of many questions, and
> many answers, but my argument is that, abstractly, you should begin
> with one question, and one answer. Then think in terms of a
> question-answer pair that *belong to each other*. And then think of
> many question-answer pairs.
>
> Anyway, I'm sure that by the time you've finished reading this
> hair-splitting rambling, you've already finished your app and moved on
> to something else entirely. :)
>
> -John W
attached mail follows:
Is it possible to recognize if a file for upload really is a pdf (like the
function getimagesize retuns the file type of the image)?
Thanxs,
Sjef
attached mail follows:
Sjef schrieb:
> Is it possible to recognize if a file for upload really is a pdf (like the
> function getimagesize retuns the file type of the image)?
> Thanxs,
> Sjef
this "might" help
http://de3.php.net/manual/en/function.mime-content-type.php
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
attached mail follows:
On Mon, 7 Aug 2006, Sjef wrote:
> Is it possible to recognize if a file for upload really is a pdf (like the
> function getimagesize retuns the file type of the image)?
> Thanxs,
> Sjef
Yes it is.
$_FILES['{form_field_name}']['type'] is your friend here. Just match it
against a mime type your looking for.
Ed Curtis
attached mail follows:
Sjef wrote:
> Is it possible to recognize if a file for upload really is a pdf (like the
> function getimagesize retuns the file type of the image)?
If you have a suitible mime.magic file, and your PHP has the
functionality built into it, you could try the mime_content_type() function.
http://uk.php.net/manual/en/function.mime-content-type.php
Or if not available, read the first few bytes of the file and verify
that it begins with:
%PDF-1.3
(or other versions - perhaps just verify the first 4 chars.
You can do this with a simple
$fp = fopen($filename, 'rb'));
if ('%PDF' == fread($fp, 4))
// PDF
else
// Not PDF
This is very simple.
You could also use the "file" commandline utility if the server is a
*nix machine and parse it's output.
e.g. on my machine:
[colin
jimmy www]$ file ~/Desktop/svn-book.pdf
/home/colin/Desktop/svn-book.pdf: PDF document, version 1.3
or easier:
[colin
jimmy www]$ file -i ~/Desktop/svn-book.pdf
/home/colin/Desktop/svn-book.pdf: application/pdf
Col.
attached mail follows:
On 8/7/06, Colin Guthrie <gmane
colin.guthr.ie> wrote:
>
> Sjef wrote:
> > Is it possible to recognize if a file for upload really is a pdf (like
> the
> > function getimagesize retuns the file type of the image)?
>
> If you have a suitible mime.magic file, and your PHP has the
> functionality built into it, you could try the mime_content_type()
> function.
> http://uk.php.net/manual/en/function.mime-content-type.php
Is this to protect against somebody trying to pass an mp3 off as a PDF, or
to stop people mistakenly uploading PDF's. If it's the latter, then mime
functions are probably okay. If the former, then you may want something a
little more through.
Or if not available, read the first few bytes of the file and verify
> that it begins with:
> %PDF-1.3
> (or other versions - perhaps just verify the first 4 chars.
>
> You can do this with a simple
>
> $fp = fopen($filename, 'rb'));
> if ('%PDF' == fread($fp, 4))
> // PDF
> else
> // Not PDF
>
> This is very simple.
And very insecure. All it takes is a cat and echo to disguise a file as a
PDF, and a quick 'dd skip' to Undisguise it.
You could also use the "file" commandline utility if the server is a
> *nix machine and parse it's output.
>
> e.g. on my machine:
> [colin
jimmy www]$ file ~/Desktop/svn-book.pdf
> /home/colin/Desktop/svn-book.pdf: PDF document, version 1.3
>
> or easier:
>
> [colin
jimmy www]$ file -i ~/Desktop/svn-book.pdf
> /home/colin/Desktop/svn-book.pdf: application/pdf
>
>
> Col.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
To: php-general
lists.php.net
From: Colin Guthrie <gmane
colin.guthr.ie>
Date: Mon, 07 Aug 2006 17:58:00 +0100
Message-ID: <eb7rej$3p6$1
sea.gmane.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: Is this really a pdf?
Rory Browne wrote:
>> http://uk.php.net/manual/en/function.mime-content-type.php
>
>
> Is this to protect against somebody trying to pass an mp3 off as a PDF, or
> to stop people mistakenly uploading PDF's. If it's the latter, then mime
> functions are probably okay. If the former, then you may want something a
> little more through.
snip
>> (or other versions - perhaps just verify the first 4 chars.
>>
>> You can do this with a simple
snip
>> This is very simple.
>
>
> And very insecure. All it takes is a cat and echo to disguise a file as a
> PDF, and a quick 'dd skip' to Undisguise it.
Absolutely! Incredibly insecure! :)
But again as you stated yourself, if it's just to help users rather than
preventing unotherised content, then either way would work most of the
time. It would be fairly trivial to write a valid PDF that was actually
an MP3 encoded specially, a few pages or so of base64 would do!!
Col.
Col.
attached mail follows:
Hi to all!
I have a form with 6 text fields where visitor has to enter product serial
number (same type data). he has to enter AT LEAST ONE.
for ($i=0; $i<6; $i++)
{
echo '<input type="text" name="PSN['.$i.']" value="'.$PSN[$i].'"
size="25">';
}
After the form is submitted I'm getting an array
Array
(
[0] => abc123
[1] => ddd111
[2] => poi987
[3] =>
[4] =>
[5] =>
)
Now, I need to get rid off empty elements of the array, to get this:
Array
(
[0] => abc123
[1] => ddd111
[2] => poi987
)
To do that I tried:
foreach ($PSN as $value)
{
if (!empty($value)) $PSN_New[] = $value;
}
but every time I'm getting one additional element of the array:
I tried
foreach ($PSN as $value)
{
if ($value != '') $PSN_New[] = $value;
}
too - same result.
Array
(
[0] => abc123
[1] => ddd111
[2] => poi987
[3] =>
)
No space or anything else is "entered" in 4th field.
What I'm doing wrong?
Thanks for any help.
-afan
attached mail follows:
Check the 5th and 6th fields. Something is in one of them. Because
based on your checks, it will work:
[php]
$first_array = array(
'first',
'second',
'third',
'',
'',
'');
foreach ($first_array as $value)
{
if (!empty($value)) $second_array[] = $value;
}
var_dump($second_array);
foreach ($first_array as $value)
{
if ($value != '') $third_array[] = $value;
}
var_dump($third_array);
[/php]
HTH,
John W
On 8/7/06, afan
afan.net <afan
afan.net> wrote:
> Hi to all!
>
> I have a form with 6 text fields where visitor has to enter product serial
> number (same type data). he has to enter AT LEAST ONE.
>
> for ($i=0; $i<6; $i++)
> {
> echo '<input type="text" name="PSN['.$i.']" value="'.$PSN[$i].'"
> size="25">';
> }
>
> After the form is submitted I'm getting an array
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> [3] =>
> [4] =>
> [5] =>
> )
>
> Now, I need to get rid off empty elements of the array, to get this:
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> )
>
> To do that I tried:
> foreach ($PSN as $value)
> {
> if (!empty($value)) $PSN_New[] = $value;
> }
> but every time I'm getting one additional element of the array:
>
> I tried
> foreach ($PSN as $value)
> {
> if ($value != '') $PSN_New[] = $value;
> }
> too - same result.
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> [3] =>
> )
>
> No space or anything else is "entered" in 4th field.
>
> What I'm doing wrong?
>
> Thanks for any help.
>
> -afan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
2006/8/7, afan
afan.net <afan
afan.net>:
>
> Hi to all!
>
> I have a form with 6 text fields where visitor has to enter product serial
> number (same type data). he has to enter AT LEAST ONE.
>
> for ($i=0; $i<6; $i++)
> {
> echo '<input type="text" name="PSN['.$i.']" value="'.$PSN[$i].'"
> size="25">';
> }
>
> After the form is submitted I'm getting an array
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> [3] =>
> [4] =>
> [5] =>
> )
>
> Now, I need to get rid off empty elements of the array, to get this:
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> )
>
> To do that I tried:
> foreach ($PSN as $value)
> {
> if (!empty($value)) $PSN_New[] = $value;
> }
> but every time I'm getting one additional element of the array:
>
> I tried
> foreach ($PSN as $value)
> {
> if ($value != '') $PSN_New[] = $value;
> }
> too - same result.
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> [3] =>
> )
>
> No space or anything else is "entered" in 4th field.
>
> What I'm doing wrong?
>
> Thanks for any help.
>
> -afan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
There are probably some whitespaces in the elements which refuse to be
deleted.
Also consider using array_filter() instead of looping through the array
(used without a callback function filter all elements which evaluate to
boolean false).
attached mail follows:
Message-ID: <51955.216.248.119.34.1154960703.squirrel
www.afan.net>
Date: Mon, 7 Aug 2006 16:25:03 +0200 (CEST)
From: afan
afan.net
To: afan
afan.net
Cc: php-general
lists.php.net
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: SOLVED (spelling error) - Re: [PHP] How to get rid off empty
elements of an array?
Sorry for this. Spelling error.
:(
-afan
> Hi to all!
>
> I have a form with 6 text fields where visitor has to enter product serial
> number (same type data). he has to enter AT LEAST ONE.
>
> for ($i=0; $i<6; $i++)
> {
> echo '<input type="text" name="PSN['.$i.']" value="'.$PSN[$i].'"
> size="25">';
> }
>
> After the form is submitted I'm getting an array
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> [3] =>
> [4] =>
> [5] =>
> )
>
> Now, I need to get rid off empty elements of the array, to get this:
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> )
>
> To do that I tried:
> foreach ($PSN as $value)
> {
> if (!empty($value)) $PSN_New[] = $value;
> }
> but every time I'm getting one additional element of the array:
>
> I tried
> foreach ($PSN as $value)
> {
> if ($value != '') $PSN_New[] = $value;
> }
> too - same result.
>
> Array
> (
> [0] => abc123
> [1] => ddd111
> [2] => poi987
> [3] =>
> )
>
> No space or anything else is "entered" in 4th field.
>
> What I'm doing wrong?
>
> Thanks for any help.
>
> -afan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Adam Zey wrote:
> function make_post($message)
> {
> $headers .= "POST /foo.php HTTP/1.1\r\n";
> $headers .= "Host: bar.com\r\n";
> $headers .= "Content-Type: application/octet-stream\r\n";
> $headers .= "Connection: keep-alive\r\n";
> $headers .= "Content-Length: " . strlen($message) . "\r\n";
> $headers .= "\r\n";
> return $headers . $message;
> }
>
> As far as I can tell, these are the absolute minimum set of
> headers you can get away with for a POST transaction (If you
> know how to use less, let me know, I use this in a situation
> where overhead matters).
Your Connection header is redundant, since that's the default value in
HTTP/1.1.
I would send the header but give it a value of close, since I see no
good reason to leave the TCP connection open until it times out. That's
a pretty big waste in a situation where overhead matters.
Hope that helps.
Chris
--
Chris Shiflett
Principal, OmniTI
http://omniti.com/
attached mail follows:
Adam Zey wrote:
> $headers .= "Content-Type: application/octet-stream\r\n";
I missed the context of this function, but it seems like you probably
mean to send:
Content-Type: application/x-www-form-urlencoded
Chris
--
Chris Shiflett
Principal, OmniTI
http://omniti.com/
attached mail follows:
Chris Shiflett wrote:
> Adam Zey wrote:
>
>> $headers .= "Content-Type: application/octet-stream\r\n";
>>
>
> I missed the context of this function, but it seems like you probably
> mean to send:
>
> Content-Type: application/x-www-form-urlencoded
>
> Chris
>
>
The context is a bit strange, these POST transactions are being used to
send data packets, since it's really the only way to send data to a
server-side PHP script. The scripts involved are used to tunnel
arbitrary TCP/IP data over a standard HTTP connection. The keepalive
means that many POST transactions can be done in one connection, saving
the latency and overhead involved in establishing new TCP/IP
connections. And the content type of an octet stream is used because
x-www-form-urlencoded would have to be decoded by the script on the
server side. With an octet stream, the server-side script can just read
the data in from php://input.
Thanks for the hint on the Connection header. It'll save me from more
overhead :)
Regards, Adam Zey.
attached mail follows:
I am creating an array of sessions
$_SESSION['results'][]
There may be up to 7 and I need to know why do I always get the
notice'Undefined index: results in...'?
How do I define or initialise the array if it only gets set once the form
has been posted (an answer has been given) on the page.
Is there a way to count/output (FOR EACH?) a set of session arrays like
this?
Ta,
Ross
attached mail follows:
Ross wrote:
> I am creating an array of sessions
>
> $_SESSION['results'][]
>
>
> There may be up to 7 and I need to know why do I always get the
> notice'Undefined index: results in...'?
>
> How do I define or initialise the array if it only gets set once the form
> has been posted (an answer has been given) on the page.
>
> Is there a way to count/output (FOR EACH?) a set of session arrays like
> this?
Before you try to access the $_SESSION['results'] array, do this...
if (!isset($_SESSION['results'])) $_SESSION['results'] = array();
As far as counting and outputting a session array there is nothing
special about them - they are the same as any other array variable. This
means you can use foreach, print_r, var_dump, etc on them.
-Stut
attached mail follows:
Ross wrote:
> I am creating an array of sessions
>
> $_SESSION['results'][]
always call session_start() before using $_SESSION
>
>
> There may be up to 7 and I need to know why do I always get the
> notice'Undefined index: results in...'?
>
> How do I define or initialise the array if it only gets set once the form
> has been posted (an answer has been given) on the page.
>
> Is there a way to count/output (FOR EACH?) a set of session arrays like
if (is_array($_SESSION['results'])) echo 'number of results is ', count($_SESSION['results']);
foreach ($_SESSION['results'] as $number => $data) {
echo "result number $number contains:";
var_dump($data);
}
> this?
>
>
> Ta,
>
> Ross
>
attached mail follows:
I am creating an array of sessions
$_SESSION['results'][]
There may be up to 7 and I need to know why do I always get the
notice'Undefined index: results in...'?
How do I define or initialise the array if it only gets set once the form
has been posted (an answer has been given) on the page.
Is there a way to count/output (FOR EACH?) a set of session arrays like
this?
Ta,
Ross
attached mail follows:
Ok,
I am using a hosted server and php is installed from the linux distro. I
usually have all the stuff in a php file somewhere so I can just go back
./configure, etc. I can't seem to find the configure for php on this box so
I can recompile but I know it is there as I can use php and see the version,
how can I find the configure to use?
Thanks!
attached mail follows:
Message-ID: <44D77E7D.40507
iamjochem.com>
Date: Mon, 07 Aug 2006 19:55:09 +0200
From: Jochem Maas <jochem
iamjochem.com>
MIME-Version: 1.0
To: blackwater dev <blackwaterdev
gmail.com>
CC: php-general
lists.php.net
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Subject: Re: [PHP] stupid question...compiling php
blackwater dev wrote:
> Ok,
>
> I am using a hosted server and php is installed from the linux distro. I
> usually have all the stuff in a php file somewhere so I can just go back
> ./configure, etc. I can't seem to find the configure for php on this
> box so
> I can recompile but I know it is there as I can use php and see the
> version,
> how can I find the configure to use?
php -l | grep configure
or
<? phpinfo();
>
> Thanks!
>
attached mail follows:
Ok, doing that now and it's taking a while. I can do phpinfo but that tells
me the config line and where the ini files are, not necessarily where the
configure stuff is to recompile...correct?
On 8/7/06, Jochem Maas <jochem
iamjochem.com> wrote:
>
> blackwater dev wrote:
> > Ok,
> >
> > I am using a hosted server and php is installed from the linux
> distro. I
> > usually have all the stuff in a php file somewhere so I can just go back
> > ./configure, etc. I can't seem to find the configure for php on this
> > box so
> > I can recompile but I know it is there as I can use php and see the
> > version,
> > how can I find the configure to use?
>
> php -l | grep configure
>
> or
>
> <? phpinfo();
>
> >
> > Thanks!
> >
>
>
attached mail follows:
Message-ID: <44D78D0C.1080201
iamjochem.com>
Date: Mon, 07 Aug 2006 20:57:16 +0200
From: Jochem Maas <jochem
iamjochem.com>
MIME-Version: 1.0
To: blackwater dev <blackwaterdev
gmail.com>
CC: php-general
lists.php.net
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Subject: Re: [PHP] stupid question...compiling php
blackwater dev wrote:
> Ok, doing that now and it's taking a while.
it might take forever. I made a thinko, it should have been:
php -i | grep configure
(it should be pretty much instantaneous)
I can do phpinfo but that
> tells
> me the config line and where the ini files are, not necessarily where the
> configure stuff is to recompile...correct?
correct, other than the system libs (which you refer to for some configure options)
- I doubt those would have change.
which pretty much leaves the php sources - and this you can download from
lots of places (you don't need to recompile from the same directory), if php
was installed as a package you will not have the source locally (probably) and
the chances are you'll be missing a stack of libs and/or development header files
which you would then need to install (again this depends on what configure flag
you're going to use)
>
> On 8/7/06, Jochem Maas <jochem
iamjochem.com> wrote:
>>
>> blackwater dev wrote:
>> > Ok,
>> >
>> > I am using a hosted server and php is installed from the linux
>> distro. I
>> > usually have all the stuff in a php file somewhere so I can just go
>> back
>> > ./configure, etc. I can't seem to find the configure for php on this
>> > box so
>> > I can recompile but I know it is there as I can use php and see the
>> > version,
>> > how can I find the configure to use?
>>
>> php -l | grep configure
>>
>> or
>>
>> <? phpinfo();
>>
>> >
>> > Thanks!
>> >
>>
>>
>
attached mail follows:
hi..
will php allow a user to enter field on a form, and compute aresult based on
the field, without having to reload the entire form, or will i need ajax...
any good examples on how to accomplish this..
thanks
attached mail follows:
[snip]
will php allow a user to enter field on a form, and compute aresult
based on
the field, without having to reload the entire form, or will i need
ajax...
[/snip]
You will only need JavaScript.
Remember, JavaScript is client-side, PHP is server-side.
attached mail follows:
On Mon, 2006-08-07 at 12:11 -0700, bruce wrote:
> hi..
>
> will php allow a user to enter field on a form, and compute aresult based on
> the field, without having to reload the entire form, or will i need ajax...
>
> any good examples on how to accomplish this..
You have 150 posts since February 5th 2005, are you pulling our leg? or
are you missing a few neurons?
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:
bruce wrote:
> hi..
>
> will php allow a user to enter field on a form, and compute aresult based on
> the field, without having to reload the entire form, or will i need ajax...
>
> any good examples on how to accomplish this..
>
> thanks
>
>
PHP is executed on the server, so you cannot campute something without
sending it back, reprocessing the form and put the result on the client
browser's. Some basic tasks can be done in the client with javascript,
but you have no much choices to accomplish what you want:
1)Ajax (change or reload a section or node of your document based on an
action)
2)Frames and Javascript (reload only a frame with javascript, for example)
There are many good examples out there of either ways.
Regards,
Mariano.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.7/410 - Release Date: 05/08/2006
attached mail follows:
Robert, have you studied Neuron Networks?
-----Original Message-----
From: Robert Cummings [mailto:robert
interjinn.com]
Sent: Tuesday, August 08, 2006 2:16 AM
To: bedouglas
earthlink.net
Cc: php-general
lists.php.net
Subject: Re: [PHP] php/ajax..
On Mon, 2006-08-07 at 12:11 -0700, bruce wrote:
> hi..
>
> will php allow a user to enter field on a form, and compute aresult based
on
> the field, without having to reload the entire form, or will i need
ajax...
>
> any good examples on how to accomplish this..
You have 150 posts since February 5th 2005, are you pulling our leg? or
are you missing a few neurons?
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. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
bruce wrote:
> hi..
>
> will php allow a user to enter field on a form, and compute aresult based on
> the field, without having to reload the entire form, or will i need ajax...
>
> any good examples on how to accomplish this..
>
> thanks
PHP is a server-side language. Javascript is a client-side language.
Such things need to be done on the client side, at which point they're
usually called AJAX. PHP can be used for the server-side of an AJAX
application.
Regards, Adam Zey.
attached mail follows:
On Mon, 2006-08-07 at 21:15 +0700, Peter Lauri wrote:
> Robert, have you studied Neuron Networks?
I've touched on them. Though I'm sure we both know to which kind of
neuron I was referring :)
Cheers,
Rob.
>
> -----Original Message-----
> From: Robert Cummings [mailto:robert
interjinn.com]
> Sent: Tuesday, August 08, 2006 2:16 AM
> To: bedouglas
earthlink.net
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] php/ajax..
>
> On Mon, 2006-08-07 at 12:11 -0700, bruce wrote:
> > hi..
> >
> > will php allow a user to enter field on a form, and compute aresult based
> on
> > the field, without having to reload the entire form, or will i need
> ajax...
> >
> > any good examples on how to accomplish this..
>
> You have 150 posts since February 5th 2005, are you pulling our leg? or
> are you missing a few neurons?
>
--
.------------------------------------------------------------.
| 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:
thanks for the reply...
that's pretty much what i had read/found out..
'ppreciate it..
-----Original Message-----
From: Adam Zey [mailto:azey
nit.ca]
Sent: Monday, August 07, 2006 12:04 PM
To: bedouglas
earthlink.net
Cc: php-general
lists.php.net
Subject: [PHP] Re: php/ajax..
bruce wrote:
> hi..
>
> will php allow a user to enter field on a form, and compute aresult based
on
> the field, without having to reload the entire form, or will i need
ajax...
>
> any good examples on how to accomplish this..
>
> thanks
PHP is a server-side language. Javascript is a client-side language.
Such things need to be done on the client side, at which point they're
usually called AJAX. PHP can be used for the server-side of an AJAX
application.
Regards, Adam Zey.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- application/pgp-signature attachment: OpenPGP digital signature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]