php-general Digest 21 Sep 2003 05:35:23 -0000 Issue 2309

Topics (messages 163299 through 163331):

I have a problem :: help please?
        163299 by: Stevie D Peele

Housing multiple classes under one class
        163300 by: Gerard Samuel

Re: php.net
        163301 by: Shadow

Re: Whats wrong with my code?
        163302 by: Burhan Khalid
        163306 by: Jason Sheets

Re: preg_replace question
        163303 by: Armand Turpel

Re: session_start() || shell access problem......
        163304 by: Robert Cummings
        163305 by: CF High

Trying to View php.ini
        163307 by: Stephen Tiano
        163308 by: Jason Wong
        163317 by: andu

Problem's addign a script to my web page.
        163309 by: stratis Aftousmis

PHP "Smart Refresh" for looping server lookups
        163310 by: NukedWeb.aol.com
        163311 by: Jim Lucas
        163323 by: J. Cox

processing post requests
        163312 by: Vadim Bendebury
        163313 by: Jason Wong
        163314 by: Vadim Bendebury
        163315 by: Vadim Bendebury
        163316 by: Jason Wong
        163318 by: Vadim Bendebury
        163319 by: Jason Wong
        163320 by: John Nichel
        163321 by: John Nichel
        163322 by: andu

Mail looping
        163324 by: Ryan A

File Upload Issues
        163325 by: Shad Kaske
        163326 by: Tom Rogers

php|cruise
        163327 by: John W. Holmes
        163329 by: John Nichel

How to get the Web Address of the Script
        163328 by: Dan Anderson
        163331 by: Curt Zirzow

Re: Limit keyword not supported in MS-SQL
        163330 by: YC Nyon

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'm making my own style sheet switcher. Here's my problem. My style
switcher will switch the style once or twice, sometimes only once, and
then It will not do It again until the cookie expires, can somebody spot
what I am doing wrong?

-------form---action------------------------------
<?php
$value = $_POST['colors'];
$blue = "Royale Blue";
$teal = "Teal";
$green = "Hunter Green";
$maroon = "Maroon";
$grey = "Grey";

if ($value == $blue){
setcookie("blue",time()+3600);}

elseif ($value == $teal){
setcookie("teal",time()+3600);}

elseif ($value == $green){
setcookie("green",time()+3600);}

elseif ($value == $maroon){
setcookie("maroon",time()+3600);}

elseif ($value == $grey){
setcookie("grey",time()+3600);}

else
{
echo "Nothing isset!";
}

?>
<center><b><h3><font face="verdana"><?php echo $value ?> has been
set!</h3><br><h5><a href="categories.php?cat=home">Click Here</a> to
return back to the homepage!</h5>
</b></font></center>
-------------------------------------------------

and the cookie checker
-------------------------------------------------
<?php
echo "<link rel=stylesheet href=style.css type=text/css>";

if (isset($_COOKIE['blue'])){
echo "<link rel=stylesheet href=styleblue.css type=text/css>";}

elseif (isset($_COOKIE['teal'])){
echo "<link rel=stylesheet href=styleteal.css type=text/css>";}

elseif (isset($_COOKIE['green'])){
echo "<link rel=stylesheet href=stylegreen.css type=text/css>";}

elseif (isset($_COOKIE['maroon'])){
echo "<link rel=stylesheet href=stylemaroon.css type=text/css>";}

elseif (isset($_COOKIE['grey'])){
echo "<link rel=stylesheet href=stylegrey.css type=text/css>";}
?>
-------------------------------------------------

Thanks for everyones help......


Stevie

--- End Message ---
--- Begin Message --- I got an application that uses Smarty, ADODB, and some other custom classes.
So I have about about 5 objects floating around,
and the Smarty object, and another class contains a reference copy of the ADODB object, and I just get that feeling that it can
be better.
By having one class where they all can share each others data.
Is it just a dream?
The only way I know how is by making object/objects like $foo->bar->do_something()
But that may lead to passing an object to a class, and Ill end up with multiple copies of an object
Any insight or examples would be appreciated.
Thanks
--- End Message ---
--- Begin Message ---
None that I am aware of.....went there just now.
Shadow

--- End Message ---
--- Begin Message --- Stevie D Peele wrote:
Can someone spot what Is wrong with my code?

[ trim ]

It says Line 195 which is the ?>

Would it matter I don't have all of these files (i.e.
/includes/world.html) were uploaded yet?

Yes it would matter.

You need to use an editor that supports syntax highlighting.

Whenever the error is on the last line, check the line before it.

Like others have suggested, narrow your post down to a test case, never send attachments.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com

--- End Message ---
--- Begin Message --- Sounds like you might have an open { somewhere, PHP can't tell that you have a problem until it reaches the end of the file.

Jason

Burhan Khalid wrote:

Stevie D Peele wrote:

Can someone spot what Is wrong with my code?


[ trim ]

It says Line 195 which is the ?>

Would it matter I don't have all of these files (i.e.
/includes/world.html) were uploaded yet?


Yes it would matter.

You need to use an editor that supports syntax highlighting.

Whenever the error is on the last line, check the line before it.

Like others have suggested, narrow your post down to a test case, never send attachments.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


--- End Message ---
--- Begin Message ---
Finaly I got the solution.

Replace all line breaks by <br /> but not after a html headline
(<h1>..</h1>)

$text = preg_replace("/(?<!h[1-6]\>)\r\n/","\\1<br />",$text);



----- Original Message ----- 
From: "Armand Turpel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 20, 2003 7:34 PM
Subject: Re: [PHP] preg_replace question


> Hi Jim ,
> The problem with your proposition is that the preg_replace do not replace
> </h1>\r\n  to  </h1><br />
> thats good,
> but also not this:
> testh4>\r\n
>
> and thats not what I expect from.
>
>
> atur
>
>
>
>
>
>
> ----- Original Message ----- 
> From: "Jim Lucas" <[EMAIL PROTECTED]>
> To: "Armand Turpel" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, September 20, 2003 5:37 PM
> Subject: Re: [PHP] preg_replace question
>
>
> > $arr = array("/([^\<][^\/][^h][^1-6].{1}[^\>])\r\n/",
> >              "/([^\<][^\/][^h][^1-6].{1}[^\>])\r/",
> >              "/([^\<][^\/][^h][^1-6].{1}[^\>])\n/",
> >              );
> >
> > $text = preg_replace($arr,"\\1<br  />",$text);
> >
> > you might try this and see how well it works.
> >
> > Jim Lucas
> >
> >
> > ----- Original Message ----- 
> > From: "Armand Turpel" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, September 20, 2003 8:21 AM
> > Subject: [PHP] preg_replace question
> >
> >
> > > I need the following replace function:
> > > Replace all line breaks to <br> but not if a line break comes after an
> > </h1>
> > > or </h2> or ....  </hx>
> > >
> > >
> > > Currently I use this preg_replace but it's not good enough for all
> > > situations.
> > >
> > > $text = preg_replace("/([^\<][^\/][^h][^1-9].{1})\r\n/","\\1<br
> > />",$text);
> > >
> > >
> > > ????
> > >
> > > 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
>
>
>
>

--- End Message ---
--- Begin Message ---
On Sat, 2003-09-20 at 15:46, CF High wrote:
> Hey all.
> 
> I'm running a script from the command-line php interpreter as follows:
> (thanks to D. Souza for lead)
> 
> $text = `usr/local/bin/php /path/to/my/php/page.php`;
> 
> within the read file I want to enable sessions, so I session_start() at the
> top of the page:
> 
> <?
> session_start();
> ?>
> <?
>     code to execute here.......
> ?>
> 
> Regardless of how I mess around with placement of session_start(), I get a
> "Headers already sent".
> 
> Why? Nothing has been output to the browser within the read file!
> Furthermore, if I create a test page with just:
> 
> <?$text = `usr/local/bin/php /path/to/my/php/page.php`;?>
> 
> Still receive "Headers already sent".
> 
> My eyes are completely fried -- anyone feel like saving my vision?

This often is difficult to detect when there's is implicit output
outside of the <? tag. Check the top of the included file or start php
script and see if there is any whitespace or newlines preceding the tag.

HTH,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hey Robert.

Indeed, hard to find the problem.

I don't believe it's a whitespace issue, or even a "Headers sent issue",
despite the fact that I'm receiving that error.

Check it out:

test.php contains just one line: <?$text = `usr/local/bin/php
/path/to/my/php/test1.php`;?>

test1.php, the file to be executed, contains just one line:
<?session_start();?>

There are no line breaks, spaces, etc.

Still get "Headers already sent".

Pretty strange, right?

Correct me if I'm wrong, but I think the problem may be related to the fact
that when files are executed from the command line, php now looks for
include_paths, session_paths, etc. relative to the server root; not the site
root.

I can think of no other reason why include paths, starting sessions, and so
on, return errors from the command line but ork perfectly fine when run in a
browser.....

Feel free to clue me in -- I know didly about shell access issues.

--Noah


"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 2003-09-20 at 15:46, CF High wrote:
> > Hey all.
> >
> > I'm running a script from the command-line php interpreter as follows:
> > (thanks to D. Souza for lead)
> >
> > $text = `usr/local/bin/php /path/to/my/php/page.php`;
> >
> > within the read file I want to enable sessions, so I session_start() at
the
> > top of the page:
> >
> > <?
> > session_start();
> > ?>
> > <?
> >     code to execute here.......
> > ?>
> >
> > Regardless of how I mess around with placement of session_start(), I get
a
> > "Headers already sent".
> >
> > Why? Nothing has been output to the browser within the read file!
> > Furthermore, if I create a test page with just:
> >
> > <?$text = `usr/local/bin/php /path/to/my/php/page.php`;?>
> >
> > Still receive "Headers already sent".
> >
> > My eyes are completely fried -- anyone feel like saving my vision?
>
> This often is difficult to detect when there's is implicit output
> outside of the <? tag. Check the top of the included file or start php
> script and see if there is any whitespace or newlines preceding the tag.
>
> HTH,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'

--- End Message ---
--- Begin Message --- I'm on a Mac PowerBook. I'm able to locate the php.ini file. But when I open it with BBEdit, it's a blank page. I just want to open it and either view it, or make a copy to view. But all I have is the blank. Any suggestions?

Thank you.

Steve Tiano
--- End Message ---
--- Begin Message ---
On Sunday 21 September 2003 06:19, Stephen Tiano wrote:
> I'm on a Mac PowerBook. I'm able to locate the php.ini file. But when I
> open it with BBEdit, it's a blank page. I just want to open it and
> either view it, or make a copy to view. But all I have is the blank. Any
> suggestions?

Search archives for > mac php.ini

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Zymurgy's Law of Volunteer Labor:
        People are always available for work in the past tense.
*/

--- End Message ---
--- Begin Message ---
On Sat, 20 Sep 2003 18:19:25 -0400
Stephen Tiano <[EMAIL PROTECTED]> wrote:

> I'm on a Mac PowerBook. I'm able to locate the php.ini file. But when I 
> open it with BBEdit, it's a blank page. I just want to open it and 
> either view it, or make a copy to view. But all I have is the blank. Any 
> suggestions?

Put a file phpinfo.php with 
<?php
phpinfo();
?>
in your server's root and call it with the browser, it will tell you where the
php.ini is, don't think it can be empty. 

> 
> Thank you.
> 
> Steve Tiano
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


____
Regards, Andu Novac

--- End Message ---
--- Begin Message ---
Hello, i will be a succinct as possible. I downloaded a php script (a 
chatbox) for my web page. The web page is from my ISP, 15Mb space, you have 
to have knowledge of UNIX and Html to use the service(to create the page 
and upload to the site). I wrote the page in Html, downloaded the php 
script, intalled and changed the file extention from html to php. The site 
from which i got the php chatbox script say's i have to 'chmod' the 
directory where the file's are to be created to 777...the script create the 
file's if they don't exist with 'touch':

<snip>
if(!is_writable($latest) || !is_writable($archive)) {
  touch($latest);
  touch($archive)
if (!is_writable($latest) || !is_writable($archive)) {
exit("$latest or $archive is not writable, please check your permission's 
and try again");
}
</snip>

One problem i have is the 'chmod'command is not implemented on this site 
(SunOS 5.8):

<snip>
lftp [EMAIL PROTECTED]:~/public_html/ext> chmod 777 archives
chmod: Access failed: 502 SITE command not implemented. (archives)
lftp [EMAIL PROTECTED]:~/public_html/ext>
</snip>

i then tryed to do using the php 'chmod' function to 777 on the directory in 
question, no go. (hey...don't laugh)

When i try to use the chatbox in question, i get the error's:

<snip>
Warning: utime failed: Permission denied in
/export/home/stratus/public_html/ext/minichat2.inc.php on line 102

Warning: utime failed: Permission denied in
/export/home/stratus/public_html/ext/minichat2.inc.php on line 103
/export/home/stratus/public_html/ext/archive/minichat2.latest or
/export/home/stratus/public_html/ext/archive/minichat2.archive is not
writable. Please check your permissions and try again.
</snip>

those line's are both the touch command's, the file's are not being created, 
it won't even work if i create them myself.
I *hope* that's enough info for a diagnosis. Any help would be welcome.

stratis.

--- End Message ---
--- Begin Message ---
This may sound a bit long and drawn out, but I'll try my best to summarize 
what I'm having trouble with. Roughly 2 weeks ago I began writing scripts to run 
a free TagBoard service. (Examples: Tag-Board.com and [mine] MyTagBoard.com) 
- my 2-week-long goal was to compile a list of features (based on 3 or 4 
tagboard sites) and add those to this set of scripts.

I was successful in pretty much all the features and more, except for one: 
"Smart Refresh". The tagboards currently refresh at a rate of xx seconds, set by 
the tagboard owner. Other sites have managed to design the tagboard to 
refresh ONLY when a new tag exists on the server, simulating a "live chat". My 
question is, how is this "Smart Refresh" done? How does a page that's loaded, just 
"sit there" and still be able to take a peek at the server without just 
refreshing the whole page? It's mind-boggling, even for me. :-D

I'm not looking for actual code; that part I can do; I'm just looking for a 
basic "what does what" procedure on how it's done. Any thoughts on this would 
be very greatful! Thanks in advance =)

 ~ Tim

--- End Message ---
--- Begin Message ---
in the past people have talked about doing this in a few different ways.

1.  Have an image that javascript refreshes the url on and when doing so
calls
    to a php script that checks to see if anything is newer then the last
time
    that it checked. And if something has ben updated then have the php
script
    pass back an image that is a different size (height or width) then what
the
    image was be for.  Then if the size of the image return is something
other
    then what you expect, then you can assume that it the data has been
changed
    and you need to refresh the entire page.

2.  You could use a hidden IFRAME to do the checking.

3.  You could write an app in Flash the opens a port to the server and does
all
    the same checking the option #1 would be doing.

4.  not sure, but I'm sure that others will have different options.

Jim Lucas

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 20, 2003 4:40 PM
Subject: [PHP] PHP "Smart Refresh" for looping server lookups


> This may sound a bit long and drawn out, but I'll try my best to summarize
> what I'm having trouble with. Roughly 2 weeks ago I began writing scripts
to run
> a free TagBoard service. (Examples: Tag-Board.com and [mine]
MyTagBoard.com)
> - my 2-week-long goal was to compile a list of features (based on 3 or 4
> tagboard sites) and add those to this set of scripts.
>
> I was successful in pretty much all the features and more, except for one:
> "Smart Refresh". The tagboards currently refresh at a rate of xx seconds,
set by
> the tagboard owner. Other sites have managed to design the tagboard to
> refresh ONLY when a new tag exists on the server, simulating a "live
chat". My
> question is, how is this "Smart Refresh" done? How does a page that's
loaded, just
> "sit there" and still be able to take a peek at the server without just
> refreshing the whole page? It's mind-boggling, even for me. :-D
>
> I'm not looking for actual code; that part I can do; I'm just looking for
a
> basic "what does what" procedure on how it's done. Any thoughts on this
would
> be very greatful! Thanks in advance =)
>
>  ~ Tim
>

--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> I'm not looking for actual code; that part I can do; I'm just looking for
a
> basic "what does what" procedure on how it's done. Any thoughts on this
would
> be very greatful! Thanks in advance =)

Why not do a meta refresh with the time as a variable to be configured?
Seems to me to be the easiest way to do it.

J. Cox
http://www.xaraya.com

--- End Message ---
--- Begin Message --- The web page has a form with a following element in it:

<select multiple size="4" name="city">
  <option selected value=0>no preference</option>
  <option value=2>Paris</option>
  <option value=1>London</option>
  <option value=3>Madrid</option>
</select>

The intention is to be able to pick multiple cities. However, when the request arrives on the server, the $_POST array includes just the one last pick, no matter how many options are highligted when the "submit" button is hit.

What's the deal - is the an HTML code problem or PHP problem? Is it at all possible to have multiple choices derived from this kind of form element?

Thanks in advance!
--- End Message ---
--- Begin Message ---
On Sunday 21 September 2003 08:28, Vadim Bendebury wrote:
> The web page has a form with a following element in it:
>
> <select multiple size="4" name="city">
>    <option selected value=0>no preference</option>
>    <option value=2>Paris</option>
>    <option value=1>London</option>
>    <option value=3>Madrid</option>
> </select>
>
> The intention is to be able to pick multiple cities. However, when the
> request arrives on the server, the $_POST array includes just the one
> last pick, no matter how many options are highligted when the "submit"
> button is hit.
>
> What's the deal - is the an HTML code problem or PHP problem? Is it at
> all possible to have multiple choices derived from this kind of form
> element?

manual > PHP and HTML

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If both the monitor and the planter are going to breakdown, they will do so 
simultaneously. 
                -- Deere's Dictums n3
*/

--- End Message ---
--- Begin Message ---
Jason Wong wrote:
> 
> 
> 
> manual > PHP and HTML
> 

do you feel good being a moron?

--- End Message ---
--- Begin Message ---
Vadim Bendebury wrote:
> Jason Wong wrote:
> 
>>
>>
>>manual > PHP and HTML
>>
> 
> 
> do you feel good being a moron?

Sorry, I did not mean to post this on the group, it was meant to be a
private email.

--- End Message ---
--- Begin Message ---
On Sunday 21 September 2003 08:47, Vadim Bendebury wrote:

> > manual > PHP and HTML
>
> do you feel good being a moron?

Is that how you feel about people who help you? 

Did you read that chapter of the manual indicated above? 

Did it not answer your question?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
My friend has a baby.  I'm writing down all the noises he makes so
later I can ask him what he meant.
                -- Steven Wright
*/

--- End Message ---
--- Begin Message ---
Sory, Jason, what particular manual you are talking about? Does it have
a chapter titled "PHP and HTNL"?

The manuals I have do not answer my question and do not have such a
chapter. If there is an online manual you are referring to, the URL
would be most useful in this situation.

thank you for your willingness to help anyway.


Jason Wong wrote:
> On Sunday 21 September 2003 08:47, Vadim Bendebury wrote:
> 
> 
>>>manual > PHP and HTML
>>
>>do you feel good being a moron?
> 
> 
> Is that how you feel about people who help you? 
> 
> Did you read that chapter of the manual indicated above? 
> 
> Did it not answer your question?
> 

--- End Message ---
--- Begin Message ---
On Sunday 21 September 2003 09:01, Vadim Bendebury wrote:
> Sory, Jason, what particular manual you are talking about? Does it have
> a chapter titled "PHP and HTNL"?

The php manual?

> The manuals I have do not answer my question and do not have such a
> chapter. If there is an online manual you are referring to, the URL
> would be most useful in this situation.

The php website?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Complex system:
        One with real problems and imaginary profits.
*/

--- End Message ---
--- Begin Message ---
So he tells you where to find the answer, and he's a moron?  Do you
expect him (us) to hold your hand, and write code for you?

Vadim Bendebury wrote:

> Jason Wong wrote:
> 
>>
>>
>>manual > PHP and HTML
>>
> 
> 
> do you feel good being a moron?
> 

-- 
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Jason Wong wrote:

> On Sunday 21 September 2003 09:01, Vadim Bendebury wrote:
> 
>>Sory, Jason, what particular manual you are talking about? Does it have
>>a chapter titled "PHP and HTNL"?
> 
> 
> The php manual?
> 
> 
>>The manuals I have do not answer my question and do not have such a
>>chapter. If there is an online manual you are referring to, the URL
>>would be most useful in this situation.
> 
> 
> The php website?
>

And pay close attention to naming conventions of multiple select form
elements, such as checkboxes, and multi-select boxes.

-- 
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
On Sat, 20 Sep 2003 17:28:45 -0700
Vadim Bendebury <[EMAIL PROTECTED]> wrote:

> The web page has a form with a following element in it:
> 
> <select multiple size="4" name="city">
>    <option selected value=0>no preference</option>
>    <option value=2>Paris</option>
>    <option value=1>London</option>
>    <option value=3>Madrid</option>
> </select>

 <select multiple size="4" name="city[]">
   <option selected value=0>no preference</option>
   <option value=2>Paris</option>
    <option value=1>London</option>
    <option value=3>Madrid</option>
 </select>

> 
> The intention is to be able to pick multiple cities. However, when the 
> request arrives on the server, the $_POST array includes just the one 
> last pick, no matter how many options are highligted when the "submit" 
> button is hit.
> 
> What's the deal - is the an HTML code problem or PHP problem? Is it at 
> all possible to have multiple choices derived from this kind of form 
> element?
> 
> Thanks in advance!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


____
Regards, Andu Novac

--- End Message ---
--- Begin Message ---
Hi,
I am trying to make a "tell a friend" script, i am getting the emails from a
textarea and am asking for this format [EMAIL PROTECTED],[EMAIL PROTECTED] etc in case 
the
client forgets to put a comma or purposely then how do i check it?
If anybody has any code samples or has already done that,I would appreciate
some help.
Thanks in advance.

Cheers,
-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com

--- End Message ---
--- Begin Message --- I was hoping to get a bit of help with a strange file upload issue that I am having. Below is a simple form that I am using as an example. The output from the $_FILES array follows that. The thing that I am unable to resolve is the fact that the file upload returns the name of the file the user is uploading, but will not give me the tmp_name or the type. I am having this problem with this form and another as part of an application I am working on, however, I have another form with 2 file upload fields that works normally.

HTML FORM:
<form enctype="multipart/form-data" action="test.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="2048">
Send this file: <input name="userfile" type="file" size="25">
<input type="submit" value="Send File" name="submit">
</form>

PHP CODE & OUTPUT:
code:
echo "Temp Name: " . $_FILES['userfile']['tmp_name'] . "<br>";
echo "File Name: " . $_FILES['userfile']['name'] . "<br>";
echo "File Type: " . $_FILES['userfile']['type'] . "<br>";

output:
Temp Name:
File Name: news.pdf
File Type:


Shad Kaske

Attachment: PGP.sig
Description: PGP signature


--- End Message ---
--- Begin Message ---
Hi,

Sunday, September 21, 2003, 1:10:29 PM, you wrote:
SK> I was hoping to get a bit of help with a strange file upload issue that 
SK> I am having. Below is a simple form that I am using as an example. The 
SK> output from the $_FILES array follows that. The thing that I am unable 
SK> to resolve is the fact that the file upload returns the name of the 
SK> file the user is uploading, but will not give me the tmp_name or the 
SK> type. I am having this problem with this form and another as part of an 
SK> application I am working on, however, I have another form with 2 file 
SK> upload fields that works normally.

SK> HTML FORM:
SK> <form enctype="multipart/form-data" action="test.php" method="POST">
SK> <input type="hidden" name="MAX_FILE_SIZE" value="2048">
SK> Send this file: <input name="userfile" type="file" size="25">
SK> <input type="submit" value="Send File" name="submit">
SK> </form>

SK> PHP CODE & OUTPUT:
SK> code:
SK>         echo "Temp Name: " . $_FILES['userfile']['tmp_name'] . "<br>";
SK>         echo "File Name: " . $_FILES['userfile']['name'] . "<br>";
SK>         echo "File Type: " . $_FILES['userfile']['type'] . "<br>";

SK> output:
SK> Temp Name:
SK> File Name: news.pdf
SK> File Type:


SK> Shad Kaske

what do you get in $_FILES['userfile']['error']
It might give you a clue

-- 
regards,
Tom

--- End Message ---
--- Begin Message --- Is anyone planning on going to this?

http://www.phparch.com/cruise/

I'm trying to go. It would be nice to put a face to the name with a few people out there. Let me know.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- John W. Holmes wrote:
Is anyone planning on going to this?

http://www.phparch.com/cruise/

I'm trying to go. It would be nice to put a face to the name with a few people out there. Let me know.


All depends on money. Being out of work, in the hot bed of technology that South Louisiana is, I can't say for sure. The wife has been bugging me to bring her on a cruise for years now (being ex-Navy, I've logged enough time out to sea :)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
I am creating a script and there is an autoconfig file.  I want to read
in the web address of the server, and throw some correct URLs into the
database.

Will using $_SERVER['HTTP_HOST'] guarantee getting me the domain name of
the server on which the web page I am viewing is hosted?  

I am somewhat worried about using such variables because I seem to
remember it being possible to disable them in PHP.ini, but I would love
to get some feedback.

-Dan

--- End Message ---
--- Begin Message ---
* Thus wrote Dan Anderson ([EMAIL PROTECTED]):
> I am creating a script and there is an autoconfig file.  I want to read
> in the web address of the server, and throw some correct URLs into the
> database.
> 
> Will using $_SERVER['HTTP_HOST'] guarantee getting me the domain name of
> the server on which the web page I am viewing is hosted?  
> 
> I am somewhat worried about using such variables because I seem to
> remember it being possible to disable them in PHP.ini, but I would love
> to get some feedback.

It rather depends on the webserver but in most cases it will be
there.  On apache the way it works is when you access the url
  http://yourhost.com/

The most browsers will send something like:
  GET / HTTP/1.1
  host: yourhost.com


The host: header is what HTTP_HOST is.  If you can access the site
by the IP, I'm not exactly sure what will happen in that case,
cause the browser may not send that host: value.


With all that said, if you have the HTTP_HOST value, it will most
likely be there. php has no control over that var, its set by the
webserver.

HTH

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
I can connect to MS-SQL via php. However, the LIMIT keyword is not
supported. Looking
at the archieves, SELECT TOP X was recommended. Works ok, however i need to
specify a start row, ie. Page 1, Page 2.

Any ideas?

Nyon



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003

--- End Message ---

Reply via email to