php-general Digest 3 Feb 2003 13:19:58 -0000 Issue 1861
Topics (messages 134069 through 134105):
Graphic Pie Charts
134069 by: Vernon
134073 by: Andrew Brampton
134083 by: michael kimsal
Re: Date and time problem
134070 by: Tom Rogers
134074 by: Larry E. Ullman
Re: Text size in image
134071 by: Tom Rogers
Listbox variable
134072 by: Denis L. Menezes
134093 by: Marek Kilimajer
Re: Help with include path
134075 by: John W. Holmes
Re: including files...
134076 by: John W. Holmes
mysql/php query - wrox
134077 by: Anthony Ritter
134078 by: Chris Shiflett
Re: php/mysql connection
134079 by: John W. Holmes
Re: question
134080 by: David Freeman
fread vs fgets
134081 by: Jeff Schwartz
Re: MySQL/PHP Associative Array Insert
134082 by: michael kimsal
134084 by: Chris Shiflett
Delete Related Table
134085 by: Remon Redika
pg_result_seek() weirdness
134086 by: Shot
POST with PHP -- please help !
134087 by: arthur.chereau
Re: POST_with_PHP_--_please_help_!
134088 by: olinux
134096 by: arthur.chereau
134103 by: Marek Kilimajer
mktime with Feb or Jan ..
134089 by: Torsten Rosenberger
134105 by: Maxim Maletsky
file copy
134090 by: Cenk Uysal
134104 by: Maxim Maletsky
relayed mail question
134091 by: WMB
134098 by: Manuel Lemos
Re: + in filenames
134092 by: Marek Kilimajer
Re: Directory size
134094 by: Marek Kilimajer
Re: safe mode problem
134095 by: Marek Kilimajer
134099 by: Chris Hayes
arrays;session variable; empty variable
134097 by: André Rosendaal
Re: how to write clean code.
134100 by: David Eisenhart
exclude some results with mysql
134101 by: Clement Noterdaem
134102 by: Negrea Mihai
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 ---
How do I create a graphic pie chart on the fly with PHP. I have already
figured out how to get the variables from the database and so forth am just
looking to create the graphics.
Thanks
--- End Message ---
--- Begin Message ---
You will have to look up how to use the GD libraries....
Look up Image Functions in the manual... Or you could also google for online
tutorials/classes
Andrew
----- Original Message -----
From: "Vernon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 03, 2003 1:19 AM
Subject: [PHP] Graphic Pie Charts
> How do I create a graphic pie chart on the fly with PHP. I have already
> figured out how to get the variables from the database and so forth am
just
> looking to create the graphics.
>
> Thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Vernon wrote:
How do I create a graphic pie chart on the fly with PHP. I have already
figured out how to get the variables from the database and so forth am just
looking to create the graphics.
Thanks
If you have the GD libraries installed, you could use the
jpgraph libraries - google for jpgraph (aditus.nu I think, but
can't remember)
Michael Kimsal
http://www.phpappserver.com
734-480-9961
--- End Message ---
--- Begin Message ---
Hi,
Monday, February 3, 2003, 11:10:36 AM, you wrote:
DLM> Hello friends.
DLM> The follwing code displays the date on my webpage :
DLM> echo date ("l dS of F Y h:i:s A");
DLM> However, I need to add 12 hrs to this date befor displaying on the webpage. Can
someone please help me to modify the above code?
DLM> Thanks
DLM> Denis
use strtotime to get the timestamp for date like this
echo date ("l dS of F Y h:i:s A", strtotime('+12 hours'));
If this is to compensate for a timezone difference you could also set the
timezone at the top of the page, for example
putenv('TZ=Australia/Brisbane');
Then date by itself will give the desired result
--
regards,
Tom
--- End Message ---
--- Begin Message ---
echo date ("l dS of F Y h:i:s A");
However, I need to add 12 hrs to this date befor displaying on the
webpage. Can someone please help me to modify the above code?
$t = time() + (12 * 60 * 60);
echo date ("l dS of F Y h:i:s A", $t);
Larry
--- End Message ---
--- Begin Message ---
Hi,
Monday, February 3, 2003, 8:24:00 AM, you wrote:
BVB> When creating an image using the image functions how do you control the
BVB> type face size?
If you are using imagestring() the size is determined by the font number (1 - 5)
for internal fonts. If you use true type fonts then the size is set in each call to
imagettftext() as one of the parameters.
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hello friends.
I have the following code :
The code works fine and the listbox is populated. But when I select a category and
press the "Search" button, the variable $CategoryName is not passed to the page
findbycategory.php. Can you please tell me where I am wrong?
Quote
<form name="form3" method="post" action="findbycategory.php">
<select name="CategoryName" id="select">
<?php
//connecting to the database
$link = mysql_connect("localhost","mydomain","mypass");
if ($link){
Print "";
} else {
Print "No connection to the database";
}
if (!mysql_select_db("mydomain_com")){
Print "Couldn't connect database";
} else {
Print ""."<br>\n";
}
$sql="SELECT DISTINCT CategoryName From Categories ORDER BY CategoryName";
$result=mysql_query($sql);
While($Category=mysql_fetch_array($result))
{
Print(" <OPTION VALUE=\"$Category[0]\">$Category[0]\n");
}
?>
</select>
<input type="submit" name="Submit3" value="Search">
</form></td>
Unquote
Thanks
Denis
--- End Message ---
--- Begin Message ---
Are you using $_POST superglobal? You should use $_POST['CategoryName']
in findbycategory.php
Denis L. Menezes wrote:
Hello friends.
I have the following code :
The code works fine and the listbox is populated. But when I select a category and press the "Search" button, the variable $CategoryName is not passed to the page findbycategory.php. Can you please tell me where I am wrong?
Quote
<form name="form3" method="post" action="findbycategory.php">
<select name="CategoryName" id="select">
<?php
//connecting to the database
$link = mysql_connect("localhost","mydomain","mypass");
if ($link){
Print "";
} else {
Print "No connection to the database";
}
if (!mysql_select_db("mydomain_com")){
Print "Couldn't connect database";
} else {
Print ""."<br>\n";
}
$sql="SELECT DISTINCT CategoryName From Categories ORDER BY CategoryName";
$result=mysql_query($sql);
While($Category=mysql_fetch_array($result))
{
Print(" <OPTION VALUE=\"$Category[0]\">$Category[0]\n");
}
?>
</select>
<input type="submit" name="Submit3" value="Search">
</form></td>
Unquote
Thanks
Denis
--- End Message ---
--- Begin Message ---
> I just finished loading the OS to my PC once again, installed and
> configured IIS and then installed PHP 4 but now, every page I try to
open
> tells me:
>
> Failed opening required '/icaam7/lib/stdlib.php'
> (include_path='.;c:\php4\pear')
Since there's a slash at the beginning, it's looking for
c:\icaam7\lib\stdlib.php to require() into the file. Is that right, or
should it be looking relative to the original file?
> even when my php.ini (under Windows folder) tells me that the
include_path
> is:
>
> include_path = ".;c:\php\includes;/"
>
> and no matter how I change this line in php.ini, the include_path
appears
> to be set ONLY to c:\php4\pear
>
> Any ideas on how to change that??? Is there another php.ini file
around?
Did you restart your webserver?
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
Another option is to place the files outside of your web root. The
include files can be anywhere on your machine, you just have to give a
good path when you include() them. If they are outside of your web root,
then they can never be called up in a browser.
Last option is to name the files with a .php extension, but this should
only be used if absolutely necessary. The reason it's a problem is that
your file can be called by itself and executed "out of context." This
may or may not be a big deal, depending on what you've got in the file.
If you only put functions or classes inside of includes, with no code
outside of the functions, then naming them with a .php extension doesn't
pose a problems.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
> -----Original Message-----
> From: Sunfire [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 02, 2003 6:08 PM
> To: Justin French; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] including files...
>
> how do you tell it to refuse file.inc with a .taxis file? the server i
> will
> be running this on is a public server and they dont allow .taxis files
i
> dont think...i will have to check and see
>
> ----- Original Message -----
> From: "Justin French" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "'Sunfire'" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Sunday, February 02, 2003 5:46 PM
> Subject: Re: [PHP] including files...
>
>
> > on 03/02/03 5:28 AM, John W. Holmes ([EMAIL PROTECTED])
wrote:
> >
> > > Pretty much. Only addition is to make sure filename.inc can't be
> viewed
> > > through the browser.
> >
> > ... by having apache refuse to server all .inc files through http,
via
> the
> > use of a .htaccess file (assuming apache server)
> >
> > Cheers,
> >
> > Justin
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Working on:
Win 98 / mysql 3.23.55 / php 4
I installed mysql 3.23.55 and wanted to check the user table in the mysql
db.
The query was:
SELECT User FROM user WHERE host='localhost';
The output was:
x------------x
user |
x------------x
| |
| |
root |
x------------x
2 rows in set
.....................................
In the Wrox book on PHP (page 396) by running that query it is:
x----------x
user |
x----------x
root |
x---------x
1 row in set
........................................
I'm not sure why I'm getting two rows.
Many thanks for your assistance.
TR
--- End Message ---
--- Begin Message ---
--- Anthony Ritter wrote:
> I installed mysql 3.23.55 and wanted to check the user
> table in the mysql db.
>
> The query was:
> SELECT User FROM user WHERE host='localhost';
This is a PHP list. There are mailing lists for MySQL that
you should check out if you are having trouble
understanding databases.
Your query returns two rows because you have two rows in
the database that match the condition:
host='localhost'
--
Chris
--- End Message ---
--- Begin Message ---
Because a default install of MySQL includes an anonymous user, one with
no username or password. There is also a root user with no password.
Read the MySQL manual on Installation and the GRANT command on how to
fix this.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
> -----Original Message-----
> From: Anthony Ritter [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 02, 2003 3:16 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php/mysql connection
>
> Newbie question and OT. Sorry.
>
> I am able to conncet to a mysql server with the following call to
> mysql_connect().
> $connect=@mysql_connect("","","");
>
> There are no parameters in the function call.
>
> Why can I connect if there are no parameters?
>
> However, if I give mysqladmin the password of:
> goodpassword
>
> and call:
>
> $connect=@mysql_connect("localhost","root","goodpassword");
>
> I connect.
>
> But if I call:
> $connect=@mysql_connect("localhost","root","badpassword");
>
> I cannot connect.
>
> Or from the command line...
>
> >From the command line:
> C:\Windows\cd c:\mysql\bin \\enter
>
> C:\mysql\bin> mysqld-shareware --standalone \\enter
>
> C:\mysql\bin> mysql \\enter note: no password have been entered.
>
> \\ I get the: Welcome to the MySql monitor...
> ...............................
> Or...
>
> C:\Windows\cd c:\mysql\bin \\enter
>
> C:\mysql\bin> mysqld-shareware --standalone \\enter
>
> C:\mysql\bin> mysql -u root - p \\ enter
>
> Enter password goodpassword \\ I get the: Welcome to the MySql
monitor...
>
>
> ............................
> C:\Windows\cd c:\mysql\bin \\enter
>
> C:\mysql\bin> mysqld-shareware --standalone \\enter
>
> C:\mysql\bin> mysql -u root - p \\ enter
> Enter password badpassword \\ I do _not_ get the: Welcome to the
MySql
> monitor...
> ........................
>
> Why is this when I thought it needs a password to connect to the MySql
> monitor?
> Thanks,
> TR
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Karl,
> what is a winmail.dat file?
Is it too much to ask that you do some of this sort of thing for
yourself?
Here, I'll help you...
1. Connect to the Internet (if necessary)
2. Load a web browser
3. Navigate to http://www.google.com/
4. Type "what is a winmail.dat file" into the search box
5. Take your pick of the 9000 or so results - some of which appear to
answer that question exactly
--- End Message ---
--- Begin Message ---
I'm trying to download various amount of information from handles opened by fsockopen.
fgets works but takes forever on very large files because it breaks on every line.
fread seems like it would work better but when I use a buffer of 1024 or 4096, it's
actually far SLOWER on small files.
What's the best way to get this data?
Thanks,
Jeff
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
--- End Message ---
--- Begin Message ---
Cditty wrote:
A co-worker is teaching me to move to the next level in php. I have
started using associative arrays for my scripts, but I am having a problem
using them to do an insert into MySQL. Can someone give me an example of
how to do an insert to the database using these arrays? My array is
this...$item['itemID']
If you want to go up to even another level:
<?
$x['name'] = "Mike's";
$x['phone'] = 'fsdlfksdf';
echo sql($x);
function sql($a) {
$k = implode(",",array_keys($a));
array_walk($a,'slashadd');
$v = "'".implode("','",$a)."'";
return "insert into ($k) values ($v)";
}
function slashadd(&$bar) { $bar = addslashes($bar); }
?>
Now all you need to do is pass more info to the $x
array, and it'll make the insert SQL for you,
including adding the slashes, and you don't need to
worry about { } or where to put quotes and backslashes
and all that crap. 1 column or 50 columns
is absolutely no more work for you.
Modify it just slightly some by using REPLACE with
MySQL and you've got updates and inserts taken care
of.
PLUG: That's the sort of thing we get up to during our
PHP Training Courses. More info at http://tapinternet.com/php
Michael Kimsal
http://phpappserver.com
http://www.phphelpdesk.com
734-480-9961
--- End Message ---
--- Begin Message ---
--- Cditty <[EMAIL PROTECTED]> wrote:
> A co-worker is teaching me to move to the next level
> in php. I have started using associative arrays for my
> scripts, but I am having a problem using them to do an
> insert into MySQL. Can someone give me an example of
> how to do an insert to the database using these arrays?
> My array is this...$item['itemID']
Using arrays is easy. For example:
$sql = "insert into blah (foo) values('";
$sql .= $item['item_id'];
$sql .= "')";
It isn't necessary for that to span three lines, but my
mail client will annihilate it otherwise. Just use
concatenation (.) to make things easy on yourself instead
of embedding your variable in the string (possible with
curly braces).
Of course, if you want to do it the cool way (which is what
your co-worker probably wants), look at Mr. Kimsal's
example:
--- michael kimsal <[EMAIL PROTECTED]> wrote:
> <?
> $x['name'] = "Mike's";
> $x['phone'] = 'fsdlfksdf';
> echo sql($x);
>
> function sql($a) {
> $k = implode(",",array_keys($a));
> array_walk($a,'slashadd');
> $v = "'".implode("','",$a)."'";
> return "insert into ($k) values ($v)";
> }
> function slashadd(&$bar) { $bar = addslashes($bar); }
> ?>
The only problem here is that there is no table name, which
is easily remedied. You probably want to pass the table
name as another argument. Also, use "replace into" for an
elegant way to insert the record if it does not exist
(based on whether your where clause matches) or update the
record if it does. Mr. Kimsal mentioned later in his
explanation I believe.
You can eliminate the slashadd() function and the
array_walk() call if you make sure your values are properly
escaped. If magic_quotes is on, you definitely want to
avoid the extra slashes, and it might be worth checking
whether it is on in your script, so that you don't depend
on any specific PHP configuration.
Finally, since this only builds your SQL statement, you can
enhance your function to execute the query for you (you
might want to add another argument for the database name)
and return true or false indicating success or failure.
Have fun, and tell your co-worker hello.
Chris
--- End Message ---
--- Begin Message ---
hi everyone..
i need delete two related table from mysql database,
but i am found and error..
this following my sql language :
DELETE FROM X INNER JOIN Y ON X.ID = Y.ID WHERE Y.No = 144;
i found an error in INNER JOIN syntax..
but i have successfully displaying 2 Related table in SELECT syntax..
my question..
any other way two delete two related table like above??..,
sorry if i ask out of topic..
need help... :)
--- End Message ---
--- Begin Message ---
Hello.
I have a problem with the newly introduced pg_result_seek() function.
Until PHP 4.3.0, when I had to iterate through one pg_query result many
times, I used the for loop:
$result = pg_query($db, $query);
// some outside loop
while ($whatever) {
for ($i = 0; $i < pg_num_rows($result); $i++) {
$row = pg_fetch_array($result, $i);
// do something
}
}
Now, with PHP 4.3.0, I'd like to use the cleaner pg_result_seek() (along
with the fact that pg_fetch_array() returns FALSE when there are no more
rows) - and I thought I know how:
$result = pg_query($db, $query);
// some outside loop
while ($whatever) {
pg_result_seek($result, 0);
while ($row = pg_fetch_array($result)) {
// do something
}
}
The problem is, when I use it this way, it misses the first row (it
looks like it iterated from the row nr 1, which is the second row in the
result). I even tried to call pg_result_seek($result, -1), but, not
surprisingly, it didn't work.
bugs.php.net doesn't have any entries about pg_result_seek(), so I guess
it must be something wrong with my code. Any ideas? Your help would be
most appreciated, as I'm fighting this since saturday without a clue.
Cheers,
-- Shot
--
No, I'm from Iowa. I only work in outer space.
-- Kirk, "Star Trek IV"
--- End Message ---
--- Begin Message ---
I need to redirect the browser to an external website and to automatically send POST
data to the site, without a form.
Basically I need header("Location: ...") - that is true redirection - with POST.
How can I do this with PHP ?
------------------------------------------
Faites un voeu et puis Voila ! www.voila.fr
--- End Message ---
--- Begin Message ---
You can do posts with curl
http://www.php.net/manual/en/ref.curl.php
olinux
--- "arthur.chereau" <[EMAIL PROTECTED]> wrote:
> I need to redirect the browser to an external
> website and to automatically send POST
> data to the site, without a form.
> Basically I need header("Location: ...") - that is
> true redirection - with POST.
>
> How can I do this with PHP ?
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
That's right, but with curl it's not a true redirection: you just print the content of
the target page, you don't redirect to the page.
What I need is "automated forms", that send the same data as forms but without user
interaction.
I can't use javascript to automatically send a form.
> You can do posts with curl
>
> http://www.php.net/manual/en/ref.curl.php
>
> olinux
>
>
> --- "arthur.chereau" <[EMAIL PROTECTED]> wrote:
> > I need to redirect the browser to an external
> > website and to automatically send POST
> > data to the site, without a form.
> > Basically I need header("Location: ...") - that is
> > true redirection - with POST.
> >
> > How can I do this with PHP ?
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
------------------------------------------
Faites un voeu et puis Voila ! www.voila.fr
--- End Message ---
--- Begin Message ---
no way without javascript
arthur.chereau wrote:
That's right, but with curl it's not a true redirection: you just print the content of the target page, you don't redirect to the page.
What I need is "automated forms", that send the same data as forms but without user interaction.
I can't use javascript to automatically send a form.
--- End Message ---
--- Begin Message ---
Hello
I parse the apache logfile and get a date format like this
[03/Feb/2003:09:22:50 +0100]
OK i split it with preg_match and the result is
Array
(
[0] => 03
[1] => Feb
[2] => 2003
[3] => 09
[4] => 22
[5] => 50
)
Now I'd like to convert it in a timestamp
with mktime but the problem is Feb ($t[1])
$lasttime = mktime($t[3], $t[4], $t[5], $t[1], $t[0], $t[2]);
Is it possible to convert Feb in 02,
BR/Torsten
--- End Message ---
--- Begin Message ---
readon about strtotime() function
www.php.net/strtotime
you might not even need to preg_match() it
--
Maxim Maletsky
[EMAIL PROTECTED]
Torsten Rosenberger <[EMAIL PROTECTED]> wrote... :
> Hello
>
> I parse the apache logfile and get a date format like this
> [03/Feb/2003:09:22:50 +0100]
> OK i split it with preg_match and the result is
>
> Array
> (
> [0] => 03
> [1] => Feb
> [2] => 2003
> [3] => 09
> [4] => 22
> [5] => 50
> )
>
> Now I'd like to convert it in a timestamp
> with mktime but the problem is Feb ($t[1])
>
> $lasttime = mktime($t[3], $t[4], $t[5], $t[1], $t[0], $t[2]);
>
> Is it possible to convert Feb in 02,
>
> BR/Torsten
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
hi,
how can i copy a file from web to my local disk?
http://www.xxx.com/xxx.gif
i try to get xxx.gif to my local disk...
--- End Message ---
--- Begin Message ---
You must change the headers for the file so it is being downloaded.
Something like this:
header('Content-Type: GIF'); // not sure of this one
header('Content-Length: ' . filesize('file.gif'));
header("Content-Disposition: attachment;
filename=\"file.gif\"");
--
Maxim Maletsky
[EMAIL PROTECTED]
"Cenk Uysal" <[EMAIL PROTECTED]> wrote... :
> hi,
>
> how can i copy a file from web to my local disk?
>
> http://www.xxx.com/xxx.gif
>
> i try to get xxx.gif to my local disk...
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Situation:
1) have a website with www.widexs.nl called www.webwabwob.nl
2) have a domainname with www.bulkregister.com and basicDNS service
3) have configured basicDNSservice of bulkregister to transfer to
www.webwabwob.nl
Problem:
All mail send to specific addressee ( [EMAIL PROTECTED] ) is unable to be
received, error message received shown below.
Question:
Where's the problem, how can I set up my website to receive and accept these
emails?
Hope there's someone able to help me here, it would be appreciated very
much, thanks,
Martin
quote-----
The Postfix program
<[EMAIL PROTECTED]>: Name service error for MAIL.rtinsmetsers.com: Host not
found
unquote----
--- End Message ---
--- Begin Message ---
Hello,
On 02/03/2003 07:57 AM, Wmb wrote:
<[EMAIL PROTECTED]>: Name service error for MAIL.rtinsmetsers.com: Host not
found
Because there is no DNS record for the domain MAIL.rtinsmetsers.com .
--
Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
That double quote is escaped
[EMAIL PROTECTED] wrote:
On Fri, 31 Jan 2003, Marek Kilimajer wrote:
I use this:
$name=strtr( $name,
" ?*#$%^:+=<>/\"",
"______________");
I'm hoping that double quote was a typo??
Ed
--- End Message ---
--- Begin Message ---
there is no php function for this, you can use unix command du or do it
in a loop
Antti wrote:
How do I get the directory size? Suppose there is a function for this.
antti
--- End Message ---
--- Begin Message ---
what you did should work (you must be root to change owner). You can use
-R switch to change owner recursively
Gurvinder Singh wrote:
hi
i create a php page dynamically in my php script. this page include one of
my other php file. when i run the newly created script i get this error
Warning: SAFE MODE Restriction in effect. The script whose uid is 48 is not
allowed to access file.php owned by uid 831
Is there a way to handle this.
i even tried chown to change the newly created file's owner to be 831 but it
doesnt seem to work
Thanks & Regards
Gurvinder
--- End Message ---
--- Begin Message ---
At 11:39 3-2-03, you wrote:
what you did should work (you must be root to change owner). You can use
-R switch to change owner recursively
Gurvinder Singh wrote:
hi
i create a php page dynamically in my php script. this page include one of
my other php file. when i run the newly created script i get this error
Warning: SAFE MODE Restriction in effect. The script whose uid is 48 is not
allowed to access file.php owned by uid 831
Is there a way to handle this.
i even tried chown to change the newly created file's owner to be 831 but it
doesnt seem to work
I think you did it just the wrong way round, the way i read it the owner of
the file you wanted to read already was 831, so try to chown it to 48.
Safe mode writes files with chmod 750, so now effectively 0 for the php
script that tries to reach it. In stead of chowning, you can also chmod the
file to read (file.php) to 777, if you do not mind the security too much,
if possible take the file out of the www directory.
I have a big problem with safe mode now with a script that needs to create
subdirectories itself, so with every new added course i would need to go
and change the chmod by FTP.
--- End Message ---
--- Begin Message ---
Hi,
I have spend several hours on the following issue, and I can't figure out
what I am doing wrong.
Consider the next function:
function CreateFileForRealPlayer () {
global $playlist;
$filename = $playlist[0]['url'];
header("Content-Type: audio/x-pn-realaudio;");
echo ($filename);
}
This is a simplified version of the actual function: here, the function
should get a url from a session variable ($playlist), and create a Real file
on-the-fly that references to this file.
The function works in Netscape (both cookies enabled and disabled), and in
IE with cookies disabled, but not in IE when cookies are enabled. For some
reason, in that configuration the value assigned to $filename is an empty
string when it is echoed. However, it DOES have the proper value after the
line
$filename = $playlist[0]['url'];
I am certain there is nothing wrong with the session variable itself (as
said, it works in the configurations I mention above; it's the value of
$filename that behaves strangely in IE. Any ideas? I am using php 4.0.4pl1
on HP-UX, IE 6.0, Win XP client side.
TIA
André Rosendaal
--- End Message ---
--- Begin Message ---
Another template engine you could consider is Smarty http://smarty.php.net/.
One can write very elegant code using such an templating system
david
>
> it is also good idea to separate html from the code, for instance by using
> some template engine.
>
> rush
--- End Message ---
--- Begin Message ---
what's wrong in this SQL line??
"SELECT name FROM users WHERE email<>'[EMAIL PROTECTED]' (...)"
I want every names, except people with an email "@domaine.com"...
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
use "like"
SELECT name FROM users WHERE email not like '[EMAIL PROTECTED]'
On Monday 03 February 2003 13:05, Clement Noterdaem wrote:
> what's wrong in this SQL line??
>
> "SELECT name FROM users WHERE email<>'[EMAIL PROTECTED]' (...)"
>
> I want every names, except people with an email "@domaine.com"...
- --
Negrea Mihai
http://www.negrea.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD4DBQE+PlP88hhhNOp8KlQRAnZJAJdj/txQ/hnxlDTYA7dLW2VcmloCAJ9Px8fN
rAC32oNdKnyYx/mcSGrxpg==
=LkxR
-----END PGP SIGNATURE-----
--- End Message ---