Re: [PHP] Won't save session ids?

2002-04-26 Thread Johan Holst Nielsen



Kirk Johnson wrote:

> The coding style needs to match the register_globals setting in php.ini.
>
> register_globals on:
>
> $accountsession = $session;
> $accountemail = $email;
> session_register("accountsession");
> session_register("accountemail");

Oh, sorry... I have just tried so many ways... but this works!

Thank you very much :o)

Regards,
Johan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] good php hosting environments

2002-04-26 Thread hamish

Hello,
I'm looking for a really good, professional hosting environment in the uk 
that supports php (not in safe mode)), mysql and offers the use of a secure 
server and mail server. I'm looking for a client of mine who needs to rely 
on their site being up, and so needs a hoster who has enough redundancy in 
all systems. We have a budget of between £200 and £400 a year, but don't 
want to get stuck with bandwidth charges, database usage, etc etc..
It would be good if the hoster also offered a remote control panel as well 
as ftp access to the server.
Does any one have any suggested companies, or companies that they've had 
good experiences using? 

cheers
Hamish 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] good php hosting environments

2002-04-26 Thread Brian McGarvie

havva look at 34sp.com

I use them for virtually all my clients. Tho gimme a shout in siz months
or so I'm going to be running a web farm ;)


  Brian M McGarvie,
eCommerce Co-ordinator/Consultant

[ www.mcgarvie.net | www.lennox-mckinlay.co.uk]


-Original Message-
From: hamish [mailto:[EMAIL PROTECTED]]
Sent: 26 April 2002 08:59
To: [EMAIL PROTECTED]
Subject: [PHP] good php hosting environments


Hello,
I'm looking for a really good, professional hosting environment in the
uk 
that supports php (not in safe mode)), mysql and offers the use of a
secure 
server and mail server. I'm looking for a client of mine who needs to
rely 
on their site being up, and so needs a hoster who has enough redundancy
in 
all systems. We have a budget of between £200 and £400 a year, but don't

want to get stuck with bandwidth charges, database usage, etc etc..
It would be good if the hoster also offered a remote control panel as
well 
as ftp access to the server.
Does any one have any suggested companies, or companies that they've had

good experiences using? 

cheers
Hamish 

-- 
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




[PHP] how to use session data in other php scripts

2002-04-26 Thread Deval Parikh

Hi,

I have one string variable in script a.php, I regester
this variable to session name testsess.

this link redirects to another script b.php then how i
get that string var from session.

basically I want to store var. serverside and use them
in to different scripts.

If any one help me let me know.

thanks,

~ deval

__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] GD: º becomes $

2002-04-26 Thread hugh danaher

Another solution would be to add another imagestringup with only the "O"
character  at the right size and location.
Hope this helps,
Hugh
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 25, 2002 11:40 PM
Subject: Re: [PHP] GD: º becomes $


At 25.04.2002  18:03, you wrote:
>   When I create an image, º becomes $. Actually a small $. (pratically
>half-sized). Maybe it's a "s" with a tail. I really have never seen this
>character before :-)
>
>   An example:
>
>$im = @ImageCreate (450, 500)
> or exit ("Cannot Initialize new GD image stream");
>$background_color = ImageColorAllocate ($im, 255, 255, 255);
>$text_color = ImageColorAllocate ($im, 0, 0, 0);
>$horizonte = 465;
>$vertical = 25;
>$pasta = 'Pasta Nº: ';
>ImageStringUp ($im, 5, $vertical, $horizonte,  $pasta, $text_color);
>ImagePng ($im,'etiqueta.png');
>
>   Outputs:
>
>Pasta N$:
Shouldn´t you load the font you want to uses, before you use it?
something like $font=imageTTFloadfont("yourfont.ttf") // untested, cannot
find the manual right now
And is the char, you want to use, available in that font?

HTH Oliver


--
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




[PHP] Combine SQL query OT

2002-04-26 Thread Richard Baskett

Is there a way I can combine these queries?

$result = queryDB("SELECT count(ResumeID) FROM Resumes WHERE
typeEmploy='1'");
$numEmp = mysql_result($result,0);
$result = queryDB("SELECT count(ResumeID) FROM Resumes WHERE
typeContract='1'");
$numCon = mysql_result($result,0);
$result = queryDB("SELECT count(ResumeID) FROM Resumes WHERE typeTemp='1'");
$numTem = mysql_result($result,0);

Rick

"The greatest trick the devil ever played was convincing the world he didn't
exist." - Unknown


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Callin PHP gurus...figure this out

2002-04-26 Thread r

Greetings All,
(Special greetings go out to Steve for excellient previous help - Thanks
again dude)
Calling all PHP gurus, have broked my head over this but cant seem to figure
this out in c,perl or java servlets.
Am new to PHP so dont even know the common functions leave alone the answer
to this problem.
Heres the setup:
I have a form with just one TEXTAREA
Data from this form is entered directly into the database

BUT...

everytime a user presses the ENTER or RETURN key on the keyboard, when the
PHP script validates the form
I want it to add  it should also add a  if the line is say75
charactors long & if there is no  or enter key pressed..
If it finds any "  it should convert it to '

Any ideas?

Any help appreciated.
Have a great day.
-Ryan A.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem on Load CSV file to Mysql through PHP Script

2002-04-26 Thread Jack

Dear all
I had a problem which trying to load data to Mysql Table,
Here is my code in my HTML:



Untitled Document



  



The code above is to see if the variable passed from other form($select) is
"HKD RATE"  or not , if it is, then it will call Mysql to perform LOAD DATA
from a csv to hkd_deposit1 table.
As the result comes out that the mysql didn't do any thing at all, it
doesn't import the data from hkd_rate.csv to hkd_deposit1.
I had tested using different query , which change the 'importquery' to
"delete from hkd_deposit" in php, by using this as the query, it works!It
did delete all the record from hkd_deposit table!

I had test the query in myCC program which design for MYSQL Operation, it
can successfully import the csv file into table, but i don't know why it
won't work with php script!

Pls give advice see if i got anything wrong in php!


--
Thx a lot!
Jack
[EMAIL PROTECTED]








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Array function to delete

2002-04-26 Thread Ford, Mike [LSS]

> -Original Message-
> From: Nathan [mailto:[EMAIL PROTECTED]]
> Sent: 25 April 2002 21:01
> 
> Apparently in 4.1.X this is true... I'd been running 4.0.6 
> for a long time (until 4.1.2 was
> released), and must have coded it in the earlier version. I 
> stand corrected! :-)

H'mmm, I think you must have an even longer memory than that, since the following 
script:

>  $array = array();
> $array[0] = "zero";
> $array[1] = "one";
> $array[2] = "two";
> $array[3] = "three";
> 
> unset($array[1]);
> 

  echo "version=" . phpversion() . "";

> foreach ($array as $key=>$value) {
> echo $key." = ".$value."";
> }
> ?>

when run on my server produces:

version=4.0.5
0 = zero
2 = two
3 = three

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Session.save_path in php.ini

2002-04-26 Thread Maciej Gruszczynski

Probably the php exec couldn't find your php.ini script or it's in the wrong
directory.
Try to use simple phpinfo() function in your php script to check where the
php.ini file should be.
Default directory is something like /usr/local/php/etc/


--

Maciej Gruszczynski
<[EMAIL PROTECTED]>

Freelance Polska sp. z o.o.
"Creative Talents for Business"
pl. Konstytucji 4/15
00-522 Warszawa
tel. 622 49 70
fax 622 49 69
http://www.freelance.pl

 ---
 Note:  The information contained in this message may be privileged and
confidential and protected from disclosure.  If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify the sender immediately by replying to the message and deleting
it from your computer. Thank you.



Uzytkownik "Tim Loram" <[EMAIL PROTECTED]> napisal w wiadomosci
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Having some issues with the session.save_path value in php.ini
>
> Whatever I change this value to it always ends up trying to save the
> temporary session info in /tmp (the default setting in php.ini).
>
> I can overide the value by setting a new path in the actual php script
> using session_save_path("my/path/here") but if I don't specify a path like
> this it always attempts to save in /tmp (c:\tmp\) even though the value in
> the php.ini file says otherwise
>
> Why is this happening ?
>
> HELP!
>
> Cheers.
>
> Tim Loram
> LaTiS Centre
> University of Exeter
> Queens Building
> Queens Drive
> Exeter
> EX4 4QH
>
> Tel: (01392) 263721
> http://latis.ex.ac.uk/
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Callin PHP gurus...figure this out

2002-04-26 Thread Michael Virnstein

if you want to write into the database, i wouldn't convert newline to .
do this
when you read from the database using nl2br($var) ot convert every newline
in $var to .
default  after 75 characters if no  was found before.
if you don't care about word-splitting, you could do the following:

//INSERT TO DATABASE
//max number of chars per line
$maxchars = 75;
//lets say $var is the content of your textarea
$lines = explode("\n", $var);

// text we want to write to the db
$newtext = "";

foreach ($lines as $line) {
if (strlen($line) > $maxchars) {
$newtext .= substr($line, 0, $maxchars)."\n";
$newtext .= substr($line, $maxchars)."\n";
}
}


// SELECT FROM DATABASE

//lets say $var is the selected content
echo nl2br($var);

This is very simple solution. It won't look for words and splits after the
word
and if your line is 76 chars long, it'll convert it into two lines, onw with
75 chars
and one with 1 char. but it's a start i think.

Regards Michael




"R" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn">news:000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn...
> Greetings All,
> (Special greetings go out to Steve for excellient previous help - Thanks
> again dude)
> Calling all PHP gurus, have broked my head over this but cant seem to
figure
> this out in c,perl or java servlets.
> Am new to PHP so dont even know the common functions leave alone the
answer
> to this problem.
> Heres the setup:
> I have a form with just one TEXTAREA
> Data from this form is entered directly into the database
>
> BUT...
>
> everytime a user presses the ENTER or RETURN key on the keyboard, when the
> PHP script validates the form
> I want it to add  it should also add a  if the line is
say75
> charactors long & if there is no  or enter key pressed..
> If it finds any "  it should convert it to '
>
> Any ideas?
>
> Any help appreciated.
> Have a great day.
> -Ryan A.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Combine SQL query OT

2002-04-26 Thread php3

Addressed to: Richard Baskett <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from Richard Baskett <[EMAIL PROTECTED]> Fri, 26 Apr 2002 01:47:17 
-0700
>
> Is there a way I can combine these queries?
>
> $result = queryDB("SELECT count(ResumeID) FROM Resumes WHERE
> typeEmploy='1'");
> $numEmp = mysql_result($result,0);
> $result = queryDB("SELECT count(ResumeID) FROM Resumes WHERE
> typeContract='1'");
> $numCon = mysql_result($result,0);
> $result = queryDB("SELECT count(ResumeID) FROM Resumes WHERE typeTemp='1'");
> $numTem = mysql_result($result,0);



Try:


SELECT SUM( IF( typeEmploy = 1, 1, 0 )) AS Employ,
   SUM( IF( typeContract = 1, 1, 0 )) AS Contract,
   SUM( IF( typeTemp = 1, 1, 0 )) AS Temp
FROM Resumes



If type* is always either 1 or 0 you can lose the if:

   SUM( typeEmploy ) AS Employ ...


Rick

Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Callin PHP gurus...figure this out

2002-04-26 Thread Michael Virnstein

forgot the " to ' conversion:
// this should do the job quite fine.
$var = str_replace ("\"", "'", $var);

Regards Michael

"Michael Virnstein" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> if you want to write into the database, i wouldn't convert newline to
.
> do this
> when you read from the database using nl2br($var) ot convert every newline
> in $var to .
> default  after 75 characters if no  was found before.
> if you don't care about word-splitting, you could do the following:
>
> //INSERT TO DATABASE
> //max number of chars per line
> $maxchars = 75;
> //lets say $var is the content of your textarea
> $lines = explode("\n", $var);
>
> // text we want to write to the db
> $newtext = "";
>
> foreach ($lines as $line) {
> if (strlen($line) > $maxchars) {
> $newtext .= substr($line, 0, $maxchars)."\n";
> $newtext .= substr($line, $maxchars)."\n";
> }
> }
>
>
> // SELECT FROM DATABASE
>
> //lets say $var is the selected content
> echo nl2br($var);
>
> This is very simple solution. It won't look for words and splits after the
> word
> and if your line is 76 chars long, it'll convert it into two lines, onw
with
> 75 chars
> and one with 1 char. but it's a start i think.
>
> Regards Michael
>
>
>
>
> "R" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> 000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn">news:000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn...
> > Greetings All,
> > (Special greetings go out to Steve for excellient previous help - Thanks
> > again dude)
> > Calling all PHP gurus, have broked my head over this but cant seem to
> figure
> > this out in c,perl or java servlets.
> > Am new to PHP so dont even know the common functions leave alone the
> answer
> > to this problem.
> > Heres the setup:
> > I have a form with just one TEXTAREA
> > Data from this form is entered directly into the database
> >
> > BUT...
> >
> > everytime a user presses the ENTER or RETURN key on the keyboard, when
the
> > PHP script validates the form
> > I want it to add  it should also add a  if the line is
> say75
> > charactors long & if there is no  or enter key pressed..
> > If it finds any "  it should convert it to '
> >
> > Any ideas?
> >
> > Any help appreciated.
> > Have a great day.
> > -Ryan A.
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Callin PHP gurus...figure this out

2002-04-26 Thread Michael Virnstein

this is wrong:
> foreach ($lines as $line) {
> if (strlen($line) > $maxchars) {
> $newtext .= substr($line, 0, $maxchars)."\n";
> $newtext .= substr($line, $maxchars)."\n";
> }
> }

try this:
foreach ($lines as $line) {
if (strlen($line) > $maxchars) {
 $newtext .= substr($line, 0, $maxchars)."\n";
$newtext .= substr($line, $maxchars)."\n";
} else {
$newtext .= $line."\n";
}
}

Regards Michael


"Michael Virnstein" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> if you want to write into the database, i wouldn't convert newline to
.
> do this
> when you read from the database using nl2br($var) ot convert every newline
> in $var to .
> default  after 75 characters if no  was found before.
> if you don't care about word-splitting, you could do the following:
>
> //INSERT TO DATABASE
> //max number of chars per line
> $maxchars = 75;
> //lets say $var is the content of your textarea
> $lines = explode("\n", $var);
>
> // text we want to write to the db
> $newtext = "";
>
> foreach ($lines as $line) {
> if (strlen($line) > $maxchars) {
> $newtext .= substr($line, 0, $maxchars)."\n";
> $newtext .= substr($line, $maxchars)."\n";
> }
> }
>
>
> // SELECT FROM DATABASE
>
> //lets say $var is the selected content
> echo nl2br($var);
>
> This is very simple solution. It won't look for words and splits after the
> word
> and if your line is 76 chars long, it'll convert it into two lines, onw
with
> 75 chars
> and one with 1 char. but it's a start i think.
>
> Regards Michael
>
>
>
>
> "R" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> 000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn">news:000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn...
> > Greetings All,
> > (Special greetings go out to Steve for excellient previous help - Thanks
> > again dude)
> > Calling all PHP gurus, have broked my head over this but cant seem to
> figure
> > this out in c,perl or java servlets.
> > Am new to PHP so dont even know the common functions leave alone the
> answer
> > to this problem.
> > Heres the setup:
> > I have a form with just one TEXTAREA
> > Data from this form is entered directly into the database
> >
> > BUT...
> >
> > everytime a user presses the ENTER or RETURN key on the keyboard, when
the
> > PHP script validates the form
> > I want it to add  it should also add a  if the line is
> say75
> > charactors long & if there is no  or enter key pressed..
> > If it finds any "  it should convert it to '
> >
> > Any ideas?
> >
> > Any help appreciated.
> > Have a great day.
> > -Ryan A.
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Callin PHP gurus...figure this out

2002-04-26 Thread Uchendu Nwachukwu

Easy as pie.

Firstly, make sure your TEXTAREA tab has the 'wrap' attribute set to 'hard'.
You can set the number of characters per line by using the 'cols' attribute.
So if you want to do a hard wrap every 75 characters, use .

Next, in your PHP script, run the text through nl2br() to add the  tags,
and run it through strtr("\"", "'") to change the double-quotes to single
quotes.

You'll also want to run the text through addslashes() before you submit it
to the database - to prevent people from passing commands to the database
through your form.

Hope that helps!

--
Uchendu Nwachukwu
newsreply AT unndunn DOT com - www.unndunn.com

"R" <[EMAIL PROTECTED]> wrote in message
000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn">news:000b01c1ed6e$d21595e0$0a6da8c0@lgwezec83s94bn...
> Greetings All,
> (Special greetings go out to Steve for excellient previous help - Thanks
> again dude)
> Calling all PHP gurus, have broked my head over this but cant seem to
figure
> this out in c,perl or java servlets.
> Am new to PHP so dont even know the common functions leave alone the
answer
> to this problem.
> Heres the setup:
> I have a form with just one TEXTAREA
> Data from this form is entered directly into the database
>
> BUT...
>
> everytime a user presses the ENTER or RETURN key on the keyboard, when the
> PHP script validates the form
> I want it to add  it should also add a  if the line is
say75
> charactors long & if there is no  or enter key pressed..
> If it finds any "  it should convert it to '
>
> Any ideas?
>
> Any help appreciated.
> Have a great day.
> -Ryan A.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: how to use session data in other php scripts

2002-04-26 Thread Uchendu Nwachukwu

Simply do the same thing in the other script. Create a session named
'testsess' and register the variable (under the same name) to it. That
variable will auttomatically take up the it was set to previously.

--
Uchendu Nwachukwu
newsreply AT unndunn DOT com - www.unndunn.com

"Deval Parikh" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have one string variable in script a.php, I regester
> this variable to session name testsess.
>
> this link redirects to another script b.php then how i
> get that string var from session.
>
> basically I want to store var. serverside and use them
> in to different scripts.
>
> If any one help me let me know.
>
> thanks,
>
> ~ deval
>
> __
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] 4.2 new GLOBALS question

2002-04-26 Thread Uchendu Nwachukwu

Try simply changing '$HTTP_GET_VARS' to '$_GET'.

so..

$start = isset($_GET['s']) ? $_GET['s'] : '';

--
Uchendu Nwachukwu
newsreply AT unndunn DOT com - www.unndunn.com

"Jeff Lewis" <[EMAIL PROTECTED]> wrote in message
00b101c1ecaf$2f429850$0100a8c0@cr983033a">news:00b101c1ecaf$2f429850$0100a8c0@cr983033a...
> Excuse me, you're right.  I was using this include as a "preprocess" step
as
> I was using ; to seperate arguments in the query string like this
> index.php?s=something;t=thing
>
> The preprocess step was breaking them apart and then I was doing this:
>
> $start = isset($HTTP_GET_VARS['s']) ? $HTTP_GET_VARS['s'] : '';
>
> Then back in index I did a if ($start == "somevalue")
>
> However, with 4.2, the $start is no longer populated.
>
> If I add an echo $start; right after the include, in 4.1.2 and below, it
> would echo the value of $start but now it keeps turning up empty.
>
> Jeff
> - Original Message -
> From: "John Holmes" <[EMAIL PROTECTED]>
> To: "'Jeff Lewis'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, April 25, 2002 10:13 PM
> Subject: RE: [PHP] 4.2 new GLOBALS question
>
>
> > > I am working on an odler script which loads up in index.php and a URL
> > is
> > > passed usually like index.php?s=something
> > >
> > > Now, around line 10 of index.php I do an include that pulls the value
> > of s
> > > via HTTP_POST_VARS and then I dump it into $start.
> >
> > What do you mean you "dump it into $start"?? Where is $start coming
> > from? Also, if you are using index.php?s=something, then 's' will be in
> > HTTP_GET_VARS or _GET ...not POST.
> >
> > ---John Holmes...
> >
> >
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mail() Returned mail: Data format error (

2002-04-26 Thread SeanW

Using this command

 mail(

 $mailrow[email],
   $subject,
   $spamstr,
   "From: me@mydomain\r\n
   Content-type: text/html; charset=us-ascii\r\n
   Contenet-Transfer-Encoding: 7bit\r\n
   MIME-Version: 1.0n"

);

I get bounces only from some servers with this message ,

Date: Mon, 15 Apr 2002 01:42:15 +1000
From: Mail Delivery Subsystem <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Returned mail: Data format error

The original message was received at Mon, 15 Apr 2002 01:42:07 +1000
from nobody@localhost

   - The following addresses had permanent fatal errors -
info@xx

   - Transcript of session follows -
... while talking to mx0.hyperlink.net.au.:
>>> MAIL From:<[EMAIL PROTECTED]> SIZE=18853 BODY=8BITMIME
<<< 553 5.1.8 <[EMAIL PROTECTED]>... Domain of sender address
[EMAIL PROTECTED] does not exist
501 [EMAIL PROTECTED] Data format error


Again most of the email go through but not for some, why does my domain how
as localhost.


Sean



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Counting number of value instances within an array

2002-04-26 Thread Neil Freeman

Hi guys,

Is there a function I can use to count the number of instances of a
value within an array. For example:
$a[0] = "bob";
$a[1] = "bob";
$a[2] = "fred";
$a[3] = "james";
$a[4] = "bob";
$a[5] = "carl";

Searching for 'bob' would return 3.

I've had a quick look through the array functions but didn't spot
anything obvious.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Counting number of value instances within an array

2002-04-26 Thread andrey

array_count_values()

HTH
Best regards,
Andrey Hristov

- Original Message - 
From: "Neil Freeman" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 1:24 PM
Subject: [PHP] Counting number of value instances within an array


> Hi guys,
> 
> Is there a function I can use to count the number of instances of a
> value within an array. For example:
> $a[0] = "bob";
> $a[1] = "bob";
> $a[2] = "fred";
> $a[3] = "james";
> $a[4] = "bob";
> $a[5] = "carl";
> 
> Searching for 'bob' would return 3.
> 
> I've had a quick look through the array functions but didn't spot
> anything obvious.
> 
> Neil
> 
>  Email:  [EMAIL PROTECTED]
>  [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




Re: [PHP] Counting number of value instances within an array

2002-04-26 Thread Neil Freeman

Sorry - don't worry. Found the function I require.

FYI : array_count_values()

Neil Freeman wrote:

> *
> This Message Was Virus Checked With : SAVI 3.54 Feb 2002
> Last Updated 24th April 2002
> *
>
> Hi guys,
>
> Is there a function I can use to count the number of instances of a
> value within an array. For example:
> $a[0] = "bob";
> $a[1] = "bob";
> $a[2] = "fred";
> $a[3] = "james";
> $a[4] = "bob";
> $a[5] = "carl";
>
> Searching for 'bob' would return 3.
>
> I've had a quick look through the array functions but didn't spot
> anything obvious.
>
> Neil
> 
>  Email:  [EMAIL PROTECTED]
>  [EMAIL PROTECTED]
> 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Callin PHP gurus...figure this out

2002-04-26 Thread John Holmes

Use wordwrap() to wrap the text to 75 characters and str_replace() to
replace " with '

www.php.net/wordwrap
www.php.net/str_replace

---John Holmes...

> -Original Message-
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 3:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Callin PHP gurus...figure this out
> 
> Greetings All,
> (Special greetings go out to Steve for excellient previous help -
Thanks
> again dude)
> Calling all PHP gurus, have broked my head over this but cant seem to
> figure
> this out in c,perl or java servlets.
> Am new to PHP so dont even know the common functions leave alone the
> answer
> to this problem.
> Heres the setup:
> I have a form with just one TEXTAREA
> Data from this form is entered directly into the database
> 
> BUT...
> 
> everytime a user presses the ENTER or RETURN key on the keyboard, when
the
> PHP script validates the form
> I want it to add  it should also add a  if the line is
> say75
> charactors long & if there is no  or enter key pressed..
> If it finds any "  it should convert it to '
> 
> Any ideas?
> 
> Any help appreciated.
> Have a great day.
> -Ryan A.
> 
> 
> --
> 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




Re: [PHP] good php hosting environments

2002-04-26 Thread Michael Egan

Hamish,

I've been using UK Linux (www.uklinux.net) both at home and at work and
they really have been excellent.

From their various types of membership I think you would be able to find
a level of service that you want within the price range you suggest.

Best of luck,

Michael

hamish wrote:
> 
> Hello,
> I'm looking for a really good, professional hosting environment in the uk
> that supports php (not in safe mode)), mysql and offers the use of a secure
> server and mail server. I'm looking for a client of mine who needs to rely
> on their site being up, and so needs a hoster who has enough redundancy in
> all systems. We have a budget of between £200 and £400 a year, but don't
> want to get stuck with bandwidth charges, database usage, etc etc..
> It would be good if the hoster also offered a remote control panel as well
> as ftp access to the server.
> Does any one have any suggested companies, or companies that they've had
> good experiences using?
> 
> cheers
> Hamish
> 
> --
> 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




php-general Digest 26 Apr 2002 13:12:28 -0000 Issue 1309

2002-04-26 Thread php-general-digest-help


php-general Digest 26 Apr 2002 13:12:28 - Issue 1309

Topics (messages 94696 through 94726):

HTTP GET with Digest Auth
94696 by: Eric

Re: Redirect
94697 by: Maxim Maletsky \(PHPBeginner.com\)
94698 by: John Holmes

mail() not sending -- Little bit OT
94699 by: David Redmond
94700 by: Miguel Cruz
94701 by: Justin French

Re: º becomes $
94702 by: heinisch.creaction.de
94708 by: hugh danaher

Re: Form validation
94703 by: Tarjei Huse

Re: Won't save session ids?
94704 by: Johan Holst Nielsen

good php hosting environments
94705 by: hamish
94706 by: Brian McGarvie
94726 by: Michael Egan

how to use session data in other php scripts
94707 by: Deval Parikh
94719 by: Uchendu Nwachukwu

Combine SQL query OT
94709 by: Richard Baskett
94715 by: php3.developersdesk.com

Callin PHP gurus...figure this out
94710 by: r
94714 by: Michael Virnstein
94716 by: Michael Virnstein
94717 by: Michael Virnstein
94718 by: Uchendu Nwachukwu
94725 by: John Holmes

Problem on Load CSV file to Mysql through PHP Script
94711 by: Jack

Re: Array function to delete
94712 by: Ford, Mike   [LSS]

Re: Session.save_path in php.ini
94713 by: Maciej Gruszczynski

Re: 4.2 new GLOBALS question
94720 by: Uchendu Nwachukwu

mail() Returned mail: Data format error (
94721 by: SeanW

Counting number of value instances within an array
94722 by: Neil Freeman
94723 by: andrey
94724 by: Neil Freeman

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 ---

I am trying to do an HTTP GET to pull down webpages, parse and store data
into a MySQL DB.
However the pages are using digest auth as outlines in RFC2617.  I am unable
to generate the
correct MD5 hash from the following code for using MD5-sess:

$realm = "[EMAIL PROTECTED]";
$nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093";
$opaque = "5ccc069c403ebaf9f0171e9517f40e41";
$stale = "false";
$qop = "auth";
$alg = "MD5-sess";
$cnonce = "0a4f113b";
$uri = "/dir/index.html";
$username = "Mufasa";
$nc = "0001";
$pwd = "Circle Of Life";


$auth_inf = "$username:$realm:$pwd";
$h1 = md5($auth_info);
$a1 = "$h1:$nonce:$cnonce";
$ha1 = md5($a1);
$a2 = "GET:$uri";
$ha2 = md5($a2);
$response = "$ha1:$nonce:$nc:$cnonce:$qop:$ha2";
echo $response;
$digest_resp = md5($response);

This is the example given in the RFC but the hash returns the incorrect
value and doesn't match the
one stated in the RFC paper.  Anyone else ever try this or know the correct
method of running the
hash for Digest Auth using MD5

Thanks
Eric
[EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---


With header you can do by using

header("Location: http://www.site.com/some/page.php?some=var";);

here's a good article about it:
http://www.phpbeginner.com/columns/shobhan/browser

other than that, you can always include(). But this is a little bit of a
mess.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins



> -Original Message-
> From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 2:10 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Redirect
> 
> Hi to all,
> 
> I am wondering if there are other ways to redirect users other than
using
> header()?
> 
> I have a script that if the user doesn't have enough money to buy an
item
> then it directs to one page and if they do then it directs them back
to the
> referring page.
> 
> Is this possible?
> 
> 
> Thanks
> Jennifer
> 
> --
> The sleeper has awaken
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---

You can use header() for that...just don't display anything before you
redirect them.

Otherwise you need a client side solution like a META REFRESH 

---John Holmes...

> -Original Message-
> From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 5:10 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Redirect
> 
> Hi to all,
> 
> I am wondering if there are other ways to redirect users other than
using
> header()?
> 
> I have a script that if the user doesn't have enough money to buy an
item
> then it directs to one page and if they do then 

[PHP] PHPlib sessions without a DB?

2002-04-26 Thread Alan McKay

Folks,

I was going through PHPlib for the first time to assess whether or not I
can use it on a current project, and it looks pretty clear to me that you
need a DB in order to use the session management.

My environment will be a Windows NT 4.0 SP5 box running Apache
and PHP.  I have no DB on the box, and am not allowed to introduce one,
nor am I allowed to rely on an external DB of any sort.

Is there a way to use PHPlib sessions in this environment?

thanks,
-Alan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Callin PHP gurus...figure this out

2002-04-26 Thread Michael Virnstein

nice one!
didn't notice this function yet!

Regards Michael

"John Holmes" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
000101c1ed33$e2f13c60$b402a8c0@mango">news:000101c1ed33$e2f13c60$b402a8c0@mango...
> Use wordwrap() to wrap the text to 75 characters and str_replace() to
> replace " with '
>
> www.php.net/wordwrap
> www.php.net/str_replace
>
> ---John Holmes...
>
> > -Original Message-
> > From: r [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 26, 2002 3:08 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Callin PHP gurus...figure this out
> >
> > Greetings All,
> > (Special greetings go out to Steve for excellient previous help -
> Thanks
> > again dude)
> > Calling all PHP gurus, have broked my head over this but cant seem to
> > figure
> > this out in c,perl or java servlets.
> > Am new to PHP so dont even know the common functions leave alone the
> > answer
> > to this problem.
> > Heres the setup:
> > I have a form with just one TEXTAREA
> > Data from this form is entered directly into the database
> >
> > BUT...
> >
> > everytime a user presses the ENTER or RETURN key on the keyboard, when
> the
> > PHP script validates the form
> > I want it to add  it should also add a  if the line is
> > say75
> > charactors long & if there is no  or enter key pressed..
> > If it finds any "  it should convert it to '
> >
> > Any ideas?
> >
> > Any help appreciated.
> > Have a great day.
> > -Ryan A.
> >
> >
> > --
> > 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




Re: [PHP] PHPlib sessions without a DB?

2002-04-26 Thread Matt Williams

On Friday 26 April 2002 2:25 pm, Alan McKay wrote:

> Folks,
>
> I was going through PHPlib for the first time to assess whether or not I
> can use it on a current project, and it looks pretty clear to me that you
> need a DB in order to use the session management.
>
> My environment will be a Windows NT 4.0 SP5 box running Apache
> and PHP.  I have no DB on the box, and am not allowed to introduce one,
> nor am I allowed to rely on an external DB of any sort.
>
> Is there a way to use PHPlib sessions in this environment?

Hi Alan

I think this is primarily due to the fact that the phplib sessions were 
around before php built in sessions.

In the current CVS for phplib there are some files that allow you to utilise 
php's built in sessions. This enables you to use file storage for sessions. 

I've been using the session4 stuff with phplib for a while and works well, 
but this is using db storage. I wouldn't imagine there will be a problem just 
using a different session container.

As for the default distribution of phplib I don't know if this can use files 
for session storage I haven't had the need to find out.

HTH 

matt

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re[2]: [PHP] PHPlib sessions without a DB?

2002-04-26 Thread Maxim Derkachev


MW> I've been using the session4 stuff with phplib for a while and works well, 
MW> but this is using db storage. I wouldn't imagine there will be a problem just 
MW> using a different session container.

Session4 without Session4_custom uses native php containers, e.g.
files or mm.

MW> As for the default distribution of phplib I don't know if this can use files 
MW> for session storage I haven't had the need to find out.




-- 
Best regards,
Maxim Derkachev mailto:[EMAIL PROTECTED]
System administrator & programmer,
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
www.books.ru, www.symbol.ru 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Re[2]: [PHP] PHPlib sessions without a DB?

2002-04-26 Thread Alan McKay


> Session4 without Session4_custom uses native php containers, e.g.
> files or mm.

Where is this "session4"?

I pulled "php-lib-stable" out of CVS yesterday and do not see this anywhere.
Is this part of the "bleeding edge" in "php-lib" (without the "stable") in CVS?

thanks,
-Alan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re[4]: [PHP] PHPlib sessions without a DB?

2002-04-26 Thread Maxim Derkachev

Hello Alan,

Friday, April 26, 2002, 5:57:29 PM, you wrote:

AM> Where is this "session4"?
AM> I pulled "php-lib-stable" out of CVS yesterday and do not see this anywhere.
AM> Is this part of the "bleeding edge" in "php-lib" (without the "stable") in CVS?

Yes, it is not in -stable yet, as I know.


-- 
Best regards,
Maxim Derkachev mailto:[EMAIL PROTECTED]
System administrator & programmer,
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
www.books.ru, www.symbol.ru 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: good php hosting environments

2002-04-26 Thread Mark Harwood

Try www.xcalibre.co.uk


"Hamish" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I'm looking for a really good, professional hosting environment in the uk
> that supports php (not in safe mode)), mysql and offers the use of a
secure
> server and mail server. I'm looking for a client of mine who needs to rely
> on their site being up, and so needs a hoster who has enough redundancy in
> all systems. We have a budget of between £200 and £400 a year, but don't
> want to get stuck with bandwidth charges, database usage, etc etc..
> It would be good if the hoster also offered a remote control panel as well
> as ftp access to the server.
> Does any one have any suggested companies, or companies that they've had
> good experiences using?
>
> cheers
> Hamish



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Load Balancing and PHP Sessions

2002-04-26 Thread J Smith


A better way to set this up might be to use a reverse proxy in front of 
www1.test.com and www2.test.com. Users would go to www.test.com and the 
reverse proxy would forward communications between the front-end and the 
servers in the back, thereby balancing the load. Cookies should still work 
fine, regardless of the server that actually sets them. (I'm not sure if 
PHP's built-in sessions would work...)

Since I'm assuming you're using Apache here, you'd most likely want to look 
into using Squid, which is a kick-ass proxy. Setting up the re-director is 
a bit of a hastle, since you basically have to write one from scratch, but 
it isn't too difficult. (There are lots of pre-made ones that can handle 
things like round-robins, randomness, all that jazz.)

J


Baumann Reto wrote:

> Is it possible to have sessions (via cookie) on a load balanced
> environment? Therefore having
> www1.test.com
> and www2.test.com
> 
> and share the same sessions? The systems can access the same file-system,
> but it seems that the session is not passed. Could this have something to
> do with session.cookie_domain?
> 
> Thanks for any help
> 
> Reto


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Tools for stress-testing?

2002-04-26 Thread Brian McGarvie

Just wondering what the best tool/utility is to stress test PHP/IIS 5
combination obviously on win2k server?


  Brian M McGarvie,
eCommerce Co-ordinator/Consultant

[ www.mcgarvie.net | www.lennox-mckinlay.co.uk]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Array function to delete

2002-04-26 Thread Liam Gibbs

> But PHP builtins will do exactly this, around 3
> times faster, too. :)

Yup. This one with array_diff was the winner. Thanks
to all for your suggestions and Lars for the working
one.

Liam


__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Tools for stress-testing?

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, Brian McGarvie wrote:
> Just wondering what the best tool/utility is to stress test PHP/IIS 5
> combination obviously on win2k server?

The old standard is ab (apache bench) which comes with Apache. It just 
sends out HTTP requests so it can be used to choke any web server.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mail() Returned mail: Data format error (

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, SeanW wrote:
> Using this command
> 
>  mail(
> 
>  $mailrow[email],
>$subject,
>$spamstr,
>"From: me@mydomain\r\n
>Content-type: text/html; charset=us-ascii\r\n
>Contenet-Transfer-Encoding: 7bit\r\n
>MIME-Version: 1.0n"
> );
> 
> I get bounces only from some servers with this message ,

Perhaps not all hosts can understand the Contenet-Transfer-Encoding 
header. It's a very special feature only supported by a few operating 
systems with FlexiSpell(tm).

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] sessions

2002-04-26 Thread Fifield, Mike

Is there a way to return the total number of sessions currently registered
on a server?
 
 



Re: [PHP] sessions

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, Fifield, Mike wrote:
> Is there a way to return the total number of sessions currently registered
> on a server?

You could count the files in the session store directory.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] sessions

2002-04-26 Thread Jan Peuker

If you use files you might get the contens of the folder where sessions
stored and just count.

Jan
- Original Message -
From: "Fifield, Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 5:57 PM
Subject: [PHP] sessions


> Is there a way to return the total number of sessions currently registered
> on a server?
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Code Troubles

2002-04-26 Thread Randum Ian

Hi all, Im having trouble with this code, can anyone help?

---



---

Cheers, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Code Troubles

2002-04-26 Thread Erik Price


On Friday, April 26, 2002, at 12:20  PM, Randum Ian wrote:

> Hi all, Im having trouble with this code, can anyone help?
>
> ---
>
> 
> $dbhost = "localhost";
> $dbuser = "dancepo_db";
> $dbpass = "database";
>
> function dbConnect($db="dancepo_db") {
> global $dbhost, $dbuser, $dbpass;
>
> $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass)
> or die("The site database appears to be down.");
>
> if ($db!="" and !@mysql_select_db($db))
> die("The site database is unavailable.");
>
> return $dbcnx;
> }
> ?>

Well, you've simply defined a few variables and then a function.  Do you 
expect it to do something?

Show us the context in which this function is used.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Code Troubles

2002-04-26 Thread Randum Ian

The trouble I got with it is the code is chucking back the "The site
database is unavailable." error and it is indeed available. I have used
other scripts at the same time and they are pumping it back. It is not a way
of coding I have used before and wondered if it was the code?

I am simply finding different ways of logging onto a mySQL db.

- Original Message -
From: "Erik Price" <[EMAIL PROTECTED]>
To: "Randum Ian" <[EMAIL PROTECTED]>
Cc: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 5:21 PM
Subject: Re: [PHP] Code Troubles


>
> On Friday, April 26, 2002, at 12:20  PM, Randum Ian wrote:
>
> > Hi all, Im having trouble with this code, can anyone help?
> >
> > ---
> >
> >  >
> > $dbhost = "localhost";
> > $dbuser = "dancepo_db";
> > $dbpass = "database";
> >
> > function dbConnect($db="dancepo_db") {
> > global $dbhost, $dbuser, $dbpass;
> >
> > $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass)
> > or die("The site database appears to be down.");
> >
> > if ($db!="" and !@mysql_select_db($db))
> > die("The site database is unavailable.");
> >
> > return $dbcnx;
> > }
> > ?>
>
> Well, you've simply defined a few variables and then a function.  Do you
> expect it to do something?
>
> Show us the context in which this function is used.
>
>
> Erik
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Code Troubles

2002-04-26 Thread Miguel Cruz

It helps to say what sort of trouble you're having; i.e., provide 
symptoms, exact text of error messages, etc.

miguel 

On Fri, 26 Apr 2002, Randum Ian wrote:
> Hi all, Im having trouble with this code, can anyone help?
> 
> ---
> 
>  
> $dbhost = "localhost";
> $dbuser = "dancepo_db";
> $dbpass = "database";
> 
> function dbConnect($db="dancepo_db") {
> global $dbhost, $dbuser, $dbpass;
> 
> $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass)
> or die("The site database appears to be down.");
> 
> if ($db!="" and !@mysql_select_db($db))
> die("The site database is unavailable.");
> 
> return $dbcnx;
> }
> ?>
> 
> ---
> 
> Cheers, Ian.
> ---
> Randum Ian
> DJ / Reviewer / Webmaster, DancePortal (UK) Limited
> [EMAIL PROTECTED]
> http://www.danceportal.co.uk
> DancePortal.co.uk - Global dance music media
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Code Troubles

2002-04-26 Thread Chris Wesley

> if ($db!="" and !@mysql_select_db($db))
> die("The site database is unavailable.");

you probably want an "or" before that die().

g.luck,
~Chris /"\
   \ / Microsoft Security Specialist:
X  The moron in Oxymoron.
   / \ http://www.thebackrow.net

On Fri, 26 Apr 2002, Randum Ian wrote:

> Hi all, Im having trouble with this code, can anyone help?
>
> ---
>
> 
> $dbhost = "localhost";
> $dbuser = "dancepo_db";
> $dbpass = "database";
>
> function dbConnect($db="dancepo_db") {
> global $dbhost, $dbuser, $dbpass;
>
> $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass)
> or die("The site database appears to be down.");
>
> if ($db!="" and !@mysql_select_db($db))
> die("The site database is unavailable.");
>
> return $dbcnx;
> }
> ?>
>
> ---
>
> Cheers, Ian.
> ---
> Randum Ian
> DJ / Reviewer / Webmaster, DancePortal (UK) Limited
> [EMAIL PROTECTED]
> http://www.danceportal.co.uk
> DancePortal.co.uk - Global dance music media
>
>
> --
> 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




Re: [PHP] Code Troubles

2002-04-26 Thread Miguel Cruz

Why not take the @ off @mysql_select_db($db) so that you can see which 
particular error is being returned? Or print mysql_error().

miguel

On Fri, 26 Apr 2002, Randum Ian wrote:

> The trouble I got with it is the code is chucking back the "The site
> database is unavailable." error and it is indeed available. I have used
> other scripts at the same time and they are pumping it back. It is not a way
> of coding I have used before and wondered if it was the code?
> 
> I am simply finding different ways of logging onto a mySQL db.
> 
> - Original Message -
> From: "Erik Price" <[EMAIL PROTECTED]>
> To: "Randum Ian" <[EMAIL PROTECTED]>
> Cc: "PHP" <[EMAIL PROTECTED]>
> Sent: Friday, April 26, 2002 5:21 PM
> Subject: Re: [PHP] Code Troubles
> 
> 
> >
> > On Friday, April 26, 2002, at 12:20  PM, Randum Ian wrote:
> >
> > > Hi all, Im having trouble with this code, can anyone help?
> > >
> > > ---
> > >
> > >  > >
> > > $dbhost = "localhost";
> > > $dbuser = "dancepo_db";
> > > $dbpass = "database";
> > >
> > > function dbConnect($db="dancepo_db") {
> > > global $dbhost, $dbuser, $dbpass;
> > >
> > > $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass)
> > > or die("The site database appears to be down.");
> > >
> > > if ($db!="" and !@mysql_select_db($db))
> > > die("The site database is unavailable.");
> > >
> > > return $dbcnx;
> > > }
> > > ?>
> >
> > Well, you've simply defined a few variables and then a function.  Do you
> > expect it to do something?
> >
> > Show us the context in which this function is used.
> >
> >
> > Erik
> >
> >
> >
> > 
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > [EMAIL PROTECTED]
> >
> >
> >
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Code Troubles

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, Chris Wesley wrote:
>> if ($db!="" and !@mysql_select_db($db))
>> die("The site database is unavailable.");
> 
> you probably want an "or" before that die().

How would that work?

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Code Troubles

2002-04-26 Thread Chris Wesley

if( $db ){
@mysql_select_db($db) or die("The site database is unavailable.");
}

To debug, use print( mysql_error ) instead of die to figure out what's
going on.  It's not that far of a leap in logic.

~Chris /"\
   \ / Microsoft Security Specialist:
X  The moron in Oxymoron.
   / \ http://www.thebackrow.net

On Fri, 26 Apr 2002, Miguel Cruz wrote:

> On Fri, 26 Apr 2002, Chris Wesley wrote:
> >> if ($db!="" and !@mysql_select_db($db))
> >> die("The site database is unavailable.");
> >
> > you probably want an "or" before that die().
>
> How would that work?
>
> miguel
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Mail responders

2002-04-26 Thread Dennis Gearon

All these lists that have addresses to subscribe, unsubscribe, etc, how
do they work? Are they using a cron job to poll the mail inbox through
sendmail? Does all mail not to a specific address at the site go to a
'catchall' address, which is then polled?
-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/
**OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail responders

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, Dennis Gearon wrote:
> All these lists that have addresses to subscribe, unsubscribe, etc, how
> do they work? Are they using a cron job to poll the mail inbox through
> sendmail? Does all mail not to a specific address at the site go to a
> 'catchall' address, which is then polled?

Usually the mail is delivered directly to a program rather than to a 
mailbox. The program receives the incoming message as input and handles it 
as it pleases.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

I need to pass an array from php to javascript,
change the ordering of the elements in javasc..
pass this reordered array back to php script?
Is it possible to do this and if so can anyone send me the basic code,
I've never written javascript? Thanks,

-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MySQL results

2002-04-26 Thread Nookie

Hello, I have a question: does anyone know how to divide MySQL results to 
pages and display on a website in "1 2 3 4" form?

Greetings,
Simon Kosok
http://www.shakira-online.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySQL results

2002-04-26 Thread Julie Meloni

N> Hello, I have a question: does anyone know how to divide MySQL results to 
N> pages and display on a website in "1 2 3 4" form?

Use LIMIT within your SELECT statement:
http://www.mysql.com/doc/S/E/SELECT.html



- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail responders

2002-04-26 Thread Dennis Gearon

How is that done on the box?


Miguel Cruz wrote:
> 
> On Fri, 26 Apr 2002, Dennis Gearon wrote:
> > All these lists that have addresses to subscribe, unsubscribe, etc, how
> > do they work? Are they using a cron job to poll the mail inbox through
> > sendmail? Does all mail not to a specific address at the site go to a
> > 'catchall' address, which is then polled?
> 
> Usually the mail is delivered directly to a program rather than to a
> mailbox. The program receives the incoming message as input and handles it
> as it pleases.
> 
> miguel

-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/
**OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail responders

2002-04-26 Thread JSheble

How would you set this up via PHP?  I've wanted to do this, but I always 
thought it was something specific to SendMail, and in a hosted environment, 
mucking about with SendMail generally isn't allowed...

I'd like to send an email to something like [EMAIL PROTECTED]  but have a 
PHP script get the mail and operate on it...

At 11:56 AM 4/26/2002 -0500, you wrote:
>On Fri, 26 Apr 2002, Dennis Gearon wrote:
> > All these lists that have addresses to subscribe, unsubscribe, etc, how
> > do they work? Are they using a cron job to poll the mail inbox through
> > sendmail? Does all mail not to a specific address at the site go to a
> > 'catchall' address, which is then polled?
>
>Usually the mail is delivered directly to a program rather than to a
>mailbox. The program receives the incoming message as input and handles it
>as it pleases.
>
>miguel
>
>
>--
>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




Re: [PHP] Mail responders

2002-04-26 Thread Miguel Cruz

1) Make sure you have built the CGI versions of PHP.

2) Create a PHP script file that begings with a bangpath invocation of the
PHP CGI binary. So, if your standalone PHP were located in
/usr/local/bin/php, your PHP file would start with:

  #!/usr/local/bin/php -q

3) In your script, use fopen, etc., to read from "php://stdin". The
incoming message will be there.

4) Do anything you like with the data. Store it in databases, create a 
reply and mail() it out, etc.

5) You'll have to convince sendmail to deliver mail for one or more
addresses to your PHP script file. With qmail it's a matter of creating a
.qmail file with |/path/name but I wouldn't know how to do that particular
thing with sendmail as I never use it.

Good luck!

miguel


On Fri, 26 Apr 2002, JSheble wrote:

> How would you set this up via PHP?  I've wanted to do this, but I always 
> thought it was something specific to SendMail, and in a hosted environment, 
> mucking about with SendMail generally isn't allowed...
> 
> I'd like to send an email to something like [EMAIL PROTECTED]  but have a 
> PHP script get the mail and operate on it...
> 
> At 11:56 AM 4/26/2002 -0500, you wrote:
> >On Fri, 26 Apr 2002, Dennis Gearon wrote:
> > > All these lists that have addresses to subscribe, unsubscribe, etc, how
> > > do they work? Are they using a cron job to poll the mail inbox through
> > > sendmail? Does all mail not to a specific address at the site go to a
> > > 'catchall' address, which is then polled?
> >
> >Usually the mail is delivered directly to a program rather than to a
> >mailbox. The program receives the incoming message as input and handles it
> >as it pleases.
> >
> >miguel
> >
> >
> >--
> >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




Re: [PHP] Mail responders

2002-04-26 Thread Richard Emery

You must have control over the Message Transfer Agent (MTA), such as
SendMail.
Or, if your host uses qmail MTA, you set it up using the dot-qmail files in
your user directory.

- Original Message -
From: Dennis Gearon <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 12:05 PM
Subject: Re: [PHP] Mail responders


How is that done on the box?


Miguel Cruz wrote:
>
> On Fri, 26 Apr 2002, Dennis Gearon wrote:
> > All these lists that have addresses to subscribe, unsubscribe, etc, how
> > do they work? Are they using a cron job to poll the mail inbox through
> > sendmail? Does all mail not to a specific address at the site go to a
> > 'catchall' address, which is then polled?
>
> Usually the mail is delivered directly to a program rather than to a
> mailbox. The program receives the incoming message as input and handles it
> as it pleases.
>
> miguel

--

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/
**OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

--
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




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
> I need to pass an array from php to javascript,
> change the ordering of the elements in javasc..
> pass this reordered array back to php script?
> Is it possible to do this and if so can anyone send me the basic code,
> I've never written javascript? Thanks,

How is the array reordered?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Maturity is only a short break in adolescence.
-- Jules Feiffer
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail responders

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 01:13, JSheble wrote:
> How would you set this up via PHP?  I've wanted to do this, but I always
> thought it was something specific to SendMail, and in a hosted environment,
> mucking about with SendMail generally isn't allowed...
>
> I'd like to send an email to something like [EMAIL PROTECTED]  but have a
> PHP script get the mail and operate on it...
>
> At 11:56 AM 4/26/2002 -0500, you wrote:
> >On Fri, 26 Apr 2002, Dennis Gearon wrote:
> > > All these lists that have addresses to subscribe, unsubscribe, etc, how
> > > do they work? Are they using a cron job to poll the mail inbox through
> > > sendmail? Does all mail not to a specific address at the site go to a
> > > 'catchall' address, which is then polled?
> >
> >Usually the mail is delivered directly to a program rather than to a
> >mailbox. The program receives the incoming message as input and handles it
> >as it pleases.

What are you actually trying to do? If you're trying to make a mailing-list 
type program then you're better off using an existing mailing list program.

Otherwise with sendmail you can use procmail. It's clunky but doable.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"The whole world is about three drinks behind."
-- Humphrey Bogart
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

In my php I had 4 buttons, up, down, top and bottom:
After detecting which element and which button was clicked I changed the
element position by
using array_slice, shift, unshift, array_merge etc..
I'm not sure what I'll do it JS
> On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
> > I need to pass an array from php to javascript,
> > change the ordering of the elements in javasc..
> > pass this reordered array back to php script?
> > Is it possible to do this and if so can anyone send me the basic code,
> > I've never written javascript? Thanks,
>
> How is the array reordered?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Maturity is only a short break in adolescence.
>   -- Jules Feiffer
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] good php editor for the mac

2002-04-26 Thread Tom Beidler

Could someone suggest a good php editor for the mac? I'm currently using
Dreamweaver because I like the site management and a wysiwyg html editor.
But otherwise it's a bummer because it doesn't support php. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
> In my php I had 4 buttons, up, down, top and bottom:
> After detecting which element and which button was clicked I changed the
> element position by
> using array_slice, shift, unshift, array_merge etc..
> I'm not sure what I'll do it JS

Well, depending on how you were reordering the array I was going to suggest 
you use php. Since you already have a version in php and you want to do it in 
javascript then ...

> > > I've never written javascript? Thanks,

I suggest you learn some javascript then think about how to "pass an array" 
to it from php :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The profession of book writing makes horse racing seem like a solid,
stable business.
-- John Steinbeck
[Horse racing *is* a stable business ...]
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] fsockopen

2002-04-26 Thread wm

this might be a stupid question, but what the hell...

can a web page be called and diplayed using the fsockopen and
fputs/fgets functions?

so instead of just using a normal href call i use a script and fsockopen
(not header(Location: )  ) etc.?

thanks.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] good php editor for the mac

2002-04-26 Thread Jackson Miller

There is a PHP plugin for Dreamweaver from AlphaSigma.
http://www.alphasigma.com

-Jackson

On Fri, 2002-04-26 at 13:33, Tom Beidler wrote:
> Could someone suggest a good php editor for the mac? I'm currently using
> Dreamweaver because I like the site management and a wysiwyg html editor.
> But otherwise it's a bummer because it doesn't support php. 
> 
> -- 
> 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




RE: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Leotta, Natalie (NCI/IMS)

Is there any reason that you have to use JS to redo the array?  I did
something like this once and had the buttons monitored by JS, then when you
click it set a hidden var (with a name like sort) and submitted the page.
Then my PHP read in everything and redrew the graph based on what we were
sorting by.  It wasn't as difficult as it sounds - the only problem was they
decided that it wasn't pertinent to that graph, so we aren't using it
anymore.  I don't know if I have any of the code left.

-Natalie

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 26, 2002 1:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] passing vars. betn. php and javascript


On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
> In my php I had 4 buttons, up, down, top and bottom:
> After detecting which element and which button was clicked I changed 
> the element position by using array_slice, shift, unshift, array_merge 
> etc.. I'm not sure what I'll do it JS

Well, depending on how you were reordering the array I was going to suggest 
you use php. Since you already have a version in php and you want to do it
in 
javascript then ...

> > > I've never written javascript? Thanks,

I suggest you learn some javascript then think about how to "pass an array" 
to it from php :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The profession of book writing makes horse racing seem like a solid, stable
business.
-- John Steinbeck
[Horse racing *is* a stable business ...]
*/

-- 
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




[PHP] auto_increment

2002-04-26 Thread webmaster

I'm using PHP v.4.0.6. and PostgreSQL 7.2.  Does any one know the
equivilant of auto_increment for postgresSQL?  For example when creating
a table:

$query = "CREATE table $tablename (id INT UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY, firstname TEXT, lastname TEXT, emailaddress
TEXT, )";

this works fine in MySQL, but I keep getting errors with PostgreSQL.

thanks for any help,
-Elkan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] passing authorization code

2002-04-26 Thread wm

hi,

.htaccess file requires user and pass.

anybody know how to pass this info with a script so that the user is
allowed into the directory? not in the url either. not
user:[EMAIL PROTECTED]

needs to be transparent.

the reason i want to do this is so that somebody can't path directly to
a .mov file, but so they can click on a link and a script can "fetch"
the file from the protected directory by passing the user and pass.  the
file needs to be
embedded in the web page.

thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] fsockopen

2002-04-26 Thread Vail, Warren

I haven't tried this, but why don't you just use fopen with a URL,
especially if you don't what to have to deal with the http header.  

I would think that if you do the fsockopen to port 80, you will need to use
the handshake protocol required by that server which involves the get/put
http headers.  fopen should handle all that for you.

http://www.php.net/manual/en/function.fopen.php


Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-Original Message-
From: wm [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 10:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] fsockopen


this might be a stupid question, but what the hell...

can a web page be called and diplayed using the fsockopen and
fputs/fgets functions?

so instead of just using a normal href call i use a script and fsockopen
(not header(Location: )  ) etc.?

thanks.




-- 
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




Re: [PHP] passing authorization code

2002-04-26 Thread Mark Gallagher



wm wrote:

> .htaccess file requires user and pass.
> 
> anybody know how to pass this info with a script so that the user is
> allowed into the directory? not in the url either. not
> user:[EMAIL PROTECTED]
> 
> needs to be transparent.
> 
> the reason i want to do this is so that somebody can't path directly to
> a .mov file, but so they can click on a link and a script can "fetch"
> the file from the protected directory by passing the user and pass.  the
> file needs to be
> embedded in the web page.

You could try saving a cookie?




-- 
Mark Gallagher


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Kevin Stone

This sounds susspiciously like a Javascript question to me.  :)

I wrote a PHP/Javascript system a while back that prints out an event
calendar on a client page.  The Javascript is copy&paste so you can have the
calendar show up on any web page anywhere in the world.  It works like
this..

The Javascript on the client's page redirects to the PHP script on my server
with display_dates and clientid in the URL string.  Then the PHP script
parses $_GET and extracts the requested data from the database.  Then the
PHP script does a redirect back to the originating Javascript (known by
$HTTP_REFERER) with the compressed data (again in the URL string).  The
Javascript does some simple parsing and generates the calendar table based
on the extracted values.

This sounds a lot like what you want to do.  But how you parse the data in
Javascript is obviously not a PHP question.  Are you're certain this
reordering isn't something that can be done in PHP?  I guess my real
question is what is the Javascript for?

-Kevin

- Original Message -
From: "Pushkar Pradhan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 11:23 AM
Subject: Re: [PHP] passing vars. betn. php and javascript


> In my php I had 4 buttons, up, down, top and bottom:
> After detecting which element and which button was clicked I changed the
> element position by
> using array_slice, shift, unshift, array_merge etc..
> I'm not sure what I'll do it JS

> > On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
> > > I need to pass an array from php to javascript,
> > > change the ordering of the elements in javasc..
> > > pass this reordered array back to php script?
> > > Is it possible to do this and if so can anyone send me the basic code,
> > > I've never written javascript? Thanks,
> >
> > How is the array reordered?
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> >
> > /*
> > Maturity is only a short break in adolescence.
> > -- Jules Feiffer
> > */
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> -Pushkar S. Pradhan
>
>
> --
> 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




RE: [PHP] passing authorization code

2002-04-26 Thread John Holmes

Place the .mov files outside of your web folders, and write a PHP file
that'll control the outputting of them.

You would link to the .php file just like you would a .mov file, but you
have the PHP check for a session or something to verify that the user
should be able to view the .mov file. If they are allowed, then send the
appropriate .mov headers with header() and then output the data.

---John Holmes...

> -Original Message-
> From: wm [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 11:01 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] passing authorization code
> 
> hi,
> 
> .htaccess file requires user and pass.
> 
> anybody know how to pass this info with a script so that the user is
> allowed into the directory? not in the url either. not
> user:[EMAIL PROTECTED]
> 
> needs to be transparent.
> 
> the reason i want to do this is so that somebody can't path directly
to
> a .mov file, but so they can click on a link and a script can "fetch"
> the file from the protected directory by passing the user and pass.
the
> file needs to be
> embedded in the web page.
> 
> thanks.
> 
> 
> --
> 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




RE: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

Actually I was frustrated trying to redirect to a new page and not being
able to pass the array along to the new page usign header(), I won't get
the array in my new page. Also I thought JS would be faster since the
client can submit after doing as many reorderings as he/she wants.

> Is there any reason that you have to use JS to redo the array?  I did
> something like this once and had the buttons monitored by JS, then when you
> click it set a hidden var (with a name like sort) and submitted the page.
> Then my PHP read in everything and redrew the graph based on what we were
> sorting by.  It wasn't as difficult as it sounds - the only problem was they
> decided that it wasn't pertinent to that graph, so we aren't using it
> anymore.  I don't know if I have any of the code left.
>
> -Natalie
>
> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 1:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] passing vars. betn. php and javascript
>
>
> On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
> > In my php I had 4 buttons, up, down, top and bottom:
> > After detecting which element and which button was clicked I changed
> > the element position by using array_slice, shift, unshift, array_merge
> > etc.. I'm not sure what I'll do it JS
>
> Well, depending on how you were reordering the array I was going to suggest
> you use php. Since you already have a version in php and you want to do it
> in
> javascript then ...
>
> > > > I've never written javascript? Thanks,
>
> I suggest you learn some javascript then think about how to "pass an array"
> to it from php :)
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> The profession of book writing makes horse racing seem like a solid, stable
> business.
>   -- John Steinbeck
>   [Horse racing *is* a stable business ...]
> */
>
> --
> 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
>

-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] good php editor for the mac

2002-04-26 Thread Richard Baskett

I would definitely use the Dreamweaver/BBEdit combination.  Dreamweaver for
your wysiwyg layout and then BBEdit for your hard core coding.  BBEdit is
the best programmers program out there.  And Dreamweaver.. Well I hear they
will be coming out with a new OS X version soon that will rock your socks :)
So look for it.. And my guess is that php will definitely be supported a
little more then it already is.. We'll see.. :)

Cheers!

Rick

"When a man won't listen to his conscience, it's usually because he doesn't
want advice from a total stranger." - Lindsey Stewart

> From: Tom Beidler <[EMAIL PROTECTED]>
> Date: Fri, 26 Apr 2002 10:33:43 -0700
> To: php list <[EMAIL PROTECTED]>
> Subject: [PHP] good php editor for the mac
> 
> Could someone suggest a good php editor for the mac? I'm currently using
> Dreamweaver because I like the site management and a wysiwyg html editor.
> But otherwise it's a bummer because it doesn't support php.
> 
> -- 
> 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




Re: [PHP] good php editor for the mac

2002-04-26 Thread Erik Price


On Friday, April 26, 2002, at 01:33  PM, Tom Beidler wrote:

> Could someone suggest a good php editor for the mac? I'm currently using
> Dreamweaver because I like the site management and a wysiwyg html 
> editor.
> But otherwise it's a bummer because it doesn't support php.

The ultimate Mac editor is BBEdit.  I use it night and day.  6.5.2 has 
syntax coloring for PHP, Perl, Python, JavaScript, HTML, XML, about a 
dozen other languages too.  Runs native in OS X.

Also you can use emacs if you have OS X, it's already installed.  But I 
prefer BBEdit.

BBEdit is only $79 if you "upgrade" to it from BBEdit Lite, which is the 
free version available at BareBones.com.  I asked the BareBones folks 
how they verify that someone actually has BBEdit Lite since this is 
free, and they said they don't -- you just tell them you want the 
discount for the upgrade.

There is also a full version demo of BBEdit that has all of the 
features, which works for 25 days or something like that.  Check it out, 
I did and promptly ordered my copy within a few days.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] good php editor for the mac

2002-04-26 Thread Kevin Stone

I'm told, BBEdit for MacOSX is solid, although I haven't used it.  I used to
work in BBEdit on OS9.  It was the best PERL editors I've ever used.  The
Mac's seamless integration with the interpretor is something that I really
miss.  But at the time the Mac did not support PHP so I was forced to
Windows/Homesite.. which in all honesty I really like as well even if it is
a bit clumsey by comparison.

Oh sorry.  So much for long drawn out answers to simple questions eh?  :)

-Kevin

- Original Message -
From: "Tom Beidler" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 11:33 AM
Subject: [PHP] good php editor for the mac


> Could someone suggest a good php editor for the mac? I'm currently using
> Dreamweaver because I like the site management and a wysiwyg html editor.
> But otherwise it's a bummer because it doesn't support php.
>
> --
> 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




RE: [PHP] Mail responders

2002-04-26 Thread Steve


< I'd like to send an email to something like [EMAIL PROTECTED]  but have a
< PHP script get the mail and operate on it...


You might want to reference an article from the May issue of Sysadmin
Magazine ( http://www.sysadminmag.com/ ) title 'Using Email to Perform UNIX
System Monitoring and Control' by Bob Dilworth. On the down side of your
question, the article describes how Perl and Sendmail is used to execute
commands, not PHP. This should give you some ideas on how to approach it
though.

-Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

Believe me I certainly don't want to ask a JS ques. here, I am reading
tutorials on the web!
I already accomplished reordering using PHP, I gave up on php since I
wasn't able to pass arrays betn. pages using header().
In PHP when user moves each element and submits up, down, top or bottom
there is server-client communication while in JS there will be
server-client comm. only at the end when a Done button is pressed.
i.e. SPEED :-)

> This sounds susspiciously like a Javascript question to me.  :)
>
> I wrote a PHP/Javascript system a while back that prints out an event
> calendar on a client page.  The Javascript is copy&paste so you can have the
> calendar show up on any web page anywhere in the world.  It works like
> this..
>
> The Javascript on the client's page redirects to the PHP script on my server
> with display_dates and clientid in the URL string.  Then the PHP script
> parses $_GET and extracts the requested data from the database.  Then the
> PHP script does a redirect back to the originating Javascript (known by
> $HTTP_REFERER) with the compressed data (again in the URL string).  The
> Javascript does some simple parsing and generates the calendar table based
> on the extracted values.
>
> This sounds a lot like what you want to do.  But how you parse the data in
> Javascript is obviously not a PHP question.  Are you're certain this
> reordering isn't something that can be done in PHP?  I guess my real
> question is what is the Javascript for?
>
> -Kevin
>
> - Original Message -
> From: "Pushkar Pradhan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 26, 2002 11:23 AM
> Subject: Re: [PHP] passing vars. betn. php and javascript
>
>
> > In my php I had 4 buttons, up, down, top and bottom:
> > After detecting which element and which button was clicked I changed the
> > element position by
> > using array_slice, shift, unshift, array_merge etc..
> > I'm not sure what I'll do it JS
>
> > > On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
> > > > I need to pass an array from php to javascript,
> > > > change the ordering of the elements in javasc..
> > > > pass this reordered array back to php script?
> > > > Is it possible to do this and if so can anyone send me the basic code,
> > > > I've never written javascript? Thanks,
> > >
> > > How is the array reordered?
> > >
> > > --
> > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > > Open Source Software Systems Integrators
> > > * Web Design & Hosting * Internet & Intranet Applications Development *
> > >
> > > /*
> > > Maturity is only a short break in adolescence.
> > > -- Jules Feiffer
> > > */
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> > -Pushkar S. Pradhan
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>

-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Kevin Stone

Okay I'm beginning to understand.  I don't think you have to use Javascript
in this situation you jsut have to be a little clever about how you build
your URL string.  You can send an array through the URL by splitting up each
value like this..

$url = 'http://www.domain.com/index.php?myarray[]='.$myarray[0];
for ($i=1; $i
To: "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 12:10 PM
Subject: RE: [PHP] passing vars. betn. php and javascript


> Actually I was frustrated trying to redirect to a new page and not being
> able to pass the array along to the new page usign header(), I won't get
> the array in my new page. Also I thought JS would be faster since the
> client can submit after doing as many reorderings as he/she wants.
>
> > Is there any reason that you have to use JS to redo the array?  I did
> > something like this once and had the buttons monitored by JS, then when
you
> > click it set a hidden var (with a name like sort) and submitted the
page.
> > Then my PHP read in everything and redrew the graph based on what we
were
> > sorting by.  It wasn't as difficult as it sounds - the only problem was
they
> > decided that it wasn't pertinent to that graph, so we aren't using it
> > anymore.  I don't know if I have any of the code left.
> >
> > -Natalie
> >
> > -Original Message-
> > From: Jason Wong [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 26, 2002 1:46 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] passing vars. betn. php and javascript
> >
> >
> > On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
> > > In my php I had 4 buttons, up, down, top and bottom:
> > > After detecting which element and which button was clicked I changed
> > > the element position by using array_slice, shift, unshift, array_merge
> > > etc.. I'm not sure what I'll do it JS
> >
> > Well, depending on how you were reordering the array I was going to
suggest
> > you use php. Since you already have a version in php and you want to do
it
> > in
> > javascript then ...
> >
> > > > > I've never written javascript? Thanks,
> >
> > I suggest you learn some javascript then think about how to "pass an
array"
> > to it from php :)
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> >
> > /*
> > The profession of book writing makes horse racing seem like a solid,
stable
> > business.
> > -- John Steinbeck
> > [Horse racing *is* a stable business ...]
> > */
> >
> > --
> > 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
> >
>
> -Pushkar S. Pradhan
>
>
> --
> 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




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Erik Price


On Friday, April 26, 2002, at 02:15  PM, Pushkar Pradhan wrote:

> Believe me I certainly don't want to ask a JS ques. here, I am reading
> tutorials on the web!
> I already accomplished reordering using PHP, I gave up on php since I
> wasn't able to pass arrays betn. pages using header().

If your arrays are not huge, why can you not simply use the GET method?

$array = array('mutant', 'zombie', 'psychic');
$temp_array = array();
foreach ($array as $freak) {
   $temparray[] = 'freaks[]=' . $freak;
}
$headerstring = implode('&', $temparray);

header('Location: http://www.domain.com/page.php?' . $headerstring);


The above code creates a querystring that should look like

freaks[]=mutant&freaks[]=zombie&freaks[]=psychic

Then, in your "receiving" PHP page, just do something like

foreach ($_GET['freaks'] as $freak) {
print $freak;
}

Or whatever processing you need to do.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Why is imageTTFtext function useless?(again)

2002-04-26 Thread Jim

Your problem doesn't have anything to do with PHP. The error says 
that libgd doesn't offer freetype support, so you need to get a more 
current version of gd.

Regards,

Jim Heffner




>No idea, check your config.log and see why it is failing.
>
>On Thu, 25 Apr 2002, zhaoxd wrote:
>
>>
>>  Whatever I tried ,it is also useless,why?
>>
>>  This time I compile it with freetype-1.3.1.when I used the test 
>>code , it also said  "libgd was not built with FreeType font 
>>support in /usr/local/apache/htdocs/test.php on line 14".
>>
>>  Would you mind tell me how you do this? I just wanna support 
>>FreeType font in my gd so as to use gd function like ImageTTFText 
>>,etc.
>>
>>  Thank you
>> 
>>zhaoxd
>>
>>  > It works fine.  Spell Header() right, or remove the header altogether so
>>  > you can see the error message.  I predict you will see a message telling
>>  > you it couldn't open the font file.
>>  >
>>  > -Rasmus
>>  >
>>  > On Thu, 25 Apr 2002, zhaoxd wrote:
>>  >
>>  > > hello,all:
>>  > >
>>  > > I have already installed gd-1.8.4 in php-4.1.2 with some 
>>libraries,such as libpng 
>>-1.2.0,freetype-1.3,zlib-1.1.4,freetype2,in my apache server which 
>>version is 1.3.24,and "phpinfo()" display php can support such 
>>soft,as follow:
>>  > > GD Support---enabled
>>  > > GD Version---1.6.2 or higher
>>  > > FreeType Support-enabled
>>  > > FreeType Linkage-with freetype
>>  > > JPG Support--enabled
>>  > > PNG Support--enabled
>>  > > WBMP Support-enabled
>>  > >
>>  > > But when I used the function related with ttf,like 
>>ImageTTFText or ImageTTFBox,I found it useless,in other words,no 
>>pictures were displayed in my IE.
>>  > > I don't understand why,is gd-1.8.4 can not support these functions?
>>  > >
>>  > > ps:my test code
>>  > > >  > > //define the type of inputting picture;
>>  > > Heder("content-type:image/png");
>>  > > //create picture
>>  > > $pic=imagecreate(240,30);
>>  > > //define color
>>  > > $black=imagecolorallocate($pic,0,0,0);
>>  > > $white=imagecolorallocate($pic,255,255,255);
>>  > > //define font copied from windows2000
>>  > > $font="fonts/simhei.ttf";
>>  > > //define characters to output
>>  > > $str = 
>>chr(0xE8).chr(0xB5).chr(0x9B).chr(0xE8).chr(0xBF).chr(0xAA).chr(0xE7).chr(0xBD).chr(0
>>  > > x91)." www.ccidnet.com";
>>  > > //write ttf in picture
>>  > > imageTTFText($pic,20,0,10,20,$white,$font,$str);
>>  > > //create png picture
>>  > > imagepng($pic);
>>  > > //release the memory occupied by the picture
>>  > > imagedestroy($pic);
>>  > > ?>
>>  > >
>>  > > Can anybody give a reply?
>>  > >
>>  > > Thank you
>>  > > 
>>zhaoxd
>>  > >
>>  > >
>>  >
>>  >
>>  > --
>>  > 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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] good php editor for the mac

2002-04-26 Thread Jess Planck

BBEdit is by far one of the best basic text editors I have ever seen on 
any platform. I use 6.1 (waiting on for an upgrade), and it runs OK on 
10.1.4. It would be great to see some tight PHP environment to work in, 
but I have yet to see it.

All BBEdit needs is some sort of ProjectBuilder style integration with 
PHP to make it great.

In fact with MacOS 10.x you can put most production applications 
(Apache, PHP, MySQL, etc..) on your local machine and make it quite 
powerful for testing and development.

jess.

On Friday, April 26, 2002, at 12:33 PM, Tom Beidler wrote:

> Could someone suggest a good php editor for the mac? I'm currently using
> Dreamweaver because I like the site management and a wysiwyg html 
> editor.
> But otherwise it's a bummer because it doesn't support php.
>
> --
> 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




[PHP] Microsoft Word & PHP

2002-04-26 Thread Vladislav Kulchitski


Hi,

Can anybody help me with this problem? Basically, I have thousands of MS
Word documents. What I need to do is to design an interface that will
let you submit more of them into the database, and it should index all
these documents, like extract keywords. Is this possible at all via PHP?
Also it should index or like re-index existing docs.

I would be greatful for some advise or tutorial that does that.

Thank you,
Vlad
http://vladik.tripod.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

Great! It works fine. Thanks to Kevin, Erik, Miguel and all others who
responded to this query since yesterday.
I have $QUERY_STRING in my php 4.0.6.



On Fri, 26 Apr 2002, Kevin Stone wrote:

> Okay I'm beginning to understand.  I don't think you have to use Javascript
> in this situation you jsut have to be a little clever about how you build
> your URL string.  You can send an array through the URL by splitting up each
> value like this..
>
> $url = 'http://www.domain.com/index.php?myarray[]='.$myarray[0];
> for ($i=1; $i {
> $url  .= '&myarray[]='.$myarray[$i];
> }
> header("Location: $url");
>
> You will get $_GET[myarray] on the other side.  OR you can do a single comma
> or semicolon delimited string and then explode(',' $myarray) on the other
> end to reconstitue the array.  Hope that helps.
>
> -Kevin
>
> - Original Message -
> From: "Pushkar Pradhan" <[EMAIL PROTECTED]>
> To: "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, April 26, 2002 12:10 PM
> Subject: RE: [PHP] passing vars. betn. php and javascript
>
>
> > Actually I was frustrated trying to redirect to a new page and not being
> > able to pass the array along to the new page usign header(), I won't get
> > the array in my new page. Also I thought JS would be faster since the
> > client can submit after doing as many reorderings as he/she wants.
> >
> > > Is there any reason that you have to use JS to redo the array?  I did
> > > something like this once and had the buttons monitored by JS, then when
> you
> > > click it set a hidden var (with a name like sort) and submitted the
> page.
> > > Then my PHP read in everything and redrew the graph based on what we
> were
> > > sorting by.  It wasn't as difficult as it sounds - the only problem was
> they
> > > decided that it wasn't pertinent to that graph, so we aren't using it
> > > anymore.  I don't know if I have any of the code left.
> > >
> > > -Natalie
> > >
> > > -Original Message-
> > > From: Jason Wong [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, April 26, 2002 1:46 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: [PHP] passing vars. betn. php and javascript
> > >
> > >
> > > On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
> > > > In my php I had 4 buttons, up, down, top and bottom:
> > > > After detecting which element and which button was clicked I changed
> > > > the element position by using array_slice, shift, unshift, array_merge
> > > > etc.. I'm not sure what I'll do it JS
> > >
> > > Well, depending on how you were reordering the array I was going to
> suggest
> > > you use php. Since you already have a version in php and you want to do
> it
> > > in
> > > javascript then ...
> > >
> > > > > > I've never written javascript? Thanks,
> > >
> > > I suggest you learn some javascript then think about how to "pass an
> array"
> > > to it from php :)
> > >
> > > --
> > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > > Open Source Software Systems Integrators
> > > * Web Design & Hosting * Internet & Intranet Applications Development *
> > >
> > > /*
> > > The profession of book writing makes horse racing seem like a solid,
> stable
> > > business.
> > > -- John Steinbeck
> > > [Horse racing *is* a stable business ...]
> > > */
> > >
> > > --
> > > 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
> > >
> >
> > -Pushkar S. Pradhan
> >
> >
> > --
> > 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
>

-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Variables not set

2002-04-26 Thread Liam Gibbs

I have a problem with my variables not being set. I
have a file I use for constants and functions,
structured like so:

$this = "this";
$that = "that";
.
.
.
function this() {
$h = $this;
$i = $that;
}

function that() {
}

Now, when I run this(), $this isn't set (even though
it's above it in the same file). I can pretty much
guess (when running a function, it won't parse through
the whole file, just skips to that function), but I
was wondering if there is another solution. I'd hate
to separate the variable settings and the functions,
but will if I have to.

__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Variables not set

2002-04-26 Thread Pushkar Pradhan

On Fri, 26 Apr 2002, Liam Gibbs wrote:
Shouldn't you be using GLOBAL to access $this, $that inside functions?
> I have a problem with my variables not being set. I
> have a file I use for constants and functions,
> structured like so:
>
> $this = "this";
> $that = "that";
> .
> .
> .
> function this() {
  GLOBAL $this;
  GLOBAL $that;
> $h = $this;
> $i = $that;
> }
>
> function that() {
> }
>
> Now, when I run this(), $this isn't set (even though
> it's above it in the same file). I can pretty much
> guess (when running a function, it won't parse through
> the whole file, just skips to that function), but I
> was wondering if there is another solution. I'd hate
> to separate the variable settings and the functions,
> but will if I have to.
>
> __
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Variables not set

2002-04-26 Thread Rasmus Lerdorf

Please read http://www.php.net/manual/en/language.variables.scope.php

On Fri, 26 Apr 2002, Liam Gibbs wrote:

> I have a problem with my variables not being set. I
> have a file I use for constants and functions,
> structured like so:
>
> $this = "this";
> $that = "that";
> .
> .
> .
> function this() {
> $h = $this;
> $i = $that;
> }
>
> function that() {
> }
>
> Now, when I run this(), $this isn't set (even though
> it's above it in the same file). I can pretty much
> guess (when running a function, it won't parse through
> the whole file, just skips to that function), but I
> was wondering if there is another solution. I'd hate
> to separate the variable settings and the functions,
> but will if I have to.
>
> __
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
>
> --
> 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




RE: [PHP] Variables not set

2002-04-26 Thread Steve Bradwell

I'm pretty new to php but I think your this() function you need to say:

$h = $$this;
$i = $$that;

which means the value of the var.

Sorry if I'm wrong.
-Steve

-Original Message-
From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 3:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variables not set


I have a problem with my variables not being set. I
have a file I use for constants and functions,
structured like so:

$this = "this";
$that = "that";
.
.
.
function this() {
$h = $this;
$i = $that;
}

function that() {
}

Now, when I run this(), $this isn't set (even though
it's above it in the same file). I can pretty much
guess (when running a function, it won't parse through
the whole file, just skips to that function), but I
was wondering if there is another solution. I'd hate
to separate the variable settings and the functions,
but will if I have to.

__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

-- 
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




RE: [PHP] Variables not set

2002-04-26 Thread Steve Bradwell

Ha, Sorry wrong instance here, ya global or pass the vars to the function.

-Original Message-
From: Steve Bradwell [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 3:13 PM
To: 'Liam Gibbs'; [EMAIL PROTECTED]
Subject: RE: [PHP] Variables not set


I'm pretty new to php but I think your this() function you need to say:

$h = $$this;
$i = $$that;

which means the value of the var.

Sorry if I'm wrong.
-Steve

-Original Message-
From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 3:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variables not set


I have a problem with my variables not being set. I
have a file I use for constants and functions,
structured like so:

$this = "this";
$that = "that";
.
.
.
function this() {
$h = $this;
$i = $that;
}

function that() {
}

Now, when I run this(), $this isn't set (even though
it's above it in the same file). I can pretty much
guess (when running a function, it won't parse through
the whole file, just skips to that function), but I
was wondering if there is another solution. I'd hate
to separate the variable settings and the functions,
but will if I have to.

__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

-- 
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Microsoft Word & PHP

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, Vladislav Kulchitski wrote:
> Can anybody help me with this problem? Basically, I have thousands of MS
> Word documents. What I need to do is to design an interface that will
> let you submit more of them into the database, and it should index all
> these documents, like extract keywords. Is this possible at all via PHP?
> Also it should index or like re-index existing docs.

For submission:

http://www.php.net/manual/en/features.file-upload.php

For indexing and searching:

http://mnogosearch.ru

together with:

http://www.gnu.org/directory/catdoc.html

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Sessions with register_globals = off

2002-04-26 Thread Padraig Kitterick

Am in need of help or I will loose my sanity!!! Im runnin Php 4.1.2 with
Apache 1.3.22 on Win32 with register_globals set to off. My script is as
follows:



If I check the cookie, its completely empty. Now if I change this to:



the cookie now contains:
myVar|s:9:"Something";

This is annoying as everyhwhere I read about sessions, Im told that if
register_globals is off, I shouldnt use session_register(), all I need to do
is:

$HTTP_SESSION_VARS["myVar"] = $myVar;

or

$_SESSION["myVar"] = $myVar;

but neither work :(



Finally, if I want to change the value of $HTTP_SESSION_VARS["myVar"] and
carry that change over to the next page it doesnt work. For example, i have
registered the session variable $myVar as above and can read it using
$HTTP_SESSION_VARS["myVar"]. If I do:



$HTTP_SESSION_VARS["myVar"] = "Some other text";



then $HTTP_SESSION_VARS["myVar"] contains that text, but only  for this
page! How do I use sessions then with register_globals = off???!!!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] web application development question

2002-04-26 Thread Erik Price

For those of you who write web applications (in any language), what do 
you recommend as the best way to store arbitrary atomic data for the web 
application?  in other words, data that doesn't really need to be stored 
in a relational database, as it does not really relate to anything?

In the app I am working on (PHP/MySQL), there are several instances of 
this.  One of them is:
a multiplier of 1.5 is applied to any "materials cost" of posters 
ordered through my app.  That is, although the "materials cost" to my 
employer is, say $0.076 per square inch, 0.114 is the amount that we 
charge per square inch (0.076 * 1.5).  However, this multiplier could 
change at some point in the future, so I am hesitant to leave the number 
hard-coded into my page.  I would rather have it stored in the database, 
where my employer can easily update or change it to another multiplier.  
But it seems awkward to create a table that simply maintains the 
multiplier:

mysql> SELECT * FROM material_multiplier;
++
| multiplier |
++
|   1.50 |
++
1 row in set (0.00 sec)

I suppose I could store a table with two columns, one being VARNAME the 
other being VALUE, and pull this kind of standalone data out of it, but 
was curious what other people do when they need to store something like 
this.


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] web application development question

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 03:50, Erik Price wrote:
> For those of you who write web applications (in any language), what do
> you recommend as the best way to store arbitrary atomic data for the web
> application?  in other words, data that doesn't really need to be stored
> in a relational database, as it does not really relate to anything?

Stick it in an include file?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
WYSIWYG:
What You See Is What You Get.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Sessions with register_globals = off

2002-04-26 Thread John Holmes

Make sure you are using session_start() on each page and you should be
using $_SESSION["var"] = "value";, not $HTTP_SESSION_VARS...

---John Holmes...

> -Original Message-
> From: Padraig Kitterick [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 12:16 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Sessions with register_globals = off
> 
> Am in need of help or I will loose my sanity!!! Im runnin Php 4.1.2
with
> Apache 1.3.22 on Win32 with register_globals set to off. My script is
as
> follows:
> 
>  
> session_start();
> 
> $myVar = "Something";
> 
> $HTTP_SESSION_VARS["mySessionVar"] = $myVar;
> 
> ?>
> 
> If I check the cookie, its completely empty. Now if I change this to:
> 
>  
> session_start();
> 
> $myVar = "Something";
> 
> session_register("myVar");
> 
> ?>
> 
> the cookie now contains:
> myVar|s:9:"Something";
> 
> This is annoying as everyhwhere I read about sessions, Im told that if
> register_globals is off, I shouldnt use session_register(), all I need
to
> do
> is:
> 
> $HTTP_SESSION_VARS["myVar"] = $myVar;
> 
> or
> 
> $_SESSION["myVar"] = $myVar;
> 
> but neither work :(
> 
> 
> 
> Finally, if I want to change the value of $HTTP_SESSION_VARS["myVar"]
and
> carry that change over to the next page it doesnt work. For example, i
> have
> registered the session variable $myVar as above and can read it using
> $HTTP_SESSION_VARS["myVar"]. If I do:
> 
> 
> 
> $HTTP_SESSION_VARS["myVar"] = "Some other text";
> 
> 
> 
> then $HTTP_SESSION_VARS["myVar"] contains that text, but only  for
this
> page! How do I use sessions then with register_globals = off???!!!
> 
> 
> 
> 
> --
> 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




Re: [PHP] web application development question

2002-04-26 Thread Richard Baskett

I usually have an info.inc file that has all these variables that I might
need to change.  Then include it in the files that use those variables and
if I ever need to change one of them I just change it in the include file
and it updates everything that way..

Rick

Beauty of whatever kind, in its supreme development, invariably excites the
sensitive soul to tears. - Edgar Allan Poe

> From: Erik Price <[EMAIL PROTECTED]>
> Date: Fri, 26 Apr 2002 15:50:08 -0400
> To: [EMAIL PROTECTED]
> Subject: [PHP] web application development question
> 
> For those of you who write web applications (in any language), what do
> you recommend as the best way to store arbitrary atomic data for the web
> application?  in other words, data that doesn't really need to be stored
> in a relational database, as it does not really relate to anything?
> 
> In the app I am working on (PHP/MySQL), there are several instances of
> this.  One of them is:
> a multiplier of 1.5 is applied to any "materials cost" of posters
> ordered through my app.  That is, although the "materials cost" to my
> employer is, say $0.076 per square inch, 0.114 is the amount that we
> charge per square inch (0.076 * 1.5).  However, this multiplier could
> change at some point in the future, so I am hesitant to leave the number
> hard-coded into my page.  I would rather have it stored in the database,
> where my employer can easily update or change it to another multiplier.
> But it seems awkward to create a table that simply maintains the
> multiplier:
> 
> mysql> SELECT * FROM material_multiplier;
> ++
> | multiplier |
> ++
> |   1.50 |
> ++
> 1 row in set (0.00 sec)
> 
> I suppose I could store a table with two columns, one being VARNAME the
> other being VALUE, and pull this kind of standalone data out of it, but
> was curious what other people do when they need to store something like
> this.
> 
> 
> Erik
> 
> 
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [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




Re: [PHP] Sessions with register_globals = off

2002-04-26 Thread Erik Price


On Friday, April 26, 2002, at 03:16  PM, Padraig Kitterick wrote:

> This is annoying as everyhwhere I read about sessions, Im told that if
> register_globals is off, I shouldnt use session_register(), all I need 
> to do
> is:
>
> $HTTP_SESSION_VARS["myVar"] = $myVar;

This is not what the documentation says.

http://www.php.net/manual/en/ref.session.php

You should use

$_SESSION['myVar'] = $myVar;






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] web application development question

2002-04-26 Thread John Holmes

Agreed, this is how I would recommend you do it. I would be careful
naming your include files with an .inc extension, though, since .inc
isn't parsed by PHP and will be shown as plain text when pulled up in a
web browser. I normally name them something like config.inc.php or
database.inc.php, etc. 

I've gotten into the habit, from working with GeekLog, to put everything
into a $_CONF array. 

$_CONF["database"] = "MySQL";
$_CONF["multiplier"] = 1.5;

etc...

---John Holmes...

> -Original Message-
> From: Richard Baskett [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 1:01 PM
> To: Erik Price; PHP General
> Subject: Re: [PHP] web application development question
> 
> I usually have an info.inc file that has all these variables that I
might
> need to change.  Then include it in the files that use those variables
and
> if I ever need to change one of them I just change it in the include
file
> and it updates everything that way..
> 
> Rick
> 
> Beauty of whatever kind, in its supreme development, invariably
excites
> the
> sensitive soul to tears. - Edgar Allan Poe
> 
> > From: Erik Price <[EMAIL PROTECTED]>
> > Date: Fri, 26 Apr 2002 15:50:08 -0400
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] web application development question
> >
> > For those of you who write web applications (in any language), what
do
> > you recommend as the best way to store arbitrary atomic data for the
web
> > application?  in other words, data that doesn't really need to be
stored
> > in a relational database, as it does not really relate to anything?
> >
> > In the app I am working on (PHP/MySQL), there are several instances
of
> > this.  One of them is:
> > a multiplier of 1.5 is applied to any "materials cost" of posters
> > ordered through my app.  That is, although the "materials cost" to
my
> > employer is, say $0.076 per square inch, 0.114 is the amount that we
> > charge per square inch (0.076 * 1.5).  However, this multiplier
could
> > change at some point in the future, so I am hesitant to leave the
number
> > hard-coded into my page.  I would rather have it stored in the
database,
> > where my employer can easily update or change it to another
multiplier.
> > But it seems awkward to create a table that simply maintains the
> > multiplier:
> >
> > mysql> SELECT * FROM material_multiplier;
> > ++
> > | multiplier |
> > ++
> > |   1.50 |
> > ++
> > 1 row in set (0.00 sec)
> >
> > I suppose I could store a table with two columns, one being VARNAME
the
> > other being VALUE, and pull this kind of standalone data out of it,
but
> > was curious what other people do when they need to store something
like
> > this.
> >
> >
> > Erik
> >
> >
> >
> >
> >
> > 
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > [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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: web application development question

2002-04-26 Thread Julio Nobrega Trabalhando

  I let them in a database and a nice administration page so people can
change. There are a lot of more information that you can store, such as last
time of change, and previous values (so peopel can "rollback" them), who
changed, description of the value, related to other values, and there always
someones inspired by your app, such as especific to a client, to a part of
the webiste, to users, merchants (or vendors), etc

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Erik Price" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> For those of you who write web applications (in any language), what do
> you recommend as the best way to store arbitrary atomic data for the web
> application?  in other words, data that doesn't really need to be stored
> in a relational database, as it does not really relate to anything?
>
> In the app I am working on (PHP/MySQL), there are several instances of
> this.  One of them is:
> a multiplier of 1.5 is applied to any "materials cost" of posters
> ordered through my app.  That is, although the "materials cost" to my
> employer is, say $0.076 per square inch, 0.114 is the amount that we
> charge per square inch (0.076 * 1.5).  However, this multiplier could
> change at some point in the future, so I am hesitant to leave the number
> hard-coded into my page.  I would rather have it stored in the database,
> where my employer can easily update or change it to another multiplier.
> But it seems awkward to create a table that simply maintains the
> multiplier:
>
> mysql> SELECT * FROM material_multiplier;
> ++
> | multiplier |
> ++
> |   1.50 |
> ++
> 1 row in set (0.00 sec)
>
> I suppose I could store a table with two columns, one being VARNAME the
> other being VALUE, and pull this kind of standalone data out of it, but
> was curious what other people do when they need to store something like
> this.
>
>
> Erik
>
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] web application development question

2002-04-26 Thread Richard Baskett

By the way.. You can include a little script in your .htaccess file or your
httpd.conf file so that it will not show .inc files just like it does for
.ht files.  That's a great idea for the $_CONF array.. That will help me
keep some of my variables straight and where they come from :)

Cheers!

Rick

"What's in a name? That which we call a rose by any other name would smell
as sweet." - Shakespeare

> From: "John Holmes" <[EMAIL PROTECTED]>
> Organization: U.S. Army
> Reply-To: <[EMAIL PROTECTED]>
> Date: Fri, 26 Apr 2002 16:11:26 -0700
> To: "'Richard Baskett'" <[EMAIL PROTECTED]>, "'Erik Price'"
> <[EMAIL PROTECTED]>, "'PHP General'" <[EMAIL PROTECTED]>
> Subject: RE: [PHP] web application development question
> 
> Agreed, this is how I would recommend you do it. I would be careful
> naming your include files with an .inc extension, though, since .inc
> isn't parsed by PHP and will be shown as plain text when pulled up in a
> web browser. I normally name them something like config.inc.php or
> database.inc.php, etc.
> 
> I've gotten into the habit, from working with GeekLog, to put everything
> into a $_CONF array.
> 
> $_CONF["database"] = "MySQL";
> $_CONF["multiplier"] = 1.5;
> 
> etc...
> 
> ---John Holmes...
> 
>> -Original Message-
>> From: Richard Baskett [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, April 26, 2002 1:01 PM
>> To: Erik Price; PHP General
>> Subject: Re: [PHP] web application development question
>> 
>> I usually have an info.inc file that has all these variables that I
> might
>> need to change.  Then include it in the files that use those variables
> and
>> if I ever need to change one of them I just change it in the include
> file
>> and it updates everything that way..
>> 
>> Rick
>> 
>> Beauty of whatever kind, in its supreme development, invariably
> excites
>> the
>> sensitive soul to tears. - Edgar Allan Poe
>> 
>>> From: Erik Price <[EMAIL PROTECTED]>
>>> Date: Fri, 26 Apr 2002 15:50:08 -0400
>>> To: [EMAIL PROTECTED]
>>> Subject: [PHP] web application development question
>>> 
>>> For those of you who write web applications (in any language), what
> do
>>> you recommend as the best way to store arbitrary atomic data for the
> web
>>> application?  in other words, data that doesn't really need to be
> stored
>>> in a relational database, as it does not really relate to anything?
>>> 
>>> In the app I am working on (PHP/MySQL), there are several instances
> of
>>> this.  One of them is:
>>> a multiplier of 1.5 is applied to any "materials cost" of posters
>>> ordered through my app.  That is, although the "materials cost" to
> my
>>> employer is, say $0.076 per square inch, 0.114 is the amount that we
>>> charge per square inch (0.076 * 1.5).  However, this multiplier
> could
>>> change at some point in the future, so I am hesitant to leave the
> number
>>> hard-coded into my page.  I would rather have it stored in the
> database,
>>> where my employer can easily update or change it to another
> multiplier.
>>> But it seems awkward to create a table that simply maintains the
>>> multiplier:
>>> 
>>> mysql> SELECT * FROM material_multiplier;
>>> ++
>>> | multiplier |
>>> ++
>>> |   1.50 |
>>> ++
>>> 1 row in set (0.00 sec)
>>> 
>>> I suppose I could store a table with two columns, one being VARNAME
> the
>>> other being VALUE, and pull this kind of standalone data out of it,
> but
>>> was curious what other people do when they need to store something
> like
>>> this.
>>> 
>>> 
>>> Erik
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Erik Price
>>> Web Developer Temp
>>> Media Lab, H.H. Brown
>>> [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
> 
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Variables not set

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, Liam Gibbs wrote:
> I have a problem with my variables not being set. I have a file I use
> for constants and functions, structured like so:
> 
> $this = "this";
> $that = "that";
> .
> .
> .
> function this() {
> $h = $this;
> $i = $that;
> }
> 
> function that() {
> }
> 
> Now, when I run this(), $this isn't set (even though it's above it in
> the same file). I can pretty much guess (when running a function, it
> won't parse through the whole file, just skips to that function), but I
> was wondering if there is another solution. I'd hate to separate the
> variable settings and the functions, but will if I have to.

(the following lesson applies to most programming languages these days)

Each variable has what's called "scope", which defines the context in 
which it is visible.

There is something called "global scope" which refers to all variables
created outside of any function or object. Variables with global scope are
then available anywhere outside of a function or object.

Also, each function has its own "local scope". Variables created inside a 
function have scope local to that function and cannot be seen or 
referenced outside of that function. This is very good for programming, 
because it means you can re-use variables like $file and $str without 
having to worry that you are messing things up elsewhere in your program. 
Without scoping, writing a program of any serious size becomes a major 
pain: You have to keep making up longer and longer variable names, and 
your variables' contents keep getting changed behind your back.

Your $this and $that are created with global scope. This is why they are 
not accessible within the functions this() and that(). When you referred 
to $this inside function this(), you created an entirely new variable 
$this with scope local to function this().

Obviously you need ways to move data in and out of functions. The 
preferred method is to pass them into functions as arguments and receive 
the results as the function's return value.

For instance, try running this simple program:

  

The other way to get variables into a function is to import them from the 
global scope. You do this with the keyword global, as follows:

  

(in both examples I changed the variable and function names around to 
eliminate the human confusion caused by using 'this' and 'that' for both).

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] web application development question

2002-04-26 Thread Erik Price


On Friday, April 26, 2002, at 03:58  PM, Jason Wong wrote:

>> For those of you who write web applications (in any language), what do
>> you recommend as the best way to store arbitrary atomic data for the 
>> web
>> application?  in other words, data that doesn't really need to be 
>> stored
>> in a relational database, as it does not really relate to anything?
>
> Stick it in an include file?

I'm sorry, I meant to be more clear --

although include files are great for storing data that will probably not 
change (but are now in a convenient include file in case they have to 
change), I was thinking of making this data updateable from within the 
application.  So that my employer, who does not know a thing about PHP 
or MySQL, can change this information from the "administration" section 
of the site.  Which is why I was thinking of using the database...

... well, I may just keep it in an include file, and if anyone ever 
needs to change the data, I'll explain in the documentation where the 
data should be changed.  Thanks for the tips guys


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] web application development question

2002-04-26 Thread Miguel Cruz

On Fri, 26 Apr 2002, Erik Price wrote:
> although include files are great for storing data that will probably not 
> change (but are now in a convenient include file in case they have to 
> change), I was thinking of making this data updateable from within the 
> application.  So that my employer, who does not know a thing about PHP 
> or MySQL, can change this information from the "administration" section 
> of the site.  Which is why I was thinking of using the database...

I think using the database is a fine idea - even if you just serialize a 
giant array of configuration parameters and stuff them in a TEXT field 
(less work to set up, but you'll have to use your PHP admin tool to make 
changes, thereby forsaking your ability to don your wizard robes and pop 
open a MySQL CLI session to make changes in front of awed management).

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   >