[PHP] howto run sql script with php?

2010-06-13 Thread Stephan Ebelt
Hello, I am trying to run a .sql script produced with mysql-dump from a php script but failed to find a rudimentary robust solution yet. mysql_query() can only run one query at a time. Thus its necessary to somehow parse the input file and separate the queries... which is difficult since the synt

Re: [PHP] howto run sql script with php?

2010-06-13 Thread Peter Lind
On 13 June 2010 11:05, Stephan Ebelt wrote: > Hello, > > I am trying to run a .sql script produced with mysql-dump from a php script > but > failed to find a rudimentary robust solution yet. > > mysql_query() can only run one query at a time. Thus its necessary to somehow > parse the input file a

Re: [PHP] howto run sql script with php?

2010-06-13 Thread Stephan Ebelt
On Sun, Jun 13, 2010 at 11:29:14AM +0200, Peter Lind wrote: > On 13 June 2010 11:05, Stephan Ebelt wrote: > > Hello, > > > > I am trying to run a .sql script produced with mysql-dump from a php script > > but > > failed to find a rudimentary robust solution yet. > > > > mysql_query() can only run

Re: [PHP] howto run sql script with php?

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 12:52 +0200, Stephan Ebelt wrote: > On Sun, Jun 13, 2010 at 11:29:14AM +0200, Peter Lind wrote: > > On 13 June 2010 11:05, Stephan Ebelt wrote: > > > Hello, > > > > > > I am trying to run a .sql script produced with mysql-dump from a php > > > script but > > > failed to fin

[PHP] PHP - Header ERROR

2010-06-13 Thread Don Wieland
Hello, I have a contact form with three fields, name, email, and comment, and a CAPTCHA I am doing some basic validation for empty fields but am getting a PHP error when trying to redirect back to the original page with an ERROR, It seems when my COMMENT field contains s, it generates the

Re: [PHP] PHP - Header ERROR

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 06:43 -0700, Don Wieland wrote: > Hello, > > I have a contact form with three fields, name, email, and comment, and > a CAPTCHA > > I am doing some basic validation for empty fields but am getting a PHP > error when trying to redirect back to the original page with an E

Re: [PHP] PHP - Header ERROR

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 07:50 -0700, Don Wieland wrote: > Yeah - I thought about that, but I don't know how to do this. I have a > partner who admins my virtual private server. Oh well ;-) > > > > It is probably something I need to do to the header() string to > accommodate the s. I am redirectin

[PHP] Cookie access with CLI

2010-06-13 Thread David Česal
Hello, I'm trying to access (from CLI) some website, where login is required. Please, is it possible to set/save some cookies first (login session information) and then access the website as logged user? All through CLI. Thank you very much for any information. David Cesal

Re: [PHP] howto run sql script with php?

2010-06-13 Thread Stephan Ebelt
On Sun, Jun 13, 2010 at 12:14:53PM +0100, Ashley Sheridan wrote: >On Sun, 2010-06-13 at 12:52 +0200, Stephan Ebelt wrote: > > On Sun, Jun 13, 2010 at 11:29:14AM +0200, Peter Lind wrote: > > On 13 June 2010 11:05, Stephan Ebelt <[1]...@shared-files.de> wrote: > > > Hello, > > > > > > I am

Re: [PHP] Cookie access with CLI

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 16:58 +0200, David Česal wrote: > Hello, > > I'm trying to access (from CLI) some website, where login is required. > Please, is it possible to set/save some cookies first (login session > information) and then access the website as logged user? All through CLI. > > > >

Re: [PHP] PHP - Header ERROR

2010-06-13 Thread Don Wieland
On Jun 13, 2010, at 7:53 AM, Ashley Sheridan wrote: On Sun, 2010-06-13 at 07:50 -0700, Don Wieland wrote: Yeah - I thought about that, but I don't know how to do this. I have a partner who admins my virtual private server. Oh well ;-) It is probably something I need to do to the header()

Re: [PHP] howto run sql script with php?

2010-06-13 Thread Stephan Ebelt
On Sun, Jun 13, 2010 at 12:52:18PM +0200, Stephan Ebelt wrote: [...] > > Use mysqli - it supports running multiple queries at once. > > sometimes its as easy as that. I'll give it a try. not quite as easy: mysqli->multi_query() works nice with many queries in a string but that DELIMITER syntax s

Re: [PHP] PHP - Header ERROR

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 08:06 -0700, Don Wieland wrote: > On Jun 13, 2010, at 7:53 AM, Ashley Sheridan wrote: > > > On Sun, 2010-06-13 at 07:50 -0700, Don Wieland wrote: > > > >> Yeah - I thought about that, but I don't know how to do this. I > >> have a > >> partner who admins my virtual private

Re: [PHP] howto run sql script with php?

2010-06-13 Thread Brandon Rampersad
niggers On Sun, Jun 13, 2010 at 11:07 AM, Stephan Ebelt wrote: > On Sun, Jun 13, 2010 at 12:52:18PM +0200, Stephan Ebelt wrote: > [...] > > > Use mysqli - it supports running multiple queries at once. > > > > sometimes its as easy as that. I'll give it a try. > > not quite as easy: mysqli->mult

Re: [PHP] Cookie access with CLI

2010-06-13 Thread Shawn McKenzie
On 06/13/2010 09:58 AM, David Česal wrote: > Hello, > > I'm trying to access (from CLI) some website, where login is required. > Please, is it possible to set/save some cookies first (login session > information) and then access the website as logged user? All through CLI. > > > > Thank you ve

[PHP] Re: PHP - Header ERROR

2010-06-13 Thread Shawn McKenzie
On 06/13/2010 08:43 AM, Don Wieland wrote: > Hello, > > I have a contact form with three fields, name, email, and comment, and a > CAPTCHA > > I am doing some basic validation for empty fields but am getting a PHP > error when trying to redirect back to the original page with an ERROR, > > It se

Re: [PHP] Re: PHP - Header ERROR

2010-06-13 Thread Steve
On 6/13/2010 9:37 AM, Shawn McKenzie wrote: On 06/13/2010 08:43 AM, Don Wieland wrote: Hello, I have a contact form with three fields, name, email, and comment, and a CAPTCHA I am doing some basic validation for empty fields but am getting a PHP error when trying to redirect back to the or

[PHP] String Parse Help for novice

2010-06-13 Thread Rick Dwyer
Hello List. I need to parse the PATH portion of URL. I have assigned the path portion to a variable using the following: $thepath = parse_url($url); Now I need to break each portion of the path down into its own variable. The problem is, the path can vary considerably as follows: /myd

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 18:13 -0400, Rick Dwyer wrote: > Hello List. > > I need to parse the PATH portion of URL. I have assigned the path > portion to a variable using the following: > > $thepath = parse_url($url); > > > Now I need to break each portion of the path down into its own > vari

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Karl DeSaulniers
On Jun 13, 2010, at 5:13 PM, Rick Dwyer wrote: Hello List. I need to parse the PATH portion of URL. I have assigned the path portion to a variable using the following: $thepath = parse_url($url); Now I need to break each portion of the path down into its own variable. The problem is,

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Karl DeSaulniers
On Jun 13, 2010, at 5:23 PM, Ashley Sheridan wrote: On Sun, 2010-06-13 at 18:13 -0400, Rick Dwyer wrote: Hello List. I need to parse the PATH portion of URL. I have assigned the path portion to a variable using the following: $thepath = parse_url($url); Now I need to break each portion o

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 17:27 -0500, Karl DeSaulniers wrote: > On Jun 13, 2010, at 5:23 PM, Ashley Sheridan wrote: > > > On Sun, 2010-06-13 at 18:13 -0400, Rick Dwyer wrote: > > > >> Hello List. > >> > >> I need to parse the PATH portion of URL. I have assigned the path > >> portion to a variable

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Karl DeSaulniers
On Jun 13, 2010, at 5:31 PM, Ashley Sheridan wrote: On Sun, 2010-06-13 at 17:27 -0500, Karl DeSaulniers wrote: On Jun 13, 2010, at 5:23 PM, Ashley Sheridan wrote: On Sun, 2010-06-13 at 18:13 -0400, Rick Dwyer wrote: Hello List. I need to parse the PATH portion of URL. I have assigned th

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Rick Dwyer
OK, I get the following error: Warning: basename() expects parameter 1 to be string, array given in When I use the following: $thepath = parse_url($url); $filename = basename($thepath); Is my variable thepath not automatically string? --Rick On Jun 13, 2010, at 6:23 PM, Ashley Sheridan

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Karl DeSaulniers
On Jun 13, 2010, at 5:35 PM, Rick Dwyer wrote: OK, I get the following error: Warning: basename() expects parameter 1 to be string, array given in When I use the following: $thepath = parse_url($url); $filename = basename($thepath); Is my variable thepath not automatically string?

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 17:35 -0500, Karl DeSaulniers wrote: > On Jun 13, 2010, at 5:31 PM, Ashley Sheridan wrote: > > > On Sun, 2010-06-13 at 17:27 -0500, Karl DeSaulniers wrote: > > > >> On Jun 13, 2010, at 5:23 PM, Ashley Sheridan wrote: > >> > >>> On Sun, 2010-06-13 at 18:13 -0400, Rick Dwyer w

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Karl DeSaulniers
On Jun 13, 2010, at 5:35 PM, Rick Dwyer wrote: OK, I get the following error: Warning: basename() expects parameter 1 to be string, array given in When I use the following: $thepath = parse_url($url); $filename = basename($thepath); Is my variable thepath not automatically string?

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 18:35 -0400, Rick Dwyer wrote: > OK, I get the following error: > > Warning: basename() expects parameter 1 to be string, array given in > > When I use the following: > > $thepath = parse_url($url); > $filename = basename($thepath); > > Is my variable thepath not auto

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Karl DeSaulniers
On Jun 13, 2010, at 5:40 PM, Ashley Sheridan wrote: On Sun, 2010-06-13 at 17:35 -0500, Karl DeSaulniers wrote: On Jun 13, 2010, at 5:31 PM, Ashley Sheridan wrote: > On Sun, 2010-06-13 at 17:27 -0500, Karl DeSaulniers wrote: > >> On Jun 13, 2010, at 5:23 PM, Ashley Sheridan wrote: >> >>> On S

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Rick Dwyer
OK, sorry for any confusion. Here is all my code: $url = "http" . ((!empty($_SERVER['HTTPS'])) ? "s" : "") . "://". $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $thepath = parse_url($url); So, given that the URL can vary as follows: /mydirectory/mysubdirectory/anothersubdirectory/mypage.

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Ashley Sheridan
On Sun, 2010-06-13 at 18:52 -0400, Rick Dwyer wrote: > OK, sorry for any confusion. > > Here is all my code: > > $url = "http" . ((!empty($_SERVER['HTTPS'])) ? "s" : "") . "://". > $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; > $thepath = parse_url($url); > > So, given that the URL can var

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Robert Cummings
Rick Dwyer wrote: Hello List. I need to parse the PATH portion of URL. I have assigned the path portion to a variable using the following: $thepath = parse_url($url); Now I need to break each portion of the path down into its own variable. The problem is, the path can vary considerably

Re: [PHP] Quick Question

2010-06-13 Thread Nilesh Govindarajan
On Mon, Jun 14, 2010 at 4:36 AM, Karl DeSaulniers wrote: > Hello List, > I may have asked this before, but can not find any emails about it. > Does anyone know of a general-javascript email list like this php list? > Hoping someone here can point me in the right direction. > TIA > > Karl DeSaulnie

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Adam Richardson
On Sun, Jun 13, 2010 at 9:29 PM, Robert Cummings wrote: > Rick Dwyer wrote: > >> Hello List. >> >> I need to parse the PATH portion of URL. I have assigned the path >> portion to a variable using the following: >> >> $thepath = parse_url($url); >> >> >> Now I need to break each portion of the pa

[PHP] last modified on a page

2010-06-13 Thread David Mehler
Hello, I've got what is probably a simple question. I've got a site with a footer include file. I want to have a section that displays the last time the page was modified. So for example say the index.php was last modified today and another page was modified two days ago. When the include is run o

Re: [PHP] last modified on a page

2010-06-13 Thread Simon J Welsh
On 14/06/2010, at 4:11 PM, David Mehler wrote: > Hello, > I've got what is probably a simple question. I've got a site with a > footer include file. I want to have a section that displays the last > time the page was modified. So for example say the index.php was last > modified today and another