php-general Digest 2 Sep 2003 12:40:13 -0000 Issue 2273

Topics (messages 161404 through 161437):

multiple db query
        161404 by: Aris  Santillan
        161406 by: John W. Holmes
        161435 by: Marek Kilimajer
        161436 by: murugesan

Re: How Energy Storage can help us ?
        161405 by: Flywheel

script archives
        161407 by: Dennis Gearon
        161408 by: Chris Shiflett
        161409 by: Dennis Gearon
        161410 by: Dennis Gearon

Re: session-problem
        161411 by: Curt Zirzow

Re: MySQL Left Join Question
        161412 by: Nicholas Robinson

Re: TIME
        161413 by: Nicholas Robinson
        161414 by: Curt Zirzow

accessing $GLOBALS values
        161415 by: Dennis Gearon
        161428 by: Ivo Fokkema

Copy database from MySQL to MSAccess
        161416 by: Kjell Hansen
        161418 by: Leonie
        161434 by: Kjell Hansen

web-mail problem
        161417 by: Lingua2001
        161421 by: Raditha Dissanayake
        161430 by: Viraj Kalinga Abayarathna

Re: randomly select a table, better way?
        161419 by: Jason Wong

Re: php 5 - mysql replication
        161420 by: Moritz Steiner

Re: Lack of info
        161422 by: David Robley

Block HTML Control
        161423 by: Seth Willits
        161424 by: Jason Wong
        161425 by: Seth Willits
        161426 by: Raditha Dissanayake
        161429 by: Seth Willits
        161432 by: Viraj Kalinga Abayarathna
        161433 by: Viraj Kalinga Abayarathna

Re: PHP Interview questions and how to pass parameters to .js files
        161427 by: murugesan

Re: Foring a file download *and* page reload
        161431 by: Marek Kilimajer

Re: execute command line script from browser
        161437 by: Jay Blanchard

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 ---
is it possible to query on 2 databases
but with same tablename and merge its output?

--- End Message ---
--- Begin Message --- Aris Santillan wrote:
is it possible to query on 2 databases
but with same tablename and merge its output?

Probably. It depends upon your database, though.


SELECT t1.column, t2.column FROM database1.table1 t1, database2.table2 t2 WHERE ...

--
---John Holmes...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- For MySQL Version 3.23.25 and above - yes, and it is (surprisingly) called MERGE. I'm not sure if tables can be merged across databases. More in the manual.

Aris Santillan wrote:

is it possible to query on 2 databases
but with same tablename and merge its output?


--- End Message ---
--- Begin Message ---
I tried this and it is working well.

I use 2 DB namely db1 and db2

Mysql>use db1;
Mysql>select vv.visitorname,aa.visitorname  from  db1.visitordetails vv,
db2.visitordetails aa;

-Murugesan



----- Original Message -----
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Aris Santillan" <[EMAIL PROTECTED]>
Cc: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Tuesday, September 02, 2003 4:29 PM
Subject: Re: [PHP] multiple db query


> For MySQL Version 3.23.25 and above - yes, and it is (surprisingly)
> called MERGE. I'm not sure if tables can be merged across databases.
> More in the manual.
>
> Aris Santillan wrote:
>
> > is it possible to query on 2 databases
> > but with same tablename and merge its output?
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Nice Hello from Flywheel Storage 

& Sun Tracking 

Goodbay to Blackout forever 




[EMAIL PROTECTED]




Responding to your Questions;





We offer Safety Solution

Rolling Blackout will always happened, since the SYSTEM - 
is design to protect itself in dangerous 
Over-Current Situations.

Breakers basic duty is defense whole system, shut down, 
and isolate from Grid; 


"Wave of over-current" travel to next Sub-Station
and stimulate the same results on another, then another, 
then another. And a VOLTAGE is growing rapidly.

Growing Disconnection in Domino Effect; 
we did seen twice;


Accident ~ 30 years ago (baby boom) - for purpose recently.


To decrease all "Over-Current situation"

in POWER LINE or reduce to Zero     

ALL EXCESS ENERGY                

USE

Energy Storage 25 - 1000 MWh 

and no Sub - Station will ever have any risk again.


Small units UPS   20 - 200 kWh protect Stories, 

mainframes, servers, computers and homes, 

hospitals, public & private places;

give back emergency energy for hours & days

and/or time for diesel/gas generator to work.

But with Solar Palette & Sun Tracking - you don't need anything else.

& Enjoy Safety & Energy Supply for generations to come;




Rest you can find on:

 

www.sun-tracking.com

www.flywheel-storage.com

 
 
[EMAIL PROTECTED]




Thanks,

 
 Have a nice Weekend !

--- End Message ---
--- Begin Message --- I'm trying to find a script archive I once used to go to. It was neck and neck with hotscripts.com in usable scripts. It was for PHP only scripts. I THOUGHT it was called phpscripts.com, but no such site exists.

anyone give a short list of PHP script archive sites?
--- End Message ---
--- Begin Message ---
--- Dennis Gearon <[EMAIL PROTECTED]> wrote:
> I'm trying to find a script archive I once used to go to. It was neck 
> and neck with hotscripts.com in usable scripts. It was for PHP only 
> scripts. I THOUGHT it was called phpscripts.com, but no such site
> exists.

Perhaps you are thinking of David Sklar's PHP code exchange?

http://px.sklar.com/

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message --- Chris Shiflett wrote:

--- Dennis Gearon <[EMAIL PROTECTED]> wrote:


I'm trying to find a script archive I once used to go to. It was neck and neck with hotscripts.com in usable scripts. It was for PHP only scripts. I THOUGHT it was called phpscripts.com, but no such site
exists.



Perhaps you are thinking of David Sklar's PHP code exchange?


http://px.sklar.com/

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/



found it, didn't think to put a dash in it:

http://www.php-scripts.com/
--- End Message ---
--- Begin Message --- Chris Shiflett wrote:

--- Dennis Gearon <[EMAIL PROTECTED]> wrote:


I'm trying to find a script archive I once used to go to. It was neck and neck with hotscripts.com in usable scripts. It was for PHP only scripts. I THOUGHT it was called phpscripts.com, but no such site
exists.



Perhaps you are thinking of David Sklar's PHP code exchange?


http://px.sklar.com/

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/



opps, guess not, it wasn't:

http://www.php-scripts.com/

unles it's changed a lot and gone down hill as well.
--- End Message ---
--- Begin Message ---
* Thus wrote Juerg Zgraggen ([EMAIL PROTECTED]):
> :-)  cool thank you!
> is any "$_"-variable superglobal? $_REQUEST, $_POST, ...?

Correct.

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

--- End Message ---
--- Begin Message ---
I'm not clear whether you are saying you get the records where there is a 
match and no non-matching records, or simply no records at all!

What happens if you take out the WHERE clause, do you get all the records from 
p being displayed with NULLs for c.projectid where no match exists? 

Nick

On Monday 01 Sep 2003 11:00 pm, Van Andel, Robbert wrote:
> This may not be the best place to ask this question, but I'm running into a
> problem when I perform a left join sql statement in PHP.  The sql statement
> is as follows:
>
> SELECT p.id
> pid,p.designID,p.project_name,p.node,p.received,p.lots,p.ugfootage,p.aerial
>f ootage,p.node,c.* FROM projects as p LEFT JOIN proSub as c on
> p.id=c.projectID WHERE p.id=$id
>
> I have verified that $id has a value.  What I'm finding is that when there
> is no corresponding entry in proSub, the query returns nothing even though
> LEFT JOIN is supposed to return the contents of the left table even if the
> right table has no data.  The left data does have data and I am asking for
> the correct value for p.id.  I've run into some other scripts on my site
> where left join does not behave the way it's supposed to.
>
> Any thoughts??
>
> Robbert van Andel

--- End Message ---
--- Begin Message ---
Not directly as far as I know. Try using chronyd or similar (google will point 
you in the right direction). This works well with one of my machines that has 
a wayward clock and chronyd is happy to work with networks not permanently 
connected to the internet.

On Tuesday 02 Sep 2003 1:11 am, Dale Hersh wrote:
> The battery on my server keeps on dieing, so the clock is not keeping time
> correctly. I was wondering is there any way to query some type of global
> time source in php?
>
> Thanks,
> Dale

--- End Message ---
--- Begin Message ---
* Thus wrote Dale Hersh ([EMAIL PROTECTED]):
> The battery on my server keeps on dieing, so the clock is not keeping time
> correctly. I was wondering is there any way to query some type of global
> time source in php?

Totally unrealated to php but search for:

 Network Time Protocol (NTP) 

That will keep your clocks in sync.

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

--- End Message ---
--- Begin Message --- I am looking at the 'tackle' library available at sourceforge. It's a 'Tiny ACL' (access control list). Seems pretty good, simple and to the point.

AND, it is database neutral, using ADODB. I haven't figured out how it does referential integrity in the database yet, but I suspect it's using table locking.

One thing I'm a little confused about is the usage of $GLOBALS array, in this manner:

$GLOBALS[SOME_NAME].

I thought that it should be:

$GLOBALS['SOME_NAME'].
--- End Message ---
--- Begin Message ---
"Dennis Gearon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

[snip]

> One thing I'm a little confused about is the usage of $GLOBALS array, in
> this manner:
>
>    $GLOBALS[SOME_NAME].
>
> I thought that it should be:
>
>    $GLOBALS['SOME_NAME'].
Hi,

You should use quotes to tell PHP it's a string you're using as a key of
$GLOBALS. However, when not using quotes PHP will first look for a constant
with that name. If PHP can't find any, it will assume it's a string. So not
using quotes might lead to problems when you use the name of a constant as a
key.

I hope this is clear, more info can be found at
http://www.php.net/manual/en/language.types.array.php and scroll down to
'Array do's and don'ts' -> 'Why is $foo[bar] wrong?'

HTH,

Ivo Fokkema

--- End Message ---
--- Begin Message ---
Hi there,
I'd like to have a template DB stored with MySQL from which I later can
create clientDB's for use with MSAccess.
I've read that I can connect to MSAccess with PHP through ODBC and that's
fine but how do I transfer the tables and cusomized data?

TIA
/Kjell Hansen

--- End Message ---
--- Begin Message ---
Hi Kjell

I'm not sure whether you are transferring from within the webserver, or from
the webserver to MS locally, but either way I'd set up the MS database
locally.  Just install the MySQL ODBC driver (I think its at the mysql.com
website) and link all the MySQL tables to your MS Access database and just
import the tables using the processes within Access itself.

Afterwards you can transfer the Access database up to the server.

If you are doing the database functions wholly within the server you might
consider using the Pear DB database abstraction layer to make it simplier.
(That's how I'd do it anyway).

Cheers
Leonie

"Kjell Hansen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there,
> I'd like to have a template DB stored with MySQL from which I later can
> create clientDB's for use with MSAccess.
> I've read that I can connect to MSAccess with PHP through ODBC and that's
> fine but how do I transfer the tables and cusomized data?
>
> TIA
> /Kjell Hansen

--- End Message ---
--- Begin Message ---
Hi Leonie
My approach is to have the empty AccessDB on the server. Make a copy of it
and insert all the tables into the copy and then have it downloaded from the
server. So I'm actually never gonna use Access, it's just the database I'm
using for storage of data.

One way of doing this could be to store the table definitions as
SQL-statements in another table, but I'm not very thrilled about that idea.

TIA
/Kjell Hansen

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

I am trying to solve a problem related to mail( ). I am not
sure whether it is from SMTP directly or html tags used for html form mail.
I got the following message, and has anyone seen this before?

*********************************************************
This email is being returned to you because the remote server would not
or could not accept the message. The registeredsite servers are just
reporting to you what happened and are not the source of the problem.

The address which was undeliverable is in the section labeled:
  "----- The following addresses had permanent fatal errors -----".

The reason your mail is being returned to you is in the section labeled:
  "----- Transcript of Session Follows -----".

The line beginning with "<<<" describes the specific reason your e-mail
could
not be delivered.  The next line contains a second error message which is a
general translation for other e-mail servers.

***********************************************************

Thank you in advance.

David

--- End Message ---
--- Begin Message --- Hello,
Your message does not contain enough information for us to help you. Guessing in the dark i can tell you that you are not using the correct encodings for your message. It's not really a good idea to use the mail() function for html mail, there are plenty of mail classes out there that can do a better job. You will find references to quite a few on this lists archives.



all the best raditha.

Lingua2001 wrote:

Hi all,

I am trying to solve a problem related to mail( ). I am not
sure whether it is from SMTP directly or html tags used for html form mail.
I got the following message, and has anyone seen this before?

*********************************************************
This email is being returned to you because the remote server would not
or could not accept the message. The registeredsite servers are just
reporting to you what happened and are not the source of the problem.

The address which was undeliverable is in the section labeled:
 "----- The following addresses had permanent fatal errors -----".

The reason your mail is being returned to you is in the section labeled:
 "----- Transcript of Session Follows -----".

The line beginning with "<<<" describes the specific reason your e-mail
could
not be delivered.  The next line contains a second error message which is a
general translation for other e-mail servers.

***********************************************************

Thank you in advance.

David




--
Raditha Dissanayake
http://www.radinks.com/sftp/?sg
Lean and mean secure FTP applet in pure java.
Complete with Graphical User Inteface Just 150 kb in size.

--- End Message ---
--- Begin Message ---
David,
first, this is a meassage you are getting from your mail server,
not from PHP.

according to my knowladge this is due to email address routing
problem which the mail server experience when it tries to relay the
mail.
if you can send me the complete bounce mail message you recieve
i'll tell you exactly whats going on there.

Viraj

Lingua2001 wrote:
> 
> Hi all,
> 
> I am trying to solve a problem related to mail( ). I am not
> sure whether it is from SMTP directly or html tags used for html form mail.
> I got the following message, and has anyone seen this before?
> 
> *********************************************************
> This email is being returned to you because the remote server would not
> or could not accept the message. The registeredsite servers are just
> reporting to you what happened and are not the source of the problem.
> 
> The address which was undeliverable is in the section labeled:
>   "----- The following addresses had permanent fatal errors -----".
> 
> The reason your mail is being returned to you is in the section labeled:
>   "----- Transcript of Session Follows -----".
> 
> The line beginning with "<<<" describes the specific reason your e-mail
> could
> not be delivered.  The next line contains a second error message which is a
> general translation for other e-mail servers.
> 
> ***********************************************************
> 
> Thank you in advance.
> 
> David
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
On Tuesday 02 September 2003 08:17, Daniel Bray wrote:
> So then the total code would be:
>
> <?
>       $mysqlconnect = mysql_connect("localhost", "mysqladmin",
> "i.hate.microsoft"); $result = mysql_list_tables("Bookmarks");
>
>       $n = mysql_num_rows($result);
>       $seek = mt_rand(0, $n-1);
>       $random_table = mysql_data_seek($result, $seek);
>
>       echo "<br><br>The randomly slected table was<b>$random_table</b><br><br>";
> ?>
>
> If so, then this does not work for me.  All I get is $random_table == 1. 
> If not, then what am I missing.

You didn't RTFM -> mysql_list_tables()
                   mysql_tablename()
                   mysql_fetch_array() and friends

-- 
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
------------------------------------------
/*
Intuition, however illogical, is recognized as a command prerogative.
                -- Kirk, "Obsession", stardate 3620.7
*/

--- End Message ---
--- Begin Message ---
If php knows about replication, it can balance the select querys on the different 
servers...




-----Ursprüngliche Nachricht-----
Von: Curt Zirzow [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 1. September 2003 19:30
An: [EMAIL PROTECTED]
Betreff: Re: [PHP] php 5 - mysql replication

* Thus wrote Moritz Steiner ([EMAIL PROTECTED]):
> I've heard that php 5 is going to support mysql replication, has anyone
> more details about it, it is already working in the beta release?

Can you enlighten me as to what special things php needs to do
replication?

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

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

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> IM not ranting, IM pointing out that I have looked on the website and the
> FAQ is a joke and help from other sources is either buy something or as the
> case of IRC, no channel of that description was turned up in the search.

<SNIP dozens of lines of NOT_RANT>

Somewhere in there I think you may have asked a question but it was well 
hidden. Perhaps if you were to simply ask your question, someone might 
help you.

Oh, and there is a #php on irc.freenode.net (at least)

-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

--- End Message ---
--- Begin Message --- I'd like to show a big chunk of HTML if a particular variable is true, and if its false I'd like to show a different big chunk of html. Right now the only way I know of doing this is:

if ($var) {
        print '
                <lots>
                <of>
                <html>
        ';
} else {
        print '
                <lots>
                <of>
                <html>
        ';      
}

This works, but it destroys the syntax coloring of the html making it all one solid color. I'd love to know if there's a better way OTHER than include()ing different files.



Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames


"Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
------------------------------------------------------------------------ ---

--- End Message ---
--- Begin Message ---
On Tuesday 02 September 2003 15:00, Seth Willits wrote:
> I'd like to show a big chunk of HTML if a particular variable is true,
> and if its false I'd like to show a different big chunk of html. Right
> now the only way I know of doing this is:
>
> if ($var) {
>       print '
>               <lots>
>               <of>
>               <html>
>       ';
> } else {
>       print '
>               <lots>
>               <of>
>               <html>
>       ';
> }
>
> This works, but it destroys the syntax coloring of the html making it
> all one solid color. I'd love to know if there's a better way OTHER
> than include()ing different files.

<?php if ($doo): ?>

  <html>Lots of</html>

<?php endif; ?>

-- 
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
------------------------------------------
/*
For every complex problem, there is a solution that is simple, neat, and 
wrong.
                -- H. L. Mencken
*/

--- End Message ---
--- Begin Message --- On Tuesday, September 2, 2003, at 12:03 AM, Jason Wong wrote:

<?php if ($doo): ?>

<html>Lots of</html>

<?php endif; ?>

Awesome. Thanks for the quick reply.



Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames


"There are 10 types of people in this world - those that understand binary
and those that don't."
------------------------------------------------------------------------ ---

--- End Message ---
--- Begin Message ---
you can try
if( $var) require("1.html");
else require("2.html");


Seth Willits wrote:


I'd like to show a big chunk of HTML if a particular variable is true, and if its false I'd like to show a different big chunk of html. Right now the only way I know of doing this is:

if ($var) {
print '
<lots>
<of>
<html>
';
} else {
print '
<lots>
<of>
<html>
'; }


This works, but it destroys the syntax coloring of the html making it all one solid color. I'd love to know if there's a better way OTHER than include()ing different files.



Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames


"Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
------------------------------------------------------------------------ ---



--
Raditha Dissanayake
http://www.radinks.com/sftp/?sg
Lean and mean secure FTP applet in pure java.
Complete with Graphical User Inteface Just 150 kb in size.

--- End Message ---
--- Begin Message --- On Tuesday, September 2, 2003, at 12:06 AM, Seth Willits wrote:

<?php if ($doo): ?>

<html>Lots of</html>

<?php endif; ?>

Awesome. Thanks for the quick reply.

Hmm.. Actually, how does this work with php & html? This is actually what I'm trying to do. I should have said this in the first place, sorry :)


<?php
if ($thisVar) {
        if ($myVar) {
                lots;
                of;
                php;
        } else {
                <lots>
                <of>
                <html>
        }
}
?>



Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames


"Read the book! Be patient! All success comes from acquiring knowledge and experience."
-- Seth Willits
------------------------------------------------------------------------ ---

--- End Message ---
--- Begin Message ---
Seth,
try to mingle PHP and HTML.. that means escape the PHP and jump to HTML
when 
you want the HTML.. like this...


<?php
 if (!$var) {
        ?>    <lots>
                 <of>
                 <html>
        <?php
         ;
 } else {
         ?>   <lots>
                 <of>
                 <html>
         <?php ;
 }
?>


happy coding

Viraj



Seth Willits wrote:
> 
> I'd like to show a big chunk of HTML if a particular variable is true,
> and if its false I'd like to show a different big chunk of html. Right
> now the only way I know of doing this is:
> 
> if ($var) {
>         print '
>                 <lots>
>                 <of>
>                 <html>
>         ';
> } else {
>         print '
>                 <lots>
>                 <of>
>                 <html>
>         ';
> }
> 
> This works, but it destroys the syntax coloring of the html making it
> all one solid color. I'd love to know if there's a better way OTHER
> than include()ing different files.
> 
> Seth Willits
> ------------------------------------------------------------------------
> ---
> President and Head Developer of Freak Software - http://www.freaksw.com
> Q&A Columnist for REALbasic Developer Magazine -
> http://www.rbdeveloper.com
> Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
> 
> "Knowledge is limited. Imagination encircles the world."
>      -- Albert Einstein
> ------------------------------------------------------------------------
> ---
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Seth,

 <?php
 if ($thisVar) {
         if ($myVar) {
                 lots;
                 of;
                 php;
         } else {
                 // End of PHP content
                                ?>
                                 <lots>
                 <of>
                 <html>
                                 <?php
                         // End of HTML content
         }
 }
 ?>

rgd

viraj


Seth Willits wrote:
> 
> On Tuesday, September 2, 2003, at 12:06  AM, Seth Willits wrote:
> 
> >> <?php if ($doo): ?>
> >>
> >>   <html>Lots of</html>
> >>
> >> <?php endif; ?>
> >
> > Awesome. Thanks for the quick reply.
> 
> Hmm.. Actually, how does this work with php & html? This is actually
> what I'm trying to do. I should have said this in the first place,
> sorry :)
> 
> <?php
> if ($thisVar) {
>         if ($myVar) {
>                 lots;
>                 of;
>                 php;
>         } else {
>                 <lots>
>                 <of>
>                 <html>
>         }
> }
> ?>
> 
> Seth Willits
> ------------------------------------------------------------------------
> ---
> President and Head Developer of Freak Software - http://www.freaksw.com
> Q&A Columnist for REALbasic Developer Magazine -
> http://www.rbdeveloper.com
> Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
> 
> "Read the book! Be patient! All success comes from acquiring knowledge
> and experience."
>          -- Seth Willits
> ------------------------------------------------------------------------
> ---
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I think this program will work under the condition that the fault one is
heavier in weight, but the case is that it may be "lighter" OR "heavier".

Ok enough of php interview questions.
I need to pass a value to a function in .js file which has been linked in a
php file which in turn has been included in another php file.

------------------
//main.php
fetch DB values and store it in $param.
include"first.php"
------------------->

-------------------
//first.php
<script language='JavaScript' src='/myjs.js'>
</script>
------------------->

-------------------
myjs.js
function fun(param)
{
... process with param
}
------------------->

How can I achieve this?

-murugesan

----- Original Message -----
> Binary search.  I'd say I have too much time on my hands, but I don't.
>
> <?php
>
> $eggs = array(1,1,1,1,1,2,1,1,1,1,1,1);
>
> $eggs1_6 = array_slice($eggs, 0, 6);
> $eggs7_12 = array_slice($eggs, 6, 6);
>
> if (array_sum($eggs1_6) > array_sum($eggs7_12))/////////// First time
> $half_eggs = $eggs1_6;
> else
> $half_eggs = $eggs7_12;
>
> $eggs1_3 = array_slice($half_eggs, 0, 3);
> $eggs4_6 = array_slice($half_eggs, 3, 3);
>
> if (array_sum($eggs1_3) > array_sum($eggs4_6))///////////Second time
> $quarter_eggs = $eggs1_3;
> else
> $quarter_eggs = $eggs4_6;
>
> if ($quarter_eggs[0] == $quarter_eggs[1])///////////Third time
> $egg = $quarter_eggs[2];
> else if ($quarter_eggs[0] > $quarter_eggs[1])
> $egg = $quarter_eggs[0];
> else
> $egg = $quarter_eggs[1];
>
> $index = array_search($egg, $eggs) + 1;
>
> print "Heavy egg is egg number {$index}\n";
>
> ?>
>
> murugesan wrote:
>
> > In a group of 12 eggs only one is having weight less or more.
> > Can we have a program to find the egg, provided we have to weigh only
three
> > times with a weighing machine with two pans,without using weights.

--- End Message ---
--- Begin Message --- You can use either a <meta> tag or real header, the later is prefered.

<?php

header('Refresh: 0; url=download.zip');

?>
<html>
<!-- your html page here -->
</html>

The browser loads the page and immediatly goes to another page (download.zip). This page will prompt the Save As dialog.


Jean-Christian IMbeault wrote:
Marek Kilimajer wrote:

But because explorer does not support multipart/mixed and it is still the major browser (thought not for long ;), do it this way. Output header('Refresh: 0; url=download.zip'); first and then load the html page with new data blocks.


Sorry if the solution is obvious but I can't understand what you mean by
using a refresh header. Where and when should I use the header? Can you
give a short example?

Thanks,

Jean-Christian Imbeault


--- End Message ---
--- Begin Message ---
[snip]
Is there a way to execute a command line php script from a browser by,
say
clicking a button and then having the browser let go and let the script
run
independet of the browser? Hope I explained that correctly.
[/snip]

You could invoke the CLI using an exec() http://www.php.net/exec

HTH!

--- End Message ---

Reply via email to