php-general Digest 11 Mar 2001 13:21:01 -0000 Issue 560

Topics (messages 43349 through 43384):

Re: UTF
        43349 by: Yasuo Ohgaki

problem with include/require
        43350 by: Erick Papadakis
        43363 by: Yasuo Ohgaki
        43379 by: Erick Papadakis

Re: a solution for getmxrr() and Windows?
        43351 by: Yasuo Ohgaki

Re: objects in functions?
        43352 by: Yasuo Ohgaki

mysql help!! urgent!
        43353 by: McShen

File Upload Size Limit Problem
        43354 by: Jeff Oien
        43364 by: Yasuo Ohgaki
        43369 by: Jeff Oien

Re: Using Cookies
        43355 by: Yasuo Ohgaki

Re: reloading a webpage?
        43356 by: Yasuo Ohgaki

Re: Cookies creating Unwanted Problem....
        43357 by: Yasuo Ohgaki

Re: session end
        43358 by: Yasuo Ohgaki

Re: PHP/MySQL Question
        43359 by: Rick St Jean

Which is faster, SSI or PHP?
        43360 by: Todd Eddy

New to navigation functions...
        43361 by: Richard
        43366 by: Yasuo Ohgaki
        43372 by: Richard

Re: Testing for session without setting cookies
        43362 by: Yasuo Ohgaki

Re: some array help :)
        43365 by: rm

Re: Including file...
        43367 by: Yasuo Ohgaki

Re: $userfile_name broken in PHP4 win32 ?
        43368 by: Yasuo Ohgaki

Logins
        43370 by: Mick

Re: sending SMS messages via PHP
        43371 by: Valter Santos

Retrieving data from multiple select list
        43373 by: Ben Cheng
        43376 by: Edi Murfy

uploading file to seperate server
        43374 by: Thomas Edison Jr.

Re: Sending "pretty" email
        43375 by: Richard Scott Crawford

Re: isset and multiple selects
        43377 by: Alexander Lohse
        43384 by: Jens Nedal

get_browser
        43378 by: GBuschbeck.gmx.net

PHP & Apache with SSL
        43380 by: Daniel B I

DB Abstraction
        43381 by: Jordan Elver
        43382 by: Jordan Elver
        43383 by: Jordan Elver

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]


----------------------------------------------------------------------


> Is there any UTF-8 r UTF-32 compatibility in PHP? I want to be
> multinational with the SAME scripts, not a dozen. I haven't tried
> anything yet, just asking

I forgot to mention what you are asking. There is a experimental module called
iconv, I guess it does UTF-8 conversions. Or if you can read japanese, there is
better non-standard module. Just mail me if you want the URL.

Regards,
--
Yasuo Ohgaki

>
> --
> ________________________________________________________________
> Sites by friends of mine: http://www.myhiddentreasures.com/
> ________________________________________________________________
> WARNING personal propaganda signature
> TAKE WHAT YOU LIKE AND LEAVE THE REST
>
> SINCE OUR GOVERNMENT WON'T PRESERVE OUR CLIMATE, IT'S UP TO US!
> Imagine ** yourself ** and your kids now an endangered species
> <1>Inflate automobile tires to near maximum in summer, -2psi in winter
> <2>add insulation to house and hot water heater, and refrigerator,
> <3>combine trips in cars, make less of them <4>buy cars, sports
> vehicles and recreational vehicles with good if not best mileage
> <4>put awnings over windows is summer, remove in winter. <5> add
> solar hot water heating. <6>Push for energy recycling clothes
> dryers <7> walk more, play outside with your kids! <8> let your
> grass grow to 3-4 inches, chokes weeds, saves water and energy,
> keeps house cooler <9> Put WHITE or REFLECTIVE materials on
> roofs to send energy back into space. <10> Vote for burial of
> logging slash onsite in logging areas for better watersheds
> and less burned vegetation. <11> compost your leaves and grass,
> bury in flower beds, lawns, gardens, or give away. <12> VOTE
> for energy and CO2 ratings on ALL products and foods. KNOW how
> much damage your purchases do to the climate. <13> Give your kids
> less stuff and more of you. <14> recycle everything you can <15>
> limit your children to an average 1 per adult between all your
> marriages. (Only REPLACE yourself, not expand the population)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




i installed my php on my windows machine using the "php triad" software
which i downloaded from www.sourceforge.net. however, now i have a problem
with "include" command. for everything i wish to include into my programs, i
need to speficy this folder in the "include_path" inside my php.ini. can i
change this configuration?

for example, lets say i have a directory called:

    c:/apache/htdocs/phpprograms/

inside this phpprograms, i have the following files:

    class_include.phpi
    actual_program.php

inside my "actual_program.php", i require the "class_include.phpi", but this
gives me a runtime error.

i think it must be some configuration problem? i would appreciate if someone
can tell me how to do this!

cheers/erick




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01






""Erick Papadakis"" <[EMAIL PROTECTED]> wrote in message 98einl$rpl$[EMAIL PROTECTED]">news:98einl$rpl$[EMAIL PROTECTED]... > i installed my php on my windows machine using the "php triad" software > which i downloaded from www.sourceforge.net. however, now i have a problem > with "include" command. for everything i wish to include into my programs, i > need to speficy this folder in the "include_path" inside my php.ini. can i > change this configuration? Sounds like all you need to is edit include_path line your php.ini correctly. If you are setting include_path right, are you sure you don't have typo? Refer to http://www.php.net/manual/en/configuration.php Regards, -- Yasuo Ohgaki > > for example, lets say i have a directory called: > > c:/apache/htdocs/phpprograms/ > > inside this phpprograms, i have the following files: > > class_include.phpi > actual_program.php > > inside my "actual_program.php", i require the "class_include.phpi", but this > gives me a runtime error. > > i think it must be some configuration problem? i would appreciate if someone > can tell me how to do this! > > cheers/erick > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >



Hi Yasuo,

Thanks for the reply, but yes I do know that the include_path in php.ini
should have the entries. But is this something new? I want to know how to
allow including and requiring files just like we used to do in PHP3!

For instance, let us say that we have two software programs on the server
which are completely unrelated (I use Windows platform, so here it is):

    c:\apache\htdocs\software1\includes
    c:\apache\htdocs\software2\includes

Now with the latest PHP I have to include both these above paths in my
PHP.INI's "include_path" directive. is there a way to avoid this, and only
include the "c:\apache\htdocs"?

Yes, I know that I can make a common INCLUDES folder, but come on lets be
practical.  It is a lot cleaner if we can have an include folder INSIDE the
software-specific folder.

Any ideas would be greatly appreciated!

Thanks/Erick


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01






"Keijo Lehto" <[EMAIL PROTECTED]> wrote in message 98dlai$uic$[EMAIL PROTECTED]">news:98dlai$uic$[EMAIL PROTECTED]... > Hello, > > I've read the archieves and saw other people being frustrated on the same > thing that I've been working on during the last couple of days. > > As PHP cannot correctly get mx records on windows, I've decided to open a > socket to a name server and do the stuff manually with fputs&fgets. However, > I have no idea what I should say to the server and what to expect as a > reply. As a matter of fact, I don't even know what is (usually) the port > used. There should be a RFC for all protocols, How about read related RFC? http://www.faqs.org/rfcs/ If your talking to SMTP, HELO is what you should send at first. Regards, Yasuo Ohgaki > > So if anyone could help me by explaining things a bit or giving some URL's > to read I'd appreciate it awfully lot. > > Sinc, Keijo > > PS. I know the interaction with a name server is not PHP specific thingie, > but as this is a common problem with PHP, I think this could help some > others, too. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >



> Hi,
> I want to make a recursive function generating a hierarchy using a class.
>
> The following code works fine when I don't wrap the function around it,
> but when I do it fails. I can't figure out why...
> I'm thinking I may need to make some vars global, or maybe you can't use
> objects inside functions? (No, couldn't be)

If following code is all code that you make a tree node. Your guess is rgiht.
Take a look at
http://www.php.net/manual/en/language.variables.scope.php

You also better to read reference section carefully (espacially you have been
programminged in C/C++)
http://www.php.net/manual/en/language.references.php

regards,

Yasuo Ohgaki
>
> Here's the code:
> .........
> $root  = $tree->open_tree ($title, "");
>
>     function generate_nodes($id) {
>
>         $sql = "select * from hierarchy where parent = $id";
>         $res = mysql_debug_query($sql);
>         while ($row = mysql_fetch_array($res)) {
>              $node = "node" . $count;
>              $$node = $tree->add_folder ($root, $row["name"] . " <font
> size=1>" . $row["id"] . "</font>", "");
>
>              $count++;
>         }
>     }
>     generate_nodes($id);
> ........
> Thanks for any hints...
> Peter
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> http://liga1.com: building multiple language/culture websites
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




hi

i get this message when i am trying to load some data from mysql.

Warning: Unable to jump to row 0 on MySQL result index 2 in
/home/sites/site3/web/showthumb on line 71

--here is my code
$connetion = mysql_connect("localhost","cel34243","s2343223");
$query = "select images from celeb where name=\"$dir.\" ";
$result = mysql_db_query("celebzone", $query);
$imagesnum= mysql_result($result,  "images");

can you please tell me why?

Thank you.






I've modified a script for uploading multiple files
and am trying to get it to produce an error if the
size of the file is larger than 2 MB but can't get it
to work. Here is the code in question with the 
who code below. When I try to upload a 3 MB 
file it doesn't produce an error. Everything else works 
fine.
Jeff Oien

 if(${"infile".$i}!="none") $noinput=false; 
                        if(${"infile".$i."_size"} > 2000000) { 
        echo "Sorry, file size limit is 2MB. ${"infile".$i} is too large."; 
              exit; 
            } 

--------------------

    /* handle uploads */ 
    $noinput = true; 
    for($i=1; $noinput && ($i<=UPLOAD_SLOTS); $i++) 
    { 
        if(${"infile".$i}!="none") $noinput=false; 
    } 
    if($noinput) 
    { 
        echo "Uploading Error"; 
        exit(); 
    } 
    for($i=1; $i<=UPLOAD_SLOTS; $i++) 
    { 
        if(${"infile".$i."_size"} > 2000000) { 
                echo "Sorry, file size limit is 2MB. ${"infile".$i} is too large."; 
            exit; 
            } 

        if(${"infile".$i}!="none" && 
         copy(${"infile".$i}, INCOMING.${"infile".$i."_name"}) && 
         unlink(${"infile".$i})) 
        { 
        if (${"infile".$i."_size"} < 1000000) {
        ${"infile".$i."_size"} = ${"infile".$i."_size"} / 1000;
        ${"infile".$i."_size"} = sprintf("%.2f", ${"infile".$i."_size"});
        ${"infile".$i."_size"} = ${"infile".$i."_size"} . ' KB';
        }
        else {
        ${"infile".$i."_size"} = ${"infile".$i."_size"} / 1000000;
        ${"infile".$i."_size"} = sprintf("%.2f", ${"infile".$i."_size"});
        ${"infile".$i."_size"} = ${"infile".$i."_size"} . ' MB';
        }
            echo ${"infile".$i."_name"}." - ${"infile".$i."_size"} uploaded<br>"; 
        } 
    } 
} /* else */ 
?> 




""Jeff Oien"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I've modified a script for uploading multiple files
> and am trying to get it to produce an error if the
> size of the file is larger than 2 MB but can't get it
> to work. Here is the code in question with the
> who code below. When I try to upload a 3 MB
> file it doesn't produce an error. Everything else works
> fine.

You need to edit your php.ini
Read your php.ini and look for upload_max_filesize.

Regards,
--
Yasuo Ohgaki
PHP and Related resources
[PHP FAQ] http://www.php.net/FAQ.php
[PHP Manual] http://www.php.net/manual/en/
[PHP Links] http://www.php.net/links.php
[RFCs] http://www.faqs.org/rfcs/


> Jeff Oien
>
>  if(${"infile".$i}!="none") $noinput=false;
> if(${"infile".$i."_size"} > 2000000) {
>         echo "Sorry, file size limit is 2MB. ${"infile".$i} is too large.";
>               exit;
>             }
>
> --------------------
>
>     /* handle uploads */
>     $noinput = true;
>     for($i=1; $noinput && ($i<=UPLOAD_SLOTS); $i++)
>     {
>         if(${"infile".$i}!="none") $noinput=false;
>     }
>     if($noinput)
>     {
>         echo "Uploading Error";
>         exit();
>     }
>     for($i=1; $i<=UPLOAD_SLOTS; $i++)
>     {
> if(${"infile".$i."_size"} > 2000000) {
>         echo "Sorry, file size limit is 2MB. ${"infile".$i} is too large.";
>             exit;
>             }
>
>         if(${"infile".$i}!="none" &&
>          copy(${"infile".$i}, INCOMING.${"infile".$i."_name"}) &&
>          unlink(${"infile".$i}))
>         {
> if (${"infile".$i."_size"} < 1000000) {
> ${"infile".$i."_size"} = ${"infile".$i."_size"} / 1000;
> ${"infile".$i."_size"} = sprintf("%.2f", ${"infile".$i."_size"});
> ${"infile".$i."_size"} = ${"infile".$i."_size"} . ' KB';
> }
> else {
> ${"infile".$i."_size"} = ${"infile".$i."_size"} / 1000000;
> ${"infile".$i."_size"} = sprintf("%.2f", ${"infile".$i."_size"});
> ${"infile".$i."_size"} = ${"infile".$i."_size"} . ' MB';
> }
>             echo ${"infile".$i."_name"}." - ${"infile".$i."_size"}
uploaded<br>";
>         }
>     }
> } /* else */
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





> ""Jeff Oien"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I've modified a script for uploading multiple files
> > and am trying to get it to produce an error if the
> > size of the file is larger than 2 MB but can't get it
> > to work. Here is the code in question with the
> > who code below. When I try to upload a 3 MB
> > file it doesn't produce an error. Everything else works
> > fine.
> 
> You need to edit your php.ini
> Read your php.ini and look for upload_max_filesize.
> 
> Regards,
> --
> Yasuo Ohgaki

I know my max_file_size 2 MB.
I want to prevent a user from trying to upload a file that 
is larger than 3 MB.
Jeff Oien 




It seemed I thought it should work at least. But it does not on PHP4.0.4pl1.

Try following code

<?php
  $user       = empty($HTTP_GET_VARS['user']) ? '' : $HTTP_GET_VARS['user'];
  $pw         = empty($HTTP_GET_VARS['pw']) ? '' : $HTTP_GET_VARS['pw'];
  $cookieuser = empty($HTTP_COOKIE_VARS['user']) ? '' :
$HTTP_COOKIE_VARS['user'];
  if (!$cookieuser) {
    setcookie('user', $user, time() + 864000);
    print('Setting a cookie<br>');
  }

  print('The user is ' . $user . '<br>');
  print('The password is ' . $pw . '<br>');
  if (empty($cookieuser)) {
    print('No cookie was set...will set one<br>');
  } else {
    print('Cookie user name: ' . $cookieuser . '<br>');
  }
  echo('<pre>'."\n");
  print_r($HTTP_COOKIE_VARS);
  echo('</pre>'."\n");

?>

FYI:
You better to set error reporting to E_ALL. You didn't enclose array index.
E_ALL will be very helpful to find type AND to write better code. I don't
recommend to use short tag. Use <?php instead.

Regards,

--
Yasuo Ohgaki

----- Original Message -----
From: "Todd Cary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 11, 2001 1:59 AM
Subject: [PHP] Using Cookies


> This is a test script so I can get an understanding of Cookies.  What am
> I missing with this?  $cookieuser never gets a value.
>
> <?
>   $user       = $HTTP_GET_VARS[user];
>   $pw         = $HTTP_GET_VARS[pw];
>   $cookieuser = $HTTP_COOKIE_VARS[user];
>   if (!$cookieuser) {
>     setcookie("user", $user, time() + 864000);
>     print("Setting a cookie<br>");
>   }
>
>   print("The user is " . $user . "<br>");
>   print("The password is " . $pw . "<br>");
>   if (empty($cookieuser)) {
>     print("No cookie was set...will set one<br>");
>   } else {
>     print("Cookie user name: " . $cookieuser . "<br>");
>   }
> ?>
>
>
>
> --
> Todd Cary
> Ariste Software
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




> header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
> header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
>                                                       // always modified
> header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
> header ("Pragma: no-cache");                          // HTTP/1.0

FYI.
If you are using PHP4 session, it will be done automatically when you set
session.cache_limmter = 'nocache';

Also read, RFC2068 for HTTP1.1, RFC1945 for HTTP 1.0.

Regards
--
Yasuo Ohgaki
>
> -----Ursprungligt meddelande-----
> Från: Fai [mailto:[EMAIL PROTECTED]]
> Skickat: den 10 mars 2001 18:25
> Till: [EMAIL PROTECTED]
> Ämne: [PHP] reloading a webpage?
>
>
> Does any body know how to ensure the web page will clear the previous
> history (cache) and reload the new data when the same webpage re-displays to
> browser?
>
> That is the current webpage content is based on previous webpage input, and
> when we press "back" button to re-enter previous webpage input then we press
> "forward" and this current page will know to update the content and display
> new one to browser.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




Did you detect if browser's cookie is enabled??

Regards,

--
Yasuo Ohgaki

"Dhaval Desai" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
>
> This website is authenticated using cookies.
> I don't understand why..? Id works from some computers
> and doesn't work from some computers...
>
>
> The Operating System is Same. The Browser is also the
> same one INTERNET EXPLORER 5.0.
>
>
> Is there any reason why this is happening.
>
> Checck out this website URL for details.
>
> http://www.uaegraduate.com/jobseekers_login.php
> Username: testing
> Password: testing
>
> I have used cookies to autheticate on this one.
>
>
> Thank You
> Dhaval Desai
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Assuming you are talking about PHP4 session. Garbage collection is done by the module. Read http://www.php.net/manual/en/ref.session.php Regards, -- Yasuo Ohgaki ""deco"" <[EMAIL PROTECTED]> wrote in message 98dtge$2ad$[EMAIL PROTECTED]">news:98dtge$2ad$[EMAIL PROTECTED]... > > is there some kind of function or event launched when a session times > out?? > > something like session_on_end() ?? > > i'm using a flag on a database to tell if a user is visiting the page and > i would like to make him offline when his session expires... > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >



That is database specific....  no standard SQL.

To make it non specific.
you can put it in a for loop.  remember to check for eof.

Rick



At 06:01 PM 3/10/01 -0600, you wrote:
>Select * from table limit 5;
>
>http://www.calevans.com
>
>
>-----Original Message-----
>From: Kath [mailto:[EMAIL PROTECTED]]
>Sent: Saturday, March 10, 2001 6:01 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] PHP/MySQL Question
>
>
>Having some problems with syntax.
>
>If I wanted to SELECT only 5 instances of something from a database and
>order it by datetime, how would I do that?
>
>- Kath
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

##########################################################
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##########################################################





I am going to redesign my site, currently it uses SSI (for the menu and
stuff).  I know php can do a ton more stuff then SSI, I actually use php
for certain pages as needed throughout the site.  But was wondering if
php would run faster for what will basically be SSI commands (namely
just what would be the php equivlent of ReadFile()).  For something like
that, would php be faster or would the speeds generally still remain the
same?  Again most of the requirements I need can be handled by SSI, not
going to use MySQL or anything of that nature for the major chunk of the
site.

Another concern I have is searchability by search engines.  For example,
if I move everything to php and just use a different text file for each
page for the main body of text and load each text file depending on what
page the user wants, would the search engine search though those text
files and just link to those and not to the php file?  Would it even be
spidered by the search enging properly?

--
Todd Eddy
[EMAIL PROTECTED]
www.vrillusions.com





Greetings.

    I was wondering if there is any function like the JavaScript function:
location.href = "".........    or perhaps how I can execute a javascript
function from PHP. All related help is appriciated.

- Richard






""Richard"" <[EMAIL PROTECTED]> wrote in message 98eo58$7fg$[EMAIL PROTECTED]">news:98eo58$7fg$[EMAIL PROTECTED]... > Greetings. > > I was wondering if there is any function like the JavaScript function: > location.href = ""......... or perhaps how I can execute a javascript > function from PHP. All related help is appriciated. > You cannot execute JavaScript function, but you can use Java. There are articles about it on phpbuilder.com or else. Server side and Client side scripts are nothing to do with each other. You can specify parameters for client side script in server side script, though. Regards, -- Yasuo Ohgaki PHP and Related resources [PHP FAQ] http://www.php.net/FAQ.php [PHP Manual] http://www.php.net/manual/en/ [PHP Links] http://www.php.net/links.php [RFCs] http://www.faqs.org/rfcs/ > - Richard > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >



Thanks, I will check it out.

Anyhow, I was thinking of fixing an Update bug that I have in one of my
scripts. I use the same php file for reading and saving a file, the thing
is, if the user hits update or whatever, the entry or text will be entered
again, because the address is file.php?PARAM1=...&PARAM2=...        Can you
help me with this one? What I want to do is to make sure that the location
is purely the website address and the php file name.

- Richard



""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message
98epti$n83$[EMAIL PROTECTED]">news:98epti$n83$[EMAIL PROTECTED]...
> ""Richard"" <[EMAIL PROTECTED]> wrote in message
> 98eo58$7fg$[EMAIL PROTECTED]">news:98eo58$7fg$[EMAIL PROTECTED]...
> > Greetings.
> >
> >     I was wondering if there is any function like the JavaScript
function:
> > location.href = "".........    or perhaps how I can execute a javascript
> > function from PHP. All related help is appriciated.
> >
>
> You cannot execute JavaScript function, but you can use Java. There are
> articles about it on phpbuilder.com or else.
>
> Server side and Client side scripts are nothing to do with each other. You
> can specify parameters for client side script in server side script,
though.
>
> Regards,
> --
> Yasuo Ohgaki
> PHP and Related resources
> [PHP FAQ] http://www.php.net/FAQ.php
> [PHP Manual] http://www.php.net/manual/en/
> [PHP Links] http://www.php.net/links.php
> [RFCs] http://www.faqs.org/rfcs/
>
>
> > - Richard
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






"Simon Woods" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi All,
>
> Sorry if I am asking a vfaq but I was unable to find anything in the
> archives.
>
> I am using PHP4 with session handling to track users which have logged
> in to my server.
>
> I would like to (non intrusively) check to see if a user is logged in
> without having to start a new session. 95% of my users do not log in at
> all and do not want to be fed with cookies for no apparent reason. I
> wanted to avoid giving my visitors the impression that I am tracking
> them as well.

I posted session helper html sample at zend code exchange. I might want to
use to detect cookie and javascript are enabled. You might want to use and
modify code to show reason why you are using cookie. Search keyword with
'session' and look for session helper HTML.

Or if you need session only for users logged in, you could write  following code
and put each pages you might want to use session for logged in users.

// If you are only using session cookie
// No auto start in php.ini. Check session value/format/referer also, if you
need.
if (!empty($HTTP_COOKIE_VARS['PHPSESSION'])) {
  session_start();
}

to avoid sending cookie to users who are not logged in. (You must set session id
when users are logged in)

> I could check to see if the cookie PHPSESSION or what ever I called my
> cookie has been returned by the browser, but I have no guarantee that
> the session is still or at all valid. Checking to see if there are
> corresponding session files or writing my own handler start to get over
> complicated.

I think all you need to do is checking session value format. HTML session
is easily hijacked if session key is known to users anyway.
Also, writing your own session handlers are not difficult. There are many
session
handlers for verious databases. How about look for one and modify?

Regards,

Yasuo Ohgaki

> I hope that I have overlooked something.
>
> Thanks in advance,
>
> --
> Simon Woods
>
> Siemens Business Services
> SBS EBS D CKS
> Munich Germany 089 / 636 54347
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





True enough, however, there are still some of us using
stone tablets for our correspondence :)

rm

--- Jørg_Vidar_Bryne <[EMAIL PROTECTED]> wrote:
> Or you could use this in php4:
> 
> if ( in_array( "something", $temparray  )) { do
> stuff }
> 
> -J


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/




""Martin Hughes"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I seem to be making a mistake somewhere...
>
>
> # Define the navigation bar array
> $navbar = array("navmain", "info", "music", "orch", "synth", "syntype",
> "audio", "recordings");
>
> # Define the pages in arrays by section
> $main = array("home");
> $info = array("infomain", "about", "contact", "guestbook");
> $music = array("musicmain", "musprologue", "mus1", "mus2", ......, "mus28",
> "musepilogue", "musbows", "musplayout");
> $orch = array("orchmain", "strings", "brass", "woodwind", "percussion",
> "rhythm");
> $synth = array("synthmain", "part", "patches");
> $synthtype = array("synthtypemain", "dx7", "k2000", "k2vx", "k2500");
> $audio = array("audiomain", "synth");
> $recordings = array("recordingsmain", "reccompare", "olc", "obc", "csr",
> "tac", "lon97");
>
> # Store the arrays in an array
> $sections = array("&$main", "&$info", "&$music", "&$orch", "&$synth",
> "&$synthtype", "&$audio", "&$recordings")

Why do you enclose with double quotes? You dont need them at all, try w/o
double qoute. Should work then.

Regards,
--
Yasuo Ohgaki
PHP and Related resources
[PHP FAQ] http://www.php.net/FAQ.php
[PHP Manual] http://www.php.net/manual/en/
[PHP Links] http://www.php.net/links.php
[RFCs] http://www.faqs.org/rfcs/


>
> # Create the name of the .inc file
> $pagename = $sections[$sect][$page]; # *******THIS LINE IS CAUSING A PARSE
> ERROR*******
> $navname = $navbar[$nav];
>
>
> I then want to include the file $pagename.inc in the main frame, and
> $navname.inc in side.php
>
>
> Cheers,
>
>
> Martin :0)
>
> ==============================================
> Musical Director
> University of York Gilbert & Sullivan Society
> 177 Hull Road, York YO10 3JY
> 01904 427 537 / 07951 015 220
> [EMAIL PROTECTED]
> http://www.mixermanic.co.uk
> ==============================================
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





""Jon Shoberg"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Ok,
>
> I am running Win2000/Pro with PHP 4.0.? and IIS 5 for some local
> development. I have tried turning on and off magic quotes.
>
> When uploading a file via a form I can access $userfile and echo back to
> the page the full path. However, $userfile_name, $userfile_type, and
> $userfile_size are broke. They echo back nothing at all.
>
> Any ideas ?

Have you checked $HTTP_POST_FILES?

Regards,

--
Yasuo Ohgaki
PHP and Related resources
[PHP FAQ] http://www.php.net/FAQ.php
[PHP Manual] http://www.php.net/manual/en/
[W3C] http://www.w3.org/
[RFCs] http://www.faqs.org/rfcs/

>
>
> Jon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi,

Is there anyway i can call the login name of the shell for the php file?

What i'm trying to do is have this
/home/USERNAME/public_html/.htpasswd'

have all the users showing?
i've tried /home/*/public_html/.htpassd but that doesn't work
Anyone able to help me?

Thanks in advanced,
Mick






Hi!

Instead of send a direct SMS to a SMSCenter you can send the
message as an standard email... Many Cellcos allow that, and it
will be cheaper to you (no cost!!!)....

Here in Portugal we can do it... we just use the MSISDN (phone number)
from who we want to send and sms and append the cellco mail server...

As an example, to send a SMS to me, you can send a email to

[EMAIL PROTECTED]

this, probably will work... the mail user alias is my phone number and
the server domain is the Cellco' mail server
~

hope this help

............................................
Valter Santos
WEB/WAP Consultant

Email : [EMAIL PROTECTED]
Mobile: +351 93 9650075

WeDo Consulting - http://www.wedo.pt
............................................


> -----Original Message-----
> From: Michael Smith [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 07, 2001 5:00 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] sending SMS messages via PHP
> 
> 
> I can easily send standard email messages via PHP. Does anyone know how to
> send SMS messages?
> 
> --
> Michael A. Smith <[EMAIL PROTECTED]>
> Director of Data Systems, wcities.com
> ICQ: 35884415
> :wq
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





I have a select box that allows the user to select and submit more 
than one selection at a time.  How do I retrieve all the selections 
in PHP?  For example, the select list is named CategoryID.  But when 
I select more than one item and then hit submit, $CategoryID only 
shows me the last value of the selected items.  How do I see all the 
values that have been selected?

-Ben




try this:

in the form:
<select name="CatecoryID[]" size="3" multiple>
   <option value="1">Item 1</option>
   <option value="2">Item 2</option>
   <option value="3">Item 3</option>
</select>

in the script:
$num = sizeof($CategoryID); // Number of array items
for($i=0;$i<$num;$i++)
  {
  // $CategoryID[$i] --> whatever you wanna do with it...
  }



"Ben Cheng" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:p05010402b6d0b285663b@[10.10.0.169]...
> I have a select box that allows the user to select and submit more
> than one selection at a time.  How do I retrieve all the selections
> in PHP?  For example, the select list is named CategoryID.  But when
> I select more than one item and then hit submit, $CategoryID only
> shows me the last value of the selected items.  How do I see all the
> values that have been selected?
>
> -Ben
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






basically i've gotta write a script that uploads the
file that user is uploading NOT to the server on which
the scripts are - but to a seperate server.
Problem is, i'm expecting huge uploads, and i have got
ample space, 3 to 400 MB's. but it's on seperate
servers from where my site is. 
When a user uploads the file - it should uploaded
directly to this other huge server - and not on the
server where the PHP scripts are...is it possible?

Also, any upload being handled by this othe server
will need a connection opening to this other server -
with ftp user:pass. how will this be made possible in
the script!?

well thanks a lot,
Cheers,
T. Edison jr.



=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/




The first thing to do is to take two aspirin and lie down until the 
temptation to do this passes.  It may be cool, but those of us who use 
Eudora or Pine for our e-mail (because it actually works the way we want it 
to instead of making us work the way it wants us to like Outlook does) 
don't read HTML-encoded mail, don't *want* to read HTML-encoded mail, and 
get really annoyed when it shows up in our mailboxes.

At 11:11 AM 03/10/2001, you wrote:
>Todd Cary wrote:
> >
> > I often receive email from commercial sites (e.g. ZDnet) that looks like
> > a Web page.  How can I do that with Sendmail in PHP?

--
Richard Crawford (mailto:[EMAIL PROTECTED])
http://www.mossroot.com
http://www.stonegoose.com/house
AIM Handle: Buffalo2K
"When you lose the power to laugh at yourself, you lose the power to think 
straight."  --Clarence Darrow






Hi,

No, empty(), also does not apply, because it is not set.

It is NOT in the HTTO_POST_VARS Array!

Is this a usual behavior?

Greets,

Alex
-- 
___________________________
Alexander Lohse
Human Touch Medienproduktion GmbH
Am See 1
17440 Klein Jasedow

Tel: (038374) 75211
Fax: (038374) 75223
eMail: [EMAIL PROTECTED]
http://www.humantouch.de




on 10.03.2001 10:10 Uhr, Alexander Lohse at [EMAIL PROTECTED] wrote:

> Hi,
> 
> is it a fact that: If I have multiple select with e.g. "pers[]" as
> name, I cannot check for an isset($pers) if the user left the field
> blank?
> 
> I know it all works with textfields ... But in this case isset()
> seems not work. There is also no entry in HTTP_POST_VARS for that.
> 
> Or might this be a browserspecific problem? (MSIE 5 on Mac)
> 
> Regards,

Hi Alex,

In a multiple select those values are stored in array. That array is you
pers[].

In $HTTP_POST_VARS this will appear as this array, i.e. pers()
To list the values in the multiple select do this:

while(list($key,$value) = each(pers)) {
    echo("$key -> $value");
}
or instead of echo you can assign those values newly or store them in a
database for example.


all the values look something like this in the array

pers[0] = 1. multiple select
pers[1] = 2. multiple select
pers[2] = 3. multiple select
pers[3] = 4. multiple select

regards, Jens

> 
> Alex





Hi!

I've a problem with "get_browser"

i got the browscap.ini from http://www.cyscape.com/browscap/ 
and installed it in:
/usr/local/lib/browscap.ini

then i added browscap = /usr/local/lib/browscap.ini
in the php.ini

but 
$test = get_browser();

echo $test; 
gives an empty response.

i've use the example script from php.net:

http://php.net/manual/en/function.get-browser.php

hope for your help

georg





Hello,
any idea how to limit file access (php files) by
protocol type call?
I mean how could I serve a php file only if it is
called with SSL (https://... not http://...)
I saw this on a site when I was refused because
I didn't use secure protocol, and I wonder, how could
I do that?
Is there a specific statement in apache config file?

Daniel BI
PS. I know it 's a little bit far of PHP specific this
question, excuse me for that.. maybe you knwow
something about





Hi,
I thought it was about time I started using a db abstraction class. Problem 
is, there are so many out there that I don't which one to start using?

I've heard of ADODB (I think).

Anyone have any suggestions?

Cheers,

Jord





Hi,
I thought it was about time I started using a db abstraction class. Problem 
is, there are so many out there that I don't which one to start using?

I've heard of ADODB (I think).

Anyone have any suggestions?

Cheers,

Jord





Hi,
I thought it was about time I started using a db abstraction class. Problem 
is, there are so many out there that I don't which one to start using?

I've heard of ADODB (I think).

Anyone have any suggestions?

Cheers,

Jord



Reply via email to