php-windows Digest 28 May 2004 06:26:15 -0000 Issue 2265
Topics (messages 23865 through 23881):
Re: Transfering database
23865 by: Gryffyn, Trevor
23866 by: Alejandro C�sar Garrammone
23868 by: Svensson, B.A.T. (HKG)
Re: Output Control
23867 by: Svensson, B.A.T. (HKG)
23869 by: Jason Barnett
23870 by: Svensson, B.A.T. (HKG)
23871 by: Jason Barnett
23872 by: Bowden, Zeb
23873 by: Gryffyn, Trevor
23874 by: Svensson, B.A.T. (HKG)
23878 by: Jason Barnett
23879 by: Svensson, B.A.T. (HKG)
PHP GET VARIABLES
23875 by: Michael
23876 by: Svensson, B.A.T. (HKG)
23877 by: Svensson, B.A.T. (HKG)
23880 by: Jordi Canals
configuration mime type problem
23881 by: Tony Moore
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 ---
Firstly.. Isn't this a list where people can ask for help, even when
they're just getting started in PHP? I'm guessing that english isn't
Sudeep's first language, but the request was clear enough for us to
understand and answer. Don't assume that someone hasn't done research
just because the question is simple.
As for unix systems and such, he said that he didn't know unix shell
commands, but the 'root' login mentioned seems to be the one for the
MySQL database, not the *nix system.
What I'd recommend.. If a PHP script is requested for the task, possibly
in order to avoid using *nix commands that someone might not be as
familiar with as PHP, is to write a PHP script to do something like
this:
1. Make connection to source database and read data from tables (even
table structure if you want) into arrays
2. Make connection to destinatination database and perform the necessary
inserts and possibly create the tables needed
It'll take a little work and maybe Sudeep is just wondering if someone
had already created a script to do this. Maybe that's what the question
really is, not "How do I import a bunch of dumped tables from text files
into SQL using unix commands I'm not familiar with". Try reading
between the lines a little guys, and being a little more charitable.
None of us were born with PHP knowledge, we all had to learn somewhere.
-TG
> -----Original Message-----
> From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 5:19 AM
> To: Sudeep Zamudra; Svensson, B.A.T. (HKG)
> Cc: php mailinglist
> Subject: RE: [PHP-WIN] Transfering database
>
>
> why dont you do some research before you just expect other
> people to your
> work for you. YOu seem to make no attempt to find out
> anything about what
> you've asked. Svensson gave you the the commands for what you
> just asked.
>
> it's getting ridiculous, anyone second that?
>
> Angelo
>
> -----Original Message-----
> From: Sudeep Zamudra [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 10:04 AM
> To: Svensson, B.A.T. (HKG)
> Cc: php mailinglist
> Subject: RE: [PHP-WIN] Transfering database
>
>
> hi,
>
> Please make it clear. My server is unix. I have no knowledge of shell
> commands. This is what i want. Ex:- My username is root and
> database name is
> xyz and the .sql file is in my server www/html/test/. What should i do
>
> "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]> wrote:
> RTFM:
>
> popen("mysql -u username -p database <
> C:\path\to\your\dump\file.sql");
>
> shell_exec("mysql -u username -p database <
> C:\path\to\your\dump\file.sql");
>
> system("mysql -u username -p database <
> C:\path\to\your\dump\file.sql");
>
>
> etc, etc, etc...
>
> -----Original Message-----
> From: Sudeep Zamudra
> To: Jeroen Serpieters
> Cc: [EMAIL PROTECTED]
> Sent: 27-5-2004 9:13
> Subject: Re: [PHP-WIN] Transfering database
>
> Thanx for your suggestions. But i am looking for a php script
> by which i
> can do this not from the mysql shell command line. If any has it .
> Please suggest it to me.
>
> Thanx
>
> Jeroen Serpieters wrote:
> On Wed, 26 May 2004, Sudeep Zamudra wrote:
>
> >
> > I have dumped my entire database into files with extension '.sql'
> (separate file for each table). Now please tell me any function or
> statements if any to tranfer the contents of the file(i.e table
> structure and table contents) into a new database which is on another
> database server. I guess there is a statement for this. Help please.
> >
>
>
> --
> Jeroen
>
> There are only two kinds of programming languages: those people always
> bitch about and those nobody uses.
> -- Bjarne Stroustrup
--- End Message ---
--- Begin Message ---
Look Sudeep, I do some research for you, all the funtions php do is on the
manual, exactly on "Function Reference" Chapter LXI (Mysql).
Hope this helps, but I'm agree with the guys that you need to do some
research (first of all, always check the manual) before you post here. Don't
take it bad, but for me, it's the way it is.
Best regards,
Alex
----- Original Message -----
From: "Angelo Zanetti" <[EMAIL PROTECTED]>
To: "Sudeep Zamudra" <[EMAIL PROTECTED]>; "Svensson, B.A.T. (HKG)"
<[EMAIL PROTECTED]>
Cc: "php mailinglist" <[EMAIL PROTECTED]>
Sent: Thursday, May 27, 2004 6:19 AM
Subject: RE: [PHP-WIN] Transfering database
> why dont you do some research before you just expect other people to your
> work for you. YOu seem to make no attempt to find out anything about what
> you've asked. Svensson gave you the the commands for what you just asked.
>
> it's getting ridiculous, anyone second that?
>
> Angelo
>
> -----Original Message-----
> From: Sudeep Zamudra [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 10:04 AM
> To: Svensson, B.A.T. (HKG)
> Cc: php mailinglist
> Subject: RE: [PHP-WIN] Transfering database
>
>
> hi,
>
> Please make it clear. My server is unix. I have no knowledge of shell
> commands. This is what i want. Ex:- My username is root and database name
is
> xyz and the .sql file is in my server www/html/test/. What should i do
>
> "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]> wrote:
> RTFM:
>
> popen("mysql -u username -p database < C:\path\to\your\dump\file.sql");
>
> shell_exec("mysql -u username -p database <
C:\path\to\your\dump\file.sql");
>
> system("mysql -u username -p database < C:\path\to\your\dump\file.sql");
>
>
> etc, etc, etc...
>
> -----Original Message-----
> From: Sudeep Zamudra
> To: Jeroen Serpieters
> Cc: [EMAIL PROTECTED]
> Sent: 27-5-2004 9:13
> Subject: Re: [PHP-WIN] Transfering database
>
> Thanx for your suggestions. But i am looking for a php script by which i
> can do this not from the mysql shell command line. If any has it .
> Please suggest it to me.
>
> Thanx
>
> Jeroen Serpieters wrote:
> On Wed, 26 May 2004, Sudeep Zamudra wrote:
>
> >
> > I have dumped my entire database into files with extension '.sql'
> (separate file for each table). Now please tell me any function or
> statements if any to tranfer the contents of the file(i.e table
> structure and table contents) into a new database which is on another
> database server. I guess there is a statement for this. Help please.
> >
>
>
> --
> Jeroen
>
> There are only two kinds of programming languages: those people always
> bitch about and those nobody uses.
> -- Bjarne Stroustrup
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> ---------------------------------
> Do you Yahoo!?
> Friends. Fun. Try the all-new Yahoo! Messenger
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> ---------------------------------
> Do you Yahoo!?
> Friends. Fun. Try the all-new Yahoo! Messenger
>
> --------------------------------------------------------------------
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Considering myself, I am not a mind reader...
-----Original Message-----
From: Gryffyn, Trevor
To: php mailinglist
Cc: Sudeep Zamudra
Sent: 27-5-2004 15:41
Subject: RE: [PHP-WIN] Transfering database
Firstly.. Isn't this a list where people can ask for help, even when
they're just getting started in PHP? I'm guessing that english isn't
Sudeep's first language, but the request was clear enough for us to
understand and answer. Don't assume that someone hasn't done research
just because the question is simple.
As for unix systems and such, he said that he didn't know unix shell
commands, but the 'root' login mentioned seems to be the one for the
MySQL database, not the *nix system.
What I'd recommend.. If a PHP script is requested for the task, possibly
in order to avoid using *nix commands that someone might not be as
familiar with as PHP, is to write a PHP script to do something like
this:
1. Make connection to source database and read data from tables (even
table structure if you want) into arrays
2. Make connection to destinatination database and perform the necessary
inserts and possibly create the tables needed
It'll take a little work and maybe Sudeep is just wondering if someone
had already created a script to do this. Maybe that's what the question
really is, not "How do I import a bunch of dumped tables from text files
into SQL using unix commands I'm not familiar with". Try reading
between the lines a little guys, and being a little more charitable.
None of us were born with PHP knowledge, we all had to learn somewhere.
-TG
> -----Original Message-----
> From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 5:19 AM
> To: Sudeep Zamudra; Svensson, B.A.T. (HKG)
> Cc: php mailinglist
> Subject: RE: [PHP-WIN] Transfering database
>
>
> why dont you do some research before you just expect other
> people to your
> work for you. YOu seem to make no attempt to find out
> anything about what
> you've asked. Svensson gave you the the commands for what you
> just asked.
>
> it's getting ridiculous, anyone second that?
>
> Angelo
>
> -----Original Message-----
> From: Sudeep Zamudra [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 10:04 AM
> To: Svensson, B.A.T. (HKG)
> Cc: php mailinglist
> Subject: RE: [PHP-WIN] Transfering database
>
>
> hi,
>
> Please make it clear. My server is unix. I have no knowledge of shell
> commands. This is what i want. Ex:- My username is root and
> database name is
> xyz and the .sql file is in my server www/html/test/. What should i do
>
> "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]> wrote:
> RTFM:
>
> popen("mysql -u username -p database <
> C:\path\to\your\dump\file.sql");
>
> shell_exec("mysql -u username -p database <
> C:\path\to\your\dump\file.sql");
>
> system("mysql -u username -p database <
> C:\path\to\your\dump\file.sql");
>
>
> etc, etc, etc...
>
> -----Original Message-----
> From: Sudeep Zamudra
> To: Jeroen Serpieters
> Cc: [EMAIL PROTECTED]
> Sent: 27-5-2004 9:13
> Subject: Re: [PHP-WIN] Transfering database
>
> Thanx for your suggestions. But i am looking for a php script
> by which i
> can do this not from the mysql shell command line. If any has it .
> Please suggest it to me.
>
> Thanx
>
> Jeroen Serpieters wrote:
> On Wed, 26 May 2004, Sudeep Zamudra wrote:
>
> >
> > I have dumped my entire database into files with extension '.sql'
> (separate file for each table). Now please tell me any function or
> statements if any to tranfer the contents of the file(i.e table
> structure and table contents) into a new database which is on another
> database server. I guess there is a statement for this. Help please.
> >
>
>
> --
> Jeroen
>
> There are only two kinds of programming languages: those people always
> bitch about and those nobody uses.
> -- Bjarne Stroustrup
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I dont have any problem with flush()... ;)
-----Original Message-----
From: Luis Moreira
To: Svensson, B.A.T. (HKG)
Cc: '[EMAIL PROTECTED] '
Sent: 27-5-2004 15:39
Subject: Re: [PHP-WIN] Output Control
Svensson, B.A.T. (HKG) wrote:
>Are you trying to say that flush() does not work properly for you, i.e
you
>don't see the numbers comming one by one with a seconds delay, but get
all
>at once?
>
>
>
William,
If you go to www.php.net and look for "flush" you will see that the
problem you experience is related to either the web server or the web
client.
I think that this is not a PHP issue.
It is true that (I tried this with my own Apache server) that the
numbers come out all at the end, and not with a second's interval.
I will try and search a bit further.
Luis
<<ATT985242.txt>>
--- End Message ---
--- Begin Message ---
When PHP is used to serve pages it won't output anything until it is
completely finished with execution. If you're trying to show 10 numbers
with a one second delay you'd probably need to use refresh tags and a
hidden field (or sessions) to loop back to the same page with each
"second". I.e.
<?php
error_reporting(E_ALL);
session_start();
$time = &$_SESSION['time'];
$time++;
$delay = 1;
$wait = 10;
if ($time < $wait) {
echo "<meta http-equiv=\"refresh\"
content=\"$delay\";url=\"{$_SERVER['PHP_SELF']}\">";
echo "<form><input type=\"hidden\" name=\"time\"
value=\"$time\">$time</form>";
}
?>
--- End Message ---
--- Begin Message ---
That's not completely true...
-----Original Message-----
From: Jason Barnett
To: [EMAIL PROTECTED]
Sent: 27-5-2004 20:59
Subject: Re: [PHP-WIN] Output Control
When PHP is used to serve pages it won't output anything until it is
completely finished with execution. If you're trying to show 10 numbers
with a one second delay you'd probably need to use refresh tags and a
hidden field (or sessions) to loop back to the same page with each
"second". I.e.
--- End Message ---
--- Begin Message ---
OK, that's news to me. Could you help explain this to the class? And
yes, I've put in some effort trying to understand this already :) Every
time I execute a script (a la Apache) I don't get any output until
execution finishes.
--- End Message ---
--- Begin Message ---
Have you tried this? Worked for me on IIS 6...
<?php
static $i = 0;
while ($i < 10) {
++$i;
echo "$i\n\n";
sleep(1);
ob_flush();
}
?>
-Zeb Bowden
-----Original Message-----
From: Jason Barnett [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 3:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Output Control
OK, that's news to me. Could you help explain this to the class? And
yes, I've put in some effort trying to understand this already :) Every
time I execute a script (a la Apache) I don't get any output until
execution finishes.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You can buffer your output and control how much of a buffer to use (so
it will flush the output and send to the web server to send to the
client) when the buffer is full, but the buffer, I believe, is also
automatically flushed periodically whether it's full or not.
You can do an implicit_flush, which forces a "flush()" after each output
operation, or you can manually "flush()" when you want to send the
output to the web server. I highly recommend AGAINST turning
"implicit_flush()" on because flushing constantly usually slows down the
process and isn't really necessary, but it's nice to have the option if
you need it.
You can also turn off your output buffer (the default? Maybe not.. I
forget),BUT!!.. The web server usually has some kind of output
buffering as well.
ALSO.. Another thing to keep in mind is that some operations on the
browser side don't render until they receive certain amounts of
information. If you send a table to a web browser, it'll wait to see
the "</table>" tag before rendering, if possible, so that it knows how
everything's going to play out visually.
So you have multiple buffers that are working together:
1. PHP's output buffer
2. Your web server's output buffer
3. Your web browsers rendering/display buffer
All of these buffers have the potential to hold things until they're
ready to do something with it or their buffers fill up.
If you want to test it all, try outputting a large amount of data (or at
least doing more than 1 through 10 with a 1 second delay) and trying
differen't flushing and buffer size options in PHP and do some research
on the output buffering in your web server. I believe I was reading
about someone who had had some fun issues with IIS and buffering output,
but I don't know anything about Apache's buffering practices.
Hope this helps shed a little light on the situation.
> -----Original Message-----
> From: Jason Barnett [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 3:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Output Control
>
>
> OK, that's news to me. Could you help explain this to the
> class? And
> yes, I've put in some effort trying to understand this
> already :) Every
> time I execute a script (a la Apache) I don't get any output until
> execution finishes.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Do you agree on that the purpose of flush is to send data (somewhere - not
specifying where right now) before the buffert been complelty
filled, i.e. empty the buffert in advance?
-----Original Message-----
From: Jason Barnett
To: [EMAIL PROTECTED]
Sent: 27-5-2004 21:11
Subject: Re: [PHP-WIN] Output Control
OK, that's news to me. Could you help explain this to the class? And
yes, I've put in some effort trying to understand this already :) Every
time I execute a script (a la Apache) I don't get any output until
execution finishes.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Wow, new tools for me to play with! I'm going to have to try this some
more later. I've only done a little bit of work with output buffering
and, quite frankly, I didn't even realize I could flush out data like
that. I mostly just have used output buffering to capture data before I
wanted to send HTTP headers. I've never set implicit_flush on either so
I didn't even realize that I could get that kind of interaction. You
learn something new every day.
Thanks for the detailed explanation Trevor, that output model is easy
enough to conceptualize. I suppose I would have learned about that if
I'd actually had some computer science courses, eh?
--- End Message ---
--- Begin Message ---
> I suppose I would have learned about that if
> I'd actually had some computer science courses, eh?
That is perfectly true on the other hand. ;)
--- End Message ---
--- Begin Message ---
I'm working through a tutorial book. They are retrieving variables from a
GET parameter by just referencing the variable in the script.
example:
<?php
echo "Region Name is " . $regionName . "\n";
?>
Where the variable is feed through the get URL:
http://localhost/example.php?regionName=Riverland
The only problem is that I'm using IIS so it doesn't seem to pass the
variable to the script the way the author intended. Maybe its just an IIS
issue. I can setup the var with a $_GET["regionName"] but just curious if
there is some sort of php.ini setting or something I'm missing to make this
work.
Thanks!
--- End Message ---
--- Begin Message ---
Must be an older version of php, that featured is by defualt turned of in
php nowadays. U can use $_POST['regionName'] or $_GET['regionName'] to get
the values.
-----Original Message-----
From: Michael
To: [EMAIL PROTECTED]
Sent: 27-5-2004 22:37
Subject: [PHP-WIN] PHP GET VARIABLES
I'm working through a tutorial book. They are retrieving variables from
a
GET parameter by just referencing the variable in the script.
example:
<?php
echo "Region Name is " . $regionName . "\n";
?>
Where the variable is feed through the get URL:
http://localhost/example.php?regionName=Riverland
The only problem is that I'm using IIS so it doesn't seem to pass the
variable to the script the way the author intended. Maybe its just an
IIS
issue. I can setup the var with a $_GET["regionName"] but just curious
if
there is some sort of php.ini setting or something I'm missing to make
this
work.
Thanks!
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Oh, forgett, I believe if you turn off safe mode, then you can access them
via variable names, but not really recommended from a security point of
view.
-----Original Message-----
From: Svensson, B.A.T. (HKG)
To: '[EMAIL PROTECTED] '
Sent: 27-5-2004 23:13
Subject: RE: [PHP-WIN] PHP GET VARIABLES
Must be an older version of php, that featured is by defualt turned of
in
php nowadays. U can use $_POST['regionName'] or $_GET['regionName'] to
get
the values.
-----Original Message-----
From: Michael
To: [EMAIL PROTECTED]
Sent: 27-5-2004 22:37
Subject: [PHP-WIN] PHP GET VARIABLES
I'm working through a tutorial book. They are retrieving variables from
a
GET parameter by just referencing the variable in the script.
example:
<?php
echo "Region Name is " . $regionName . "\n";
?>
Where the variable is feed through the get URL:
http://localhost/example.php?regionName=Riverland
The only problem is that I'm using IIS so it doesn't seem to pass the
variable to the script the way the author intended. Maybe its just an
IIS
issue. I can setup the var with a $_GET["regionName"] but just curious
if
there is some sort of php.ini setting or something I'm missing to make
this
work.
Thanks!
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You mean: setting register_globals = on, safe_mode is off by default.
Just setting register_globals = on you get the funtionally bellow wich
is NO recommended for security reasons. Highly recommended to read this
variables always from $_GET and $_POST global arrays, check and filter
the values recived, and you will get a site a bit more secure.
Regards,
Jordi.
Svensson, B.A.T. (HKG) wrote:
Oh, forgett, I believe if you turn off safe mode, then you can access them
via variable names, but not really recommended from a security point of
view.
-----Original Message-----
From: Michael
To: [EMAIL PROTECTED]
Sent: 27-5-2004 22:37
Subject: [PHP-WIN] PHP GET VARIABLES
I'm working through a tutorial book. They are retrieving variables from
a
GET parameter by just referencing the variable in the script.
example:
<?php
echo "Region Name is " . $regionName . "\n";
?>
--- End Message ---
--- Begin Message ---
Hi, hoping someone can point me to the
correct part of the FAQ or otherwise help me solve this.
Installed the PHP binaries as per the instructions, and configured the httpd.conf for
apache 1.3,
once i restarted apache, I tested with the standard hello.php page indicated on the
tutorial.
The browsers, both IE and mozilla do not recognise the .php mime type or file
extention and are attempting to download the file rather than render the page.
I'm pretty sure I followed the install instructions to the letter, but maybe i srewed
something up.
Thanks for any insight.
____________________________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10
--- End Message ---