php-general Digest 31 Aug 2003 11:33:49 -0000 Issue 2269
Topics (messages 161279 through 161290):
Re: Table format needs php correction
161279 by: Curt Zirzow
Help with copy()/uploading a file
161280 by: James Johnson
Re: Problems with $DOCUMENT_ROOT being blank
161281 by: Chris Shiflett
Re: rand() function not working right
161282 by: john
161283 by: John T. Beresford
161284 by: Curt Zirzow
161285 by: john
password systems
161286 by: Dennis Gearon
Question about the scope of functions
161287 by: Phillip S. Baker
Re: Question about the scope of functions - I solved it
161288 by: Phillip S. Baker
Re: PHP - XHTML converter to HDML or WML
161289 by: Alexandru COSTIN
manual/eng
161290 by: php.sati.bps.metta.lk
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 ---
* Thus wrote Gloria L. McMillan ([EMAIL PROTECTED]):
> This is all so advanced. Is it ready to be in place of the table HTML that I
> already have?
>
Yes it should be. I hope it isn't so advanced that you can't
understand what exactly I'm doing. That would rather defeat the
purpose of me writing that up.
> I copied it to word and saved it as a .txt file. IN IE it looked better than in my
> Netscape.
My appologies for that, I havn't tested the site in mozilla/netscape
yet, only IE and opera. I'm actually downloading mozilla right now.
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Hi,
I need some help with the copy() function in order to allow a user to upload
an image. The image will need to be in a folder that I can access it's URL
for display in a page.
The hosting company, www.dreamhost.com, isn't too helpful with my requests
for help.
I have the following code:
$webServer ="/home/campuscb/ftp.campuscorkboard.com/adimages/";
$destFile = $webServer;
$destFile .= $img1_name;
if($img1_name!=""){
copy("$img1","$destFile") or die("Couldn't copy the file");
}
else{
die("No input file specified!$img1_name");
}
Dreamhost claims I must have Anon FTP activated in order to use the copy()
function.
I went ahead and set Anon FTP setup on the server. According to the admin
panel, I have the following settings:
Path:/home/campuscb/ftp.campuscorkboard.com
Directory blocks are on except for Stor
When I run it, I get the following message in the browser:
Warning: open_basedir restriction in effect. File is in wrong directory in
/home/.paco/campuscb/campuscorkboard.com/upload.php on line 28 Couldn't copy
the file
Any help would be appreciated.
Thanks,
James
--- End Message ---
--- Begin Message ---
--- brad e <[EMAIL PROTECTED]> wrote:
> When i echo $DOCUMENT_ROOT...
$_SERVER['DOCUMENT_ROOT']
http://www.php.net/register_globals
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
youre not the only one .. i just installed 4.3.3 and $x = rand(1,173);
always returns 101 for $x
i changed to mt_rand(1,173); and that always returns 142 ???
weirdness .. dont tell me this is happening to only me?
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "php general list" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 4:29 AM
Subject: [PHP] rand() function not working right
> I'm using the latest php and the rand() function isn't working properly
when
> giving it any min and max arguments.
> It does work without anything between the () but if I put a min and max,
> then only the min value always gets chosen.
>
> Is that a bug? Is that new?
>
> I'm not using an old php version, and it makes no difference to seed or
not.
> I've switched to mt_rand() and it seems to work fine with min/max so far..
>
> --
> Didier Godefroy
> mailto:[EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I can confirm that the funtion works fine using php 4.3.0. on Mac OS X.
While this may not be of any help, I will test on a later install on
a test server.
Thanks,
John
At 4:15 PM +1000 8/31/03, john wrote:
youre not the only one .. i just installed 4.3.3 and $x = rand(1,173);
always returns 101 for $x
i changed to mt_rand(1,173); and that always returns 142 ???
weirdness .. dont tell me this is happening to only me?
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "php general list" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 4:29 AM
Subject: [PHP] rand() function not working right
I'm using the latest php and the rand() function isn't working properly
when
giving it any min and max arguments.
It does work without anything between the () but if I put a min and max,
then only the min value always gets chosen.
Is that a bug? Is that new?
I'm not using an old php version, and it makes no difference to seed or
not.
I've switched to mt_rand() and it seems to work fine with min/max so far..
--
Didier Godefroy
mailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
===========================
John T. Beresford
Apple Certified Technical Coordinator
http://www.deewi.com/
405.760.0794
--- End Message ---
--- Begin Message ---
* Thus wrote john ([EMAIL PROTECTED]):
> youre not the only one .. i just installed 4.3.3 and $x = rand(1,173);
> always returns 101 for $x
>
> i changed to mt_rand(1,173); and that always returns 142 ???
>
> weirdness .. dont tell me this is happening to only me?
it works find with 4.3.3RC1 on unix. I'm curious if this is an OS
issue, what OS are you running php on?
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
hope not ... winxp
----- Original Message -----
From: "Curt Zirzow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 31, 2003 5:13 PM
Subject: Re: [PHP] rand() function not working right
> * Thus wrote john ([EMAIL PROTECTED]):
> > youre not the only one .. i just installed 4.3.3 and $x = rand(1,173);
> > always returns 101 for $x
> >
> > i changed to mt_rand(1,173); and that always returns 142 ???
> >
> > weirdness .. dont tell me this is happening to only me?
>
> it works find with 4.3.3RC1 on unix. I'm curious if this is an OS
> issue, what OS are you running php on?
>
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Anyone have any sources of noun/verb/adjective lists for password
generation?
--- End Message ---
--- Begin Message ---
Greetings People,
Now basically I am trying to set up an easy way to have key value pairs
listed in a DB, and then be able to call the name of the key as a variable
later in the code of the page and list the corresponding value in the DB. I
am almost there. However I just need to figure out some scope issues with
functions.
I want to create variables with names on the fly through a function and
have them last beyond the life of the function.
However I do not want to have to declare each key/variable as a global
variable in the function, will defeat the purpose of this.
I have the following DB table
sao_key sao_value
app_past_enroll 1
something 0
something_else 1
yet 1
I have the following function
function key_value ( $mysql ) {
if ( $sao_row = $mysql -> fetchRow() ) {
do {
${"$sao_row[0]"} = $sao_row[1]; // Create a
variablle to pull the radio variable name
} while ( $sao_row = $mysql -> fetchRow() );
}
}
I have the following code
$sql = "SELECT sao_key, sao_value FROM staff_app_options
$sao = new MySQL ( $sql ); # Create an object with the above query
key_value ( $sao );
echo 'Past Enrollment = ' . $app_past_enroll . NL;
echo 'something = ' . $something . NL;
echo 'something_else = ' . $something_else . NL;
echo 'yet = ' . $yet . NL;
So how do I get the script to read $app_past_enroll as a variable after it
has been created by the function?
Thanks for your help.
Phillip
--- End Message ---
--- Begin Message ---
Hey all,
Nevermind this. I just solved it myself.
I found out it does not matter when you decalre a variable as global (other
than I guess before you use it)
So I made my function this way.
function key_value ( $mysql ) {
if ( $sao_row = $mysql -> fetchRow() ) {
do {
global ${"$sao_row[0]"};
${"$sao_row[0]"} = $sao_row[1]; // Create a
variablle to pull the radio variable name
} while ( $sao_row = $mysql -> fetchRow() );
}
}
and it works like a charm.
Phillip
At 02:14 AM 8/31/2003 -0700, you wrote:
Greetings People,
Now basically I am trying to set up an easy way to have key value pairs
listed in a DB, and then be able to call the name of the key as a variable
later in the code of the page and list the corresponding value in the DB.
I am almost there. However I just need to figure out some scope issues
with functions.
I want to create variables with names on the fly through a function and
have them last beyond the life of the function.
However I do not want to have to declare each key/variable as a global
variable in the function, will defeat the purpose of this.
I have the following DB table
sao_key sao_value
app_past_enroll 1
something 0
something_else 1
yet 1
I have the following function
function key_value ( $mysql ) {
if ( $sao_row = $mysql -> fetchRow() ) {
do {
${"$sao_row[0]"} = $sao_row[1]; // Create a
variablle to pull the radio variable name
} while ( $sao_row = $mysql -> fetchRow() );
}
}
I have the following code
$sql = "SELECT sao_key, sao_value FROM staff_app_options
$sao = new MySQL ( $sql ); # Create an object with the above query
key_value ( $sao );
echo 'Past Enrollment = ' . $app_past_enroll . NL;
echo 'something = ' . $something . NL;
echo 'something_else = ' . $something_else . NL;
echo 'yet = ' . $yet . NL;
So how do I get the script to read $app_past_enroll as a variable after it
has been created by the function?
Thanks for your help.
Phillip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Blessings
Phillip
+++++++++++++++++++++++++++++++++++++++++++++++++++
IMPORTANT: This email message (including attachments, if any) is intended
for the use of the individual addressee(s) named above and may contain
information that is confidential, privileged or unsuitable for overly sensitive
persons with low self-esteem, no sense of humor or irrational religious
beliefs. If you are not the intended recipient, any dissemination,
distribution
or copying of this email is not authorized (either explicitly or
implicitly) and
constitutes an irritating social faux pas. Unless the word absquatulation
has been used in its correct context somewhere other than in this warning,
it does not have any legal or no grammatical use and may be ignored. No
animals were harmed in the transmission of this email, although the barking
dachshund next door is living on borrowed time, let me tell you. Those of
you with an overwhelming fear of the unknown will be gratified to learn that
there is no hidden message revealed by reading this warning backwards,
so just ignore that Alert Notice from Microsoft. However, by pouring a
complete circle of salt around yourself and your computer you can ensure
that no harm befalls you, your family or your pets. If you have received this
email in error, please add some nutmeg and egg whites, whisk and place
in a warm oven for 40 minutes.
+++++++++++++++++++++++++++++++++++++++++++++++++++
--- End Message ---
--- Begin Message ---
Hello,
If you want an elegant solution, you should grab Krysalis Foundation
from http://www.interakt.ro/products/Krysalis/.
It is an open platform that will allow you to easily publish content into an
XML/XSL approach, and will take all the configuration hassles away from you.
Then create site with a preferences module (see the Komplete Lite sample
for this), and then detect the user client in it using the standard PHP
server variables, and choose a set of XSL files (skin) to server your
content dynamically for the specified client.
This means that you will write the application logic once, and the
presentation layer multiple times, and everything will then function
naturally in the KRysalis MVC approach (one controller, one model, multiple
views choosed dynamically)
Alexandru
--
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
"Joe Harman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey maybe you guys can help me out here.
>
> I would like to start developing for WAP enabled devices. since there
> are a lot of people out there who still have phones that use different
> version of WML and still some that use HDML. and then the new phones
> being able to display XHTML. I would like to either find a parser or
> make one that will convert a XHTML file to be compatable with the older
> mark-up languages. does anyone have experience with this?
>
> Give you an example.. I have a Sanyo SCP-4700 on the Sprint PCS network.
> only HDML 3.0 and WML 1.1 is compatable.. So I run into a lot of
> different errors.
>
> So the first step would be to figure out how to determine a cell phone
> user's browser. So what's it capable of WML 1.1 or WML 2.0, HDML.. Or
> XHTML
>
> Appreciate the feedback,
>
> Joe Harman
>
> http://www.HarmanMedia.com
>
> Have you ever noticed? Anybody going slower than you is an idiot, and
> anyone going faster than you is a maniac. - George Carlen
>
>
--- End Message ---
--- Begin Message ---
Hi all,
I tried to download the manual of php
wget http://www.php.net/manual/en/
I got a lot of files but not linked to read off line
the links where all to the website.
http://www.php.net/manual/en/faq.php
http://www.php.net/manual/en/zend.configuration-macros.php
Can someone please help me with a site that I can download
the manual of php in a format that I can read off line.
regards
Metta
--
A saying of the Buddha from http://metta.lk/
Whoever tries to seek happiness without hurting others, can find happiness.
Random Dhammapada Verse 132
--- End Message ---