[PHP] Help - I'm New

2002-07-02 Thread admin

Hi,  first let me introduce myself...

My name is Kit, and I own the domain below
and host sites from off that domain.

I'm new to using PHP...and need some help.

1. I have apache for win32 1.3.26 setup
on my w2k pro at home, and need to know
how to enable PHP in the config.

2. I also have a PHP website, and need to know
how to include FORMS for subscribing to newletters
in a file called header.php

*** http://www.myispnet.net ***
   Administrator
   My ISP Network
   [EMAIL PROTECTED]
*** http://www.myispcentral.net ***


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




[PHP] help with PHPwebsite

2002-07-02 Thread admin


I get the following error when i try to install an app
called PHPwebsite ( http://phpwebsite.appstate.edu/ )

Warning: Cannot add header information - headers already sent by
 (output started at C:\apache\htdocs\php\setup\index.php:9) 
in C:\apache\htdocs\php\htmlheader.php on line 30


I also installed php,apache,perl,mysql etc using a program called:
PHPtriad ( an app that installs/configures everything at once)

Why am I getting that error, can anyone help?

*** http://www.myispnet.net ***
   Administrator
   My ISP Network
   [EMAIL PROTECTED]
*** http://www.myispcentral.net ***


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




[PHP] FW: help with PHPwebsite

2002-07-03 Thread admin


I get the following error when i try to install an app
called PHPwebsite ( http://phpwebsite.appstate.edu/ )

Warning: Cannot add header information - headers already sent by
 (output started at C:\apache\htdocs\php\setup\index.php:9)
in C:\apache\htdocs\php\htmlheader.php on line 30


I also installed php,apache,perl,mysql etc using a program called:
PHPtriad ( an app that installs/configures everything at once)

Why am I getting that error, can anyone help?

=
below is the header.php file I'm having trouble with:
=

?php

/**
 * This file contains the html-header core function definitions for
phpWebSite.
 *
 * The functions defined here are essential for the phpWebSite
 * system. This file gets included almost all the time, you should be
 * able to use the functions defined here everywhere in the code.
 *
 * @module mainfile
 * @modulegroup core
 * @package phpWebSite
 */

/**
 * Wrapper around header(Location: url) to deal also with IE
 *
 * @param URL
 * @author: Alessandro Pisani
 */
function html_header_location($url) {
 $agent = (phpversion()  4.1.0) ? $_SERVER[HTTP_USER_AGENT] :
$HTTP_SERVER_VARS[HTTP_USER_AGENT];

 // Both IE 5.x and Mozilla = 0.9.8 now require header() to be postfixed by
 // exit, otherwise they do not execute headers send

 if (stristr($agent, 'msie'))
  { Header(Refresh: 0;url=$url); exit; }
 else
  { Header(Location: $url); exit; }
 }

?

*** http://www.myispnet.net ***
   Administrator
   My ISP Network
   [EMAIL PROTECTED]
*** http://www.myispcentral.net ***


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




[PHP] T_string error

2002-07-09 Thread admin

Can someone tell me what the following error means,
and how to fix it...please?

Parse error:
parse error, unexpected T_STRING in
c:\program files\apache
group\apache\htdocs\phpbb\language\lang_english\lang_main.php
 on line 629

this is the code on that page:

$lang['Avatar_filesize'] = 'The avatar image file size must be less than %d
kB'; // The avatar image file size must be less than 6 kB

(than 6 kB  this part of that line is on the next line down)

*** http://www.myispnet.net ***
   Administrator
   My ISP Network
   [EMAIL PROTECTED]
*** http://www.myispcentral.net ***


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




[PHP] crontab programmed with mysql ??

2002-09-02 Thread admin

I'm looking for the approximate solution of mailing out (or doing anything
else )
timed by cron(tab) along with use of mysql as means of identification and
storing
of the dates in multiuser enviroment.
Initial date and interval of recurring event is to be set up by a user.
May you know some open source code as an example to do that or so?
Thank you,
Oleg


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




[PHP] PHP to embed font

2001-08-14 Thread admin

Is there anyway to use PHP to embed font types into web pages to the person 
visiting the page sees what you want them to even if they dont have the 
same fonts on their computer. 
Pat



-- 
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] Web page authentications

2001-08-14 Thread admin

I am new to PHP and am confused on HTTP authentications. I have read that 
section in the manual and still have questions. Where does PHP look to see 
if the user is valid or if the passward matches the user. How do you use 
PHP to set up user registration so users can input their information for 
authentication. Can anyone point me in the right direction to read more on 
this and help clear my confusion. 
Pat



-- 
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] EO - New FREE web development engine

2001-07-17 Thread admin

Hello,

I'm contacting you because we have recently released a new web development platform, 
EO, that I would like for you to try out for use in building dynamic sites.
 
EO is a portable, flexible yet robust system that you can use to quickly build 
interactive sites, plus it has features that protect you, the web developer.  The 
Engine behind EO has been in development since 1996 and has been used to build simple 
to complex systems in many industries including retail, automotive, financial, marine 
and more.

BEST OF ALL IT'S FREE!
 
Please visit http://www.eodeveloper.com/eo/eo.exe/eofree?01 to find out more and 
download your FREE copy.

Thank you!
 Team EO
 http://www.eodeveloper.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]




RE: [PHP] Re: How do I specify a local file for fopen()?

2007-11-05 Thread admin
I simply do this

$file=/home/images/index.html;
$output = fopen($file, w);



-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Colin Guthrie
Sent: Monday, November 05, 2007 4:06 AM
To: php-general@lists.php.net
Subject: [PHP] Re: How do I specify a local file for fopen()?

Jon Westcot wrote:
 Hi all:
 
 I've been beating my head against a brick wall trying to figure this
 out and I'm still no closer than I was two weeks ago.
 
 How do I specify a local file on my computer to use with fopen() on
 the server?

Keep on beating it until you get the concept of client-server computing :p

There is no standard way a webserver can access information on the
client's computer. Enabling this kind of interaction would be a complete
no-no from a security perspective and it would also require that a
channel be opened *from* the server *to* the client (which is the
opposite way round - e.g. the client becomes a server and the server
becomes a client!

 I've checked and the allow_url_fopen setting is set to On.  I use the
 html input type=file to let me browse to the file.  This,
 however, forces me to also POST the entire file to the server, which
 I DO NOT WANT it to do.  I just wanted to be able to use the Browse
 button to get to the file name.  But, even when I do this, the file
 name returned in the $_FILES array doesn't give me a file name that
 fopen() will actually open.

This is how you send files to the webserver. If you want the server to
access the files on the client then you have to either send them or
provide some way for the client to become a server in some capacity
through the running of a local application (or Java Applet), and then
you have to make sure you can negotiate any firewall and NAT'ed gateways
that may be inbetween!


 Do I somehow have to get the server to recognize my computer as an
 http-based address?  If so, how do I do this?  The computer that has
 the file to be opened is a Windows-based computer (running WinXP or
 Vista), and it obviously has an Internet connection.  Do I need to
 retrieve, from the server, my computer's IP address and use that, in
 whole or in part, to reference the file to be opened?  If so, how?

It's one of the ways, or you could just setup the client to do a samba
share and mount it on the server, or any number of other techniques.
Obviously this architecture only has legs in a very locked down and
standard environment - it's no good for the open internet.

 While I'm asking questions, does anyone know how to keep the file
 referenced in the input type=file setup from actually being sent?
 All I think I really need is the NAME of the file, not its actual
 contents, since I'm hoping to use fopen() to open the file and then
 to use fgetcsv() to retrieve the contents.

The name gives you nothing, as there is no way to hook back to the
client! You're approach is fundamentally wrong.


 ANY help you all can send my way will be greatly appreciated!

Depending what you want your app to do you need to look at running
something locally on the client. One method that spring to mind would be
a Java applet that can run load up the local files and then manipulate
them accordingly, potentially speaking to webservices provided by your
server in the process.


Col

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

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



RE: [PHP] Re: How do I specify a local file for fopen()?

2007-11-05 Thread admin
I would like to change my answer to that question. Due to my lack in desire, to 
read the entire email at first
I have made a bad judgment error in exactly what you was trying to do.

Yes trying to open a file on your local computer from the server is not a good 
idea. 
HOW EVER.
There are many options.
A FTP option
$handle = fopen(ftp://user:[EMAIL PROTECTED]/somefile.txt, w);
Providing you have the ftp port open into your network/computer for ftp access.

Personally I would never do that.


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Colin Guthrie
Sent: Monday, November 05, 2007 4:06 AM
To: php-general@lists.php.net
Subject: [PHP] Re: How do I specify a local file for fopen()?

Jon Westcot wrote:
 Hi all:
 
 I've been beating my head against a brick wall trying to figure this
 out and I'm still no closer than I was two weeks ago.
 
 How do I specify a local file on my computer to use with fopen() on
 the server?

Keep on beating it until you get the concept of client-server computing :p

There is no standard way a webserver can access information on the
client's computer. Enabling this kind of interaction would be a complete
no-no from a security perspective and it would also require that a
channel be opened *from* the server *to* the client (which is the
opposite way round - e.g. the client becomes a server and the server
becomes a client!

 I've checked and the allow_url_fopen setting is set to On.  I use the
 html input type=file to let me browse to the file.  This,
 however, forces me to also POST the entire file to the server, which
 I DO NOT WANT it to do.  I just wanted to be able to use the Browse
 button to get to the file name.  But, even when I do this, the file
 name returned in the $_FILES array doesn't give me a file name that
 fopen() will actually open.

This is how you send files to the webserver. If you want the server to
access the files on the client then you have to either send them or
provide some way for the client to become a server in some capacity
through the running of a local application (or Java Applet), and then
you have to make sure you can negotiate any firewall and NAT'ed gateways
that may be inbetween!


 Do I somehow have to get the server to recognize my computer as an
 http-based address?  If so, how do I do this?  The computer that has
 the file to be opened is a Windows-based computer (running WinXP or
 Vista), and it obviously has an Internet connection.  Do I need to
 retrieve, from the server, my computer's IP address and use that, in
 whole or in part, to reference the file to be opened?  If so, how?

It's one of the ways, or you could just setup the client to do a samba
share and mount it on the server, or any number of other techniques.
Obviously this architecture only has legs in a very locked down and
standard environment - it's no good for the open internet.

 While I'm asking questions, does anyone know how to keep the file
 referenced in the input type=file setup from actually being sent?
 All I think I really need is the NAME of the file, not its actual
 contents, since I'm hoping to use fopen() to open the file and then
 to use fgetcsv() to retrieve the contents.

The name gives you nothing, as there is no way to hook back to the
client! You're approach is fundamentally wrong.


 ANY help you all can send my way will be greatly appreciated!

Depending what you want your app to do you need to look at running
something locally on the client. One method that spring to mind would be
a Java applet that can run load up the local files and then manipulate
them accordingly, potentially speaking to webservices provided by your
server in the process.


Col

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

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



RE: [PHP] explorer

2007-11-10 Thread admin
You can't (SERVER vs Client) you cannot make Php open an program on the
client computer.
If you want to get a file from your computer that is a simple HTMLTag.
input type=file name=image tabindex=1 size=35 /

Please explain if that is not what you meant.



-Original Message-
From: kNish [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 10, 2007 6:41 AM
To: php-general@lists.php.net
Subject: [PHP] explorer

Hi,

   How if, it is possible to open a windows explorer with a
path specified in it, thru a php script.

 BRgds,

kNish

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

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



RE: [PHP] Cannot send a hyperlink

2007-11-11 Thread admin
The Answer is quiet simple.


$E_MAIL = [EMAIL PROTECTED];
$to  = [EMAIL PROTECTED];
$headers  = MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= To: Their Name[EMAIL PROTECTED] \r\n;
$headers .= From: your email [EMAIL PROTECTED]\r\n;
$link = http://www.zoneofsuccessclub.com;;
$mailmsg = BLAH BLAH BLAH link:a href=$linkzoneofsuccessclub/a;
$mailsubject = what ever you want to say;
mail($E_MAIL, $mailsubject, $mailmsg, $headers);



You can use the database to generate the $E_MAIL address and the $to
Never Ever had this to not work.
Your problem is the Headers are missing which allows the html content to
embed into the email.

Try that I think you will be happy.




-Original Message-
From: Brad [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 10, 2007 2:36 PM
To: php-general@lists.php.net
Subject: [PHP] Cannot send a hyperlink

I am having trouble send an email with a hyperlink

Php is parsing html as text

If I add the proper header information to ?make it work? The email no longer
goes through?

 

Here is the code

 

?

  $email = $_REQUEST['email'] ;

$body = 'a href='.www.zoneofsuccessclub.com.'link /a';

$headers  = 'MIME-Version: 1.0' . \r\n;

 $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n;

  mail( $email, Your FREE book from Zone of Success Club .com,

$headers, $message, From: $email );

?

 

Thanks

Brad


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007
10:41 AM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-11 Thread admin
Brad I'm sorry.

Instead of insulting you and telling you to go read a book I simply
explained an option. 

Yes you do not need quotes in the mail() function.

As for the declared variables I was trying to show you an example. 

You will find many explanations for how or what is best practice.
Remember that some people like to toot a horn that can be reputed in many
ways. These are the same people who again and again are not the ones who
answer the questions, yet try to take credit by belittling the answer with
gibberish. 
The answer was intended to take you in a better direction when constructing
a email application in php.
 
  $eol=\r\n;
  $headers .= From: .$fromname..$fromaddress..$eol;
  $headers .= Reply-To: .$fromname..$fromaddress..$eol;
  $headers .= Return-Path: .$fromname..$fromaddress..$eol;
  $headers .= Message-ID: .time().-.$fromaddress..$eol;
  $headers .= X-Mailer: PHP v.phpversion().$eol;
  $msg .= --.$htmlalt_mime_boundary.$eol;
  $msg .= Content-Type: text/html; charset=iso-8859-1.$eol;
  $msg .= Content-Transfer-Encoding: 8bit.$eol.$eol;
  $msg .= $body.$eol.$eol;
  mail($to, $subject, $msg, $headers);





-Original Message-
From: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 11, 2007 4:07 AM
To: [EMAIL PROTECTED]
Cc: 'Brad'; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

[EMAIL PROTECTED] wrote:
 The Answer is quiet simple.
 
 
 $E_MAIL = [EMAIL PROTECTED];
 $to  = [EMAIL PROTECTED];
 $headers  = MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= To: Their Name[EMAIL PROTECTED] \r\n;
 $headers .= From: your email [EMAIL PROTECTED]\r\n;
 $link = http://www.zoneofsuccessclub.com;;
 $mailmsg = BLAH BLAH BLAH link:a href=$linkzoneofsuccessclub/a;
 $mailsubject = what ever you want to say;

Well, anyone doing this:
 mail($E_MAIL, $mailsubject, $mailmsg, $headers);
makes ME very unhappy. I don't get it, what's so hard to understand 
about NOT HAVING TO USE ANY QUOTES HERE ? Are you defining any type of 
string-like values here? no. Then you don't need quotes, right? no, you 
don't. SO DON'T USE THEM HERE THEN.
You're defining a $to and an $E_MAIL, you're not using $to anywhere, and 
only using $E_MAIL in one place (out of two), thus creating a mismatch 
between your headers and the To parameter for mail (which is used in 
SMTP traffic). [iz bad (tm)]

- Tul

 
 
 
 You can use the database to generate the $E_MAIL address and the $to
 Never Ever had this to not work.
 Your problem is the Headers are missing which allows the html content to
 embed into the email.
 
 Try that I think you will be happy.
 
 
 
 
 -Original Message-
 From: Brad [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, November 10, 2007 2:36 PM
 To: php-general@lists.php.net
 Subject: [PHP] Cannot send a hyperlink
 
 I am having trouble send an email with a hyperlink
 
 Php is parsing html as text
 
 If I add the proper header information to ?make it work? The email no
longer
 goes through?
 
  
 
 Here is the code
 
  
 
 ?
 
   $email = $_REQUEST['email'] ;
 
 $body = 'a href='.www.zoneofsuccessclub.com.'link /a';
 
 $headers  = 'MIME-Version: 1.0' . \r\n;
 
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n;
 
   mail( $email, Your FREE book from Zone of Success Club .com,
 
 $headers, $message, From: $email );
 
 ?
 
  
 
 Thanks
 
 Brad
 
 
 No virus found in this outgoing message.
 Checked by AVG Free Edition. 
 Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date:
11/10/2007
 10:41 AM
  

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

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



RE: [PHP] What to do when flush() doesn't?

2007-11-11 Thread admin
ob_flush();Flush(); works for me.



-Original Message-
From: Jon Westcot [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 11, 2007 5:31 AM
To: PHP General
Subject: [PHP] What to do when flush() doesn't?

Hi all:

I am trying to get information from a rather long-running PHP script to
send out messages to the client as things are being processed.  In reading
the manual, it seemed that using flush() was the ideal command for this.
Well, it doesn't seem to be working for me.  I've even tried sending over a
large number of blanks (like 4096 of 'em) before doing anything, but still
no go.

The flush() activity is supposed to occur on a page that has POSTed back
to itself, so perhaps that's causing the heartburn?

Any suggestions on how I can accomplish this type of user mollification?

Thanks,

Jon

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



RE: [PHP] Trigger an action on session timeout - feature request?

2007-11-12 Thread admin
You could simply validate the user with 

session_start();
$tbaged = false;
if (isset($_SESSION['user_id'])) {
   $user = new User($_SESSION['user_id']);
   $tbaged = true;
else {
   $login = $_REQUEST['screename'];
   $password = $_REQUEST['pword'];
   $login = clean($login);
   $password = clean($pword);
   $user = checkLogin($login,$pword);
   if (!is_null($user)) {
$tbaged = true;
   }
}

if (!$tbaged) {
   session_destroy();
   die(You are not logged in.);
}




-Original Message-
From: Tomas Telensky [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 12, 2007 12:20 PM
To: php-general@lists.php.net
Subject: [PHP] Trigger an action on session timeout - feature request?


Hi,

Is there any possibility to trigger an action when the session is inactive
for some time? I need to log users' login and logout, and so I need to know
about logouts caused by timeout. Neither there seems to be a possibility 
of a workaround like walking through all my sessions for timeouted ones
and destroy them myself.

I have searched through the PHP doc and didn't found anything. So probably
this is a feature request. Where should I post it? PHP's bug reporting
system,
unlike many common bug reporting systems, doesn't seem to distinguish
between bugs and feature requests.

I think this concept of being possible to define something like 
custom session destructor is obvious and useful enough to be worth
implementing to PHP.

Thanks for help,

Tomas

-- 
 No Software Patents! -- Allowing patents over software ideas will
seriously affect the Creativity, Productivity and Freedom of all.
Link: http://www.nosoftwarepatents.com/
--
Defend your freedom by signing a petition.
Link: http://petition.eurolinux.org/index_html?LANG=en

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

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



RE: [PHP] Fwd: Returned mail: User unknown

2007-11-12 Thread admin
PLEASE I have like 50 from it so far.


-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 12, 2007 5:31 PM
To: php-general List
Subject: [PHP] Fwd: Returned mail: User unknown

Can an admin or mod please force an unsubscribe on
[EMAIL PROTECTED]?

I've been getting bounces all day, and I'm sure I'm not the only
one.  Every message I send to the list gives me one of these.

Either that or we can just make them exceed their ISP mail cap  :D

?
$to = [EMAIL PROTECTED];
$headers  = From: postoffice [EMAIL PROTECTED]\r\n;
$headers .= X-Mailer: postoffice.(null)\r\n;
while(1) {
mail($to,Stamp: .time(),Hello.  Goodbye!,$headers);
}
?

-- Forwarded message --
From:  postoffice
Date: 12 Nov 2007 15:25:01 -0800
Subject: Returned mail: User unknown
To: Daniel Brown [EMAIL PROTECTED]


The original message was received at 2007-11-12 15:21:41 -0800
from postoffice.(null) [10.0.0.1]

   - The following addresses had permanent fatal errors -
[EMAIL PROTECTED]

   -Transcript of session follows -
... while talking to postoffice.(null).:
 RCPT To:[EMAIL PROTECTED]
 550 5.1.1 unknown or illegal alias: [EMAIL PROTECTED]
550 [EMAIL PROTECTED]... User unknown

Final-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.1.1
Remote-MTA: DNS; postoffice.(null)
Diagnostic-Code: SMTP;550 5.1.1 unknown or illegal alias:
[EMAIL PROTECTED]
Last-Attempt-Date: 2007-11-12 15:21:41 -0800


-- Forwarded message --
From: Daniel Brown [EMAIL PROTECTED]
To: Paul Novitski [EMAIL PROTECTED]
Date: Mon, 12 Nov 2007 18:04:58 -0500
Subject: Re: [PHP] PHP access of FileMaker data
On Nov 12, 2007 5:58 PM, Paul Novitski [EMAIL PROTECTED] wrote:
 Can someone please point me to some PHP code or documentation for
 accessing FileMaker Pro tables with PHP?  So far googling Zend and
 world-wide hasn't found me what I'm seeking.

 Thanks,
 Paul

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



Back in 2004 I had a project that was to be a hybrid of PHP and
FileMaker data, and I came across the perfect fit: FX.php by Chris
Hansen.  You can download the full source here:

http://iviking.org/FX.php/

It had a mailing list of its own back then, too, which I was
active on, but I'm no longer subscribed, and not even sure if it's
still there.  Either way, you'll find people like my friend, Gjermund
Thorsen, still supporting the community on the script today, so you
won't have to go it alone.


--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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





-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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

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



RE: [PHP] web page download question

2007-11-12 Thread admin
http://www.catavitch.com

The Script I have written actually does that for predefined websites. 
The content is LIVE pull directly from the website listed.
MOST important thing to remember GET PERMISSION to scrape as you call it.

I can store the data if I want or dish it up in the example. I can even
display the entire website.

I do not use an fopen(); 
Some may suggest a wget(); 
I will disagree strongly.
Why waste the space with stored files.

Try curl.




-Original Message-
From: David Calkins [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 12, 2007 9:40 AM
To: php-general@lists.php.net
Subject: [PHP] web page download question

I'm attempting to scrape a web page to pull out some pertinent info.
 The URL looks similar to the below.

http://www.someserver.com/user-info.xml?user=myusername

If I paste the above into my web browser, the page comes up and
displays the information.  If I try view source, I get an XML
document.  Not an XHTML document, but a plain XML document with just
the data fields (no formatting info).

However, if I use PHP fopen() to read this same URL, I get the XHTML
file with all the formatting info, etc.

So, somehow the web browser (this happens in FireFox and IE7) is
showing something other than what I get with the plain fopen().

I'd like to get at the plain XML file with just the data fields as is
shown in the browser.

Any ideas how to do this?

Thanks!

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

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



RE: [PHP] Run process in background

2007-11-14 Thread admin
You need to run wget from a cron job.



-Original Message-
From: Viacheslav Chumushuk [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 9:10 AM
To: php-general@lists.php.net
Subject: [PHP] Run process in background

Hello.

I want to run process from my php script in background.
I try different functions from functions list but all of them whaiting for 
process ending.

How can I run `wget -b ...` and finish my script, but wget must still
working?

I use PHP5, Linux, Apache2.

Thank You.

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

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



RE: [PHP] I need help handling form posting

2007-11-15 Thread admin
I do this

Example:
?
switch($_REQUEST['req'])
{
default:
$click_stamp =date('is');
echo form action=? method=postinput type=hidden name=clicks
value=$click_stamp
input type=file name=upfile tabindex=1 size=35
input type=submit value=upload name=req/form;
break;

case upload:

//Upload function here

$dispay_time = date('is') - $_POST['$click_stamp'];
Echo CENTERFile took $dispay_time to upload;
//Time stamp it anyway you want EXAMPLE ONLY!!
break;
}
?

FOR GODS SAKE DON'T comment on syntax or design. I DO NOT CARE this is a
example ONLY!!!
OF COURSE I LEFT OUT CODE. OF COURSE THIS IS NOT A COPY PASTE AND IT WILL
RUN!!




-Original Message-
From: Jon Westcot [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 4:17 AM
To: PHP General
Subject: [PHP] I need help handling form posting

Hi all:

In my quest to make things seem easier for the user to understand, I'm
trying to retrieve the time that I start posting a very large file via a
form post.  The form action sends it back to itself, which is fine.  It took
me some time to figure out that NOTHING happens on the client until the form
has been completely transmitted to the server.  In my particular case, this
can be a long time, anywhere from 15 to 30 minutes.  I'd like to be able to
notify the user of when the file upload actually began.

Is there a way that I can intercept the click of the Upload button,
have it update a field (probably a hidden one) with a date/time stamp, and
then have that value included in the $_POSTed values?  I'm thinking
(fearing, rather) that this is probably all off-topic and probably is best
addressed with some type of JavaScript solution, but it's late, I'm not
thinking clearly, and I've been doing data conversions all day, which is a
sure-fire way to get me emulating some Romero zombies.

Any help you can spare will be greatly appreciated.

Jon

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread admin
Understand your syntax issue has nothing to do with the mail function its
self.
That was an Operator headspace Issue.
Including links in email is not hard your entire email structure was BLOWN
UP...

For you to even submit that to php.net is useless.
A. No one is going to post that. Because it has NOTHING to do with the
actual Mail();
B. Your using an existing mail() structure described.




Brad wrote:
 Thank you so much!
 
 It worked like a champ first try!
 I would have never seen that and have been looking everywhere on the net
for
 a working example!
 
 Funny thing is, right after is work perfectly twice, my database crashed!
 
 But, this is the technology we play with!
 
 Problem solved and I am going to post this code on the php website for
 others to reference!



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

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



RE: [PHP] bank query and curl

2007-11-17 Thread admin
WHY! Would you even want to pull that data first off? 
It would be out dated as of the next transaction anyway.
Secondly if you can curl the data from the server, and get your account
information! I suggest you change banks.

Bad decision I think to make this attempt. 

You can bet I will be watching your networks for an attempt on
authentication failures.
Because that request does not sound RIGHT to me.

inetnum: 59.124.0.0 - 59.127.255.255
netname: HINET-NET
country: TW
descr: CHTD, Chunghwa Telecom Co.,Ltd.
descr: Data-Bldg.6F, No.21, Sec.21, Hsin-Yi Rd.
descr: Taipei Taiwan 100


Interland, Inc. MAXIM-NETBLK-1 (NET-216-65-0-0-1) 
216.65.0.0 - 216.65.127.255
Poke Internet Services MAX-CUSTNET-348 (NET-216-65-86-0-1) 
216.65.86.0 - 216.65.86.255



-Original Message-
From: Ronald Wiplinger [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 16, 2007 11:38 PM
To: PHP General list
Subject: [PHP] bank query and curl

I have a bank account and would like to query the last transactions.

I can do that now via web and think that I can convert this procedure to
a list of curl requests and finally put the result into a database on my
server.
Fortunately this bank account does not allow transactions, just viewing
the account.

Is there a guide available how to start this project?

bye

Ronald

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

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



RE: [PHP] Another form handling posting question

2007-12-05 Thread admin
? 
if($_POST['process'] == Pass){$action = success.php;}ELSE{$action = 
recursive.php;} 
echo form method='POST' action='$action'; 
?



I am trying to recursively send data to the same form.  Based on the data, I 
want to determine which action is to be processed.  It appears that the 
$_POST is not being cleared out or cached once it is sent to the server. 
Here is my code that I'm trying to test with.  It doesn't seem to 
consistently send me to the correct page each time.

?php

 $process = $_POST['process'];

 if ($process == Pass)
  {
  echo form method='POST' action=success.php;
  }
 else
  {
  echo form method='POST' action=recursive.php;
  }
?

 table border=0 id=table1 width=58
  tr
   td align=center
   input type=radio checked name=process value=Pass 
tabindex=1/td
   td align=leftPass/td
  /tr
  tr
   td align=center width=20
   input type=radio name=process value=Fail tabindex=2/td
   td align=left width=28
   Fail/td
  /tr
 /table
 input type=submit value=Submit name=B1 input type=reset 
value=Reset name=B2
/form

I want to use a single submit button that will send the action to the 
right page.

What is the best practice for doing this? 

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


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



RE: [PHP] Another form handling posting question

2007-12-05 Thread admin
Or try

?
echo form action=;if(($_POST['process'] == Pass) || ($_POST['process'] == 
)){echo success.php;}ELSE{echo recursive.php;}echo  METHOD='post';
?

There are a 1000 and 1 ways to make the script smaller yet still produce the 
same effect. 
Remember there is no reason to declare the POST array for matching in this 
particular setup. Some may disagree

Notice I added a error checking if the array is blank.

I am going to stop at this because there are many reasons why the _POST array 
would or did not pass which may not be related to this script directly but 
cause the issue of less then 100% effective.






I am trying to recursively send data to the same form.  Based on the data, I 
want to determine which action is to be processed.  It appears that the 
$_POST is not being cleared out or cached once it is sent to the server. 
Here is my code that I'm trying to test with.  It doesn't seem to 
consistently send me to the correct page each time.

?php

 $process = $_POST['process'];

 if ($process == Pass)
  {
  echo form method='POST' action=success.php;
  }
 else
  {
  echo form method='POST' action=recursive.php;
  }
?

 table border=0 id=table1 width=58
  tr
   td align=center
   input type=radio checked name=process value=Pass 
tabindex=1/td
   td align=leftPass/td
  /tr
  tr
   td align=center width=20
   input type=radio name=process value=Fail tabindex=2/td
   td align=left width=28
   Fail/td
  /tr
 /table
 input type=submit value=Submit name=B1 input type=reset 
value=Reset name=B2
/form

I want to use a single submit button that will send the action to the 
right page.

What is the best practice for doing this? 

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


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



RE: [PHP] Securing your Sites

2007-12-17 Thread admin
I want to personally thank you for 6 hours of work to remove the 
PHP-Back-door Trojan, that download from your site to my PC while viewing that 
POS you call a help line.

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



RE: [PHP] Connecting to MySQL database

2007-12-26 Thread admin
First I suggest you see if MySQL is even running.
Terminal Window type the following
 service mysqld status

If it is running Great now you need to check your connection string for Errors.

 Not running do this *

Terminal Window
service mysqld start

If you have an error in the setup it will display it for future trouble 
shooting.

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



RE: [PHP] Security scanner

2008-02-11 Thread admin
Injections only work on sloppy code.

If you are using globals you are asking for injections. Turn your globals off, 
use $_POST[var_name] and filter all user input.

Just my opinion, I am sure some will disagree.

Richard L. Buskirk
## Show me a man with no fear, I will point out the date on his tomb stone. ##


Hi!

I've been trying Nessus to search for sql injections and other security 
issues. I'm quite sure Nessus is missing a lot of possible sql 
injections (and maybe other stuff too). Are there any other tools that I 
can install on my server that searches a bit more carefully? What do you 
use and why?

Any other good security tools for LAMP that one should know of?

Kind Regards Emil

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

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



[PHP] DBR.php ???

2008-02-11 Thread admin
As much as I admire Daniel, I think who ever sent me this question needs to 
rethink thier naming convention.


On Feb 9,2008 12:47 PM, WHOAMI [EMAIL PROTECTED] wrote:
 Would you use this to server auth?

 if($_REQUEST['from']!=1567d5af328786cdc81ed0f456bf)
 {
 $DanielBrown_rules = index.php;// Kick back to first page
 }elseif($_REQUEST['from'==1567d5af328786cdc81ed0f456bf)
 {
 $DanielBrown_rules = http://www.yourwebsite.com/main_content.php?
 auth=1567d5af328687cdc81ed0f456bfmsg=1; //Take to the right page
 }

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



Re: [PHP] DBR.php ???

2008-02-11 Thread admin
No clue Daniel, was sent to me directly using a non returnable email. I had to 
post it here because it had your name all over it.
I agree not your style at all.

Just beware another name for fan is (Stalker). lol

Rich.


On Feb 11, 2008 11:19 AM,  [EMAIL PROTECTED] wrote:
 As much as I admire Daniel, I think who ever sent me this question needs to 
rethink thier naming convention.


 On Feb 9,2008 12:47 PM, WHOAMI [EMAIL PROTECTED] wrote:
  Would you use this to server auth?
 
  if($_REQUEST['from']!=1567d5af328786cdc81ed0f456bf)
  {
  $DanielBrown_rules = index.php;// Kick back to first page
  }elseif($_REQUEST['from'==1567d5af328786cdc81ed0f456bf)
  {
  $DanielBrown_rules = http://www.yourwebsite.com/main_content.php?
  auth=1567d5af328687cdc81ed0f456bfmsg=1; //Take to the right page
  }

That's a little strange.  It's not me (not even my coding style),
and I'm certainly not the only Daniel Brown who uses PHP but if
it's about me, it's nice to know I have fans!  ;-P

Which thread was that on Rich?

-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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

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



[PHP] group by on mssql_query

2008-02-14 Thread admin
$ford = mssql_query(SELECT name FROM Table GROUP BY name);
while($mustang = mssql_fetch_array($ford))
{
echo $mustang['name'] . /n;
}

OS 2003 Server
PHP 5.2.5
Apache 2.2.8
SQL 2000


For some reason it is NOT clicking what I am missing here.
Second set of eyes please

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



Re: [PHP] group by on mssql_query

2008-02-14 Thread admin
Column 'location_city.dst' is invalid in the select list because it is not 
contained in either an aggregate function or the GROUP BY clause.

Not fimilar with MSSQL to be honest.




On Thu, Feb 14, 2008 at 4:00 PM,  [EMAIL PROTECTED] wrote:
 $ford = mssql_query(SELECT name FROM Table GROUP BY name);

What do you see when you replace the above line with this?
$ford = mssql_query(SELECT name FROM Table GROUP BY name) or
die(mssql_get_last_message());


-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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



Re: [PHP] group by on mssql_query

2008-02-14 Thread admin
Sweet Mother it just clicked.
I got it thank you dan.




On Thu, Feb 14, 2008 at 4:00 PM,  [EMAIL PROTECTED] wrote:
 $ford = mssql_query(SELECT name FROM Table GROUP BY name);

What do you see when you replace the above line with this?
$ford = mssql_query(SELECT name FROM Table GROUP BY name) or
die(mssql_get_last_message());


-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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



Re: [PHP] Re: mysql input

2008-02-19 Thread admin
Filter the data
 
$data = str_replace(', , $data);

I am sure there are many ways to filter the data before insert.




(If you are SURE you have A.D.D. then it wont matter what I say to you.)
Rick B.




On Feb 18, 2008 11:24 PM, Shawn McKenzie [EMAIL PROTECTED] wrote:
 nihilism machine wrote:
  I have a user saving a VARCHAR(255) field in a mysql db which has single
  quotes in the text, how can i replace them so that they dont fuck up my
  mysql command?
 
  -e


 Have you tried:  dont_fuck_up_my_mysql_command()

That has thrown E_DEPRECATED since PHP 4.1.  RTFM, n00b.  ;-D

-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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

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



[PHP] MySQL Stored Procedures

2008-02-19 Thread admin
I want to thank all who helped me on this issue.

My Problem was when I tried to return a parameter to the C++ script.

CREATE PROCEDURE `tracinsert`(CaldNumber varchar(12), CaldTime varchar(50), 
CallerID varchar(12))
BEGIN

INSERT INTO IncCalls (CaldNumber, CaldTime, CallerID)
VALUES
(CaldNumber, CaldTime, CallerID);

 SELECT Introp FROM CaNumbers WHERE PNumber = CaldNumber;
END


I just did not get the fact that the Select feature returned the parameter data 
automactically without being declared. The script above works, my only wish was 
that more people wrote more articles about the proper structure. 

Yes I understand this has NOTHING to do with php but it will one day.

Rick B.

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



[PHP] calling parent class method from the outside

2007-07-02 Thread admin

Inside the body of method foo() you can of course use syntax like
parent::foo(). But is there a way to call the parent version of
obj-foo() outside the class? That kind of syntax is allowed in C++, for
example: Aclass a; if (a.Aparent::foo()) ...;

Some contrived example to illustrate the point:

class AParent {
  public function foo() { .. }
}

class A extends AParent {
  public function foo() {
doit($this, __CLASS__, __FUNCTION__);
  }
}

function doit($obj, $classname, $funcname) {
  if (...)
//$obj-classname_parent::$funcname();
}


Thanks.

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



[PHP] Re: calling parent class method from the outside

2007-07-02 Thread admin

Colin Guthrie wrote:

admin wrote:

Inside the body of method foo() you can of course use syntax like
parent::foo(). But is there a way to call the parent version of
obj-foo() outside the class? That kind of syntax is allowed in C++, for
example: Aclass a; if (a.Aparent::foo()) ...;


[snipped]


I agree with Jochem that if you find you need to do this, then you're
probably not designing the code correctly.



OK, here we go: Propel in Symfony uses generated model classes
representing DB rows, stub classes inheriting from them ready to be used
(such as below), and accessors representing data columns:

class Foo extends BaseFoo
{
public function setBar($value)
{
$this-doSetColumn(FooPeer::BAR, $value, __FUNCTION__);
}

public function setBaz($value)
{
$this-doSetColumn(FooPeer::BAZ, $value, __FUNCTION__);
}

public function setXyzzy($value)
{
$this-doSetColumn(FooPeer::XYZZY, $value, __FUNCTION__);
}

// several more of these, and finally...

private function doSetColumn($colname, $value, $col_mutator)
{
/* setter does what it has to do and calls the parent
 * version of self to do the real work of modifying
 * state
 */
// ...
if ($something)
parent::$col_mutator($junk_to_trigger_modified);
// ...

parent::$col_mutator($value);
}
}

There are several models (tables) such as Foo, and they all have the
same body of doSetColumn(), so a logical next step was to factor that
method away _and_ leave most of the code intact, in which I've failed.

Once again, calling the parent version of a method externally is
allowed in C++ (and whoever said it was bad design should speak up to
Bjarne Stroustrup ;-)) Any such trick in PHP?

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



Re: [PHP] calling parent class method from the outside

2007-07-02 Thread admin

Jochem Maas wrote:

another solution for the OP might be (although I think it goes against all
design principles):

class A {
  function foo() {
echo achoo\n;
  }
}

class B extends A {
  function foo() {
echo cough\n;
  }
  function __call($meth, $args) {
$func = array(parent, strtolower(str_replace(parent,, $meth)));
if (is_callable($func))
  return call_user_func_array($func, $args);
  }
}

$b = new B;
$b-foo();
$b-parentFoo();



Barring the s/parent/get_parent_class/ the idea is really really cute, 
thanks. Beautiful. Heck, maybe I'll even hack the code to do it like 
that... after some grace period.


P.S.: I thought calling array('classname', 'method') only worked for 
static methods? It turns out there's an implied $this being passed around?


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



Re: [PHP] Re: calling parent class method from the outside

2007-07-02 Thread admin

Jim Lucas wrote:

Rihad wrote:


Now will you mentally copy and paste the above code several times, 
doing the necessary text substitutions, what will you get? Three 
identical copies of doSetColumn() in each class! And the real 
doSetColumn() is a bit heavier than a one-liner. We come full circle.




I don't understand, which part(s) are you copying multiple times?  Foo, 
FooBase, all the above...


if you are talking about having multiple Foo classes with one common 
FooBase class for each that they all inherit then it would be simple, 
move soSetColumn() to the FooBase class.



[snipped]

In short: there are several sets of Xxx, XxxPeer, BaseXxx, BaseXxxPeer.

The long and uncut story: please take a look at how Symfony and more 
specifically its ORM Propel does things to better understand the 
nightmare I'm talking about. Computers don't have a hard time with code 
duplication when generating source code: they can always scratch things 
and start anew in a second (or half a second on a dual-cpu box). Code 
generation is the latest hot topic that lays the Web 2.0 buzzword 
hands down. The funny part starts when humans, who are not really good 
at code duplication, try interfacing with the kilobytes of generated 
masses of source code at the API level. You find yourself repeating code 
everywhere, and it occurs so naturally that you begin to kind of like it 
that way. Just kidding.


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



Re: [PHP] calling parent class method from the outside

2007-07-02 Thread admin

Jochem Maas wrote:

admin wrote:

Jochem Maas wrote:

another solution for the OP might be (although I think it goes against
all
design principles):

class A {
  function foo() {
echo achoo\n;
  }
}

class B extends A {
  function foo() {
echo cough\n;
  }
  function __call($meth, $args) {
$func = array(parent, strtolower(str_replace(parent,, $meth)));
if (is_callable($func))
  return call_user_func_array($func, $args);
  }
}

$b = new B;
$b-foo();
$b-parentFoo();


Barring the s/parent/get_parent_class/ the idea is really really cute,
thanks. Beautiful. Heck, maybe I'll even hack the code to do it like
that... after some grace period.


sure it might be a neat little hack - __call() can be used for alsorts
of wonderful madness 


It was late in the night over where I live when I replied :-) But now I 
see that although your trick answers the subj perfectly, back then I 
didn't make it clear that the real intention was to get rid of code 
duplication in doSetColumn(). On closer inspection your trick would 
force me to scatter identical copies of __call() in every model class 
too, so I've gained nothing.


[snip]


and having read what you wrote about Propel/Symphony I still don't
get what the problem is that your trying to solve ... although I suspect


In Symfony/Propel you're on your own when things get to the point where 
you have to put the submitted data into DB. The main idea is that for 
columns that can be NULL the form submits empty values as empty string 
'', but I'd rather make that NULL. You would argue that simply leaving 
out the relevant update from the SQL clause would do the trick, but a 
second, more important issue prevents skipping NULL and is the basis for 
the former: for everything to work smoothly and transparently 
Symfony/Propel _insists_ on pre-hydrating the object right before the 
update, a requirement I cannot personally stand. So I've tried working 
around the requirement by populating the model myself with form data 
using setNew(false) and setXXX() calls. The real doSetColumn():


# these mutators help to skip pre-hydrating the object just to do an update
# treats NULL and empty string the same
# this also means empty input string will be converted to SQL NULL

private function doSetColumn($colname, $value, $col_mutator, 
$mod_trigger_value = '')

{
if ($value == '')
$value = null;
if (call_user_func(array(__CLASS__ . 'Peer', 
'getTableMap'))-getColumn($colname)-isNotNull()) {

if (is_null($value))
throw new Exception($col_mutator: $colname may 
not be NULL);

} else {
if (is_null($value)  !$this-isColumnModified($colname))
# XXX: as we don't know the current value in DB
# we need to force it to be set to NULL
parent::$col_mutator($mod_trigger_value);
}
parent::$col_mutator($value);
}

Hope you get the idea.



P.S.: I thought calling array('classname', 'method') only worked for
static methods? It turns out there's an implied $this being passed around?


the 'callback' type has a number of forms:

'myFunc'
array('className', 'myMeth')
array(self, 'myMeth')
array(parent, 'myMeth')
array($object, 'myMeth')

self and parent adhere to the same 'context' rules when used in 
call_user_func*()
as when you use them directly - whether $this is present within the scope of the
called method is essentially down to whether the method being called is defined 
as
static or not. AFAIK call_user_func*() respects PPP modifiers and works 
transparently
with regard to access to the relevant object variable ($this)



This undocumented (?) feature is fairly nice. Unfortunately there's no 
$this outside the class.


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



Re: [PHP] calling parent class method from the outside

2007-07-03 Thread admin

Jochem Maas wrote:

admin wrote:

Jochem Maas wrote:


...


the 'callback' type has a number of forms:

'myFunc'
array('className', 'myMeth')
array(self, 'myMeth')
array(parent, 'myMeth')
array($object, 'myMeth')

self and parent adhere to the same 'context' rules when used in
call_user_func*()
as when you use them directly - whether $this is present within the
scope of the
called method is essentially down to whether the method being called
is defined as
static or not. AFAIK call_user_func*() respects PPP modifiers and
works transparently
with regard to access to the relevant object variable ($this)


This undocumented (?) feature is fairly nice.


it is documented - where do you think I find out about it?



I knew it could be, and it is described at the top: 
http://www.php.net/manual/en/language.oop5.basic.php

Thanks.

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



[PHP] temp files

2007-07-25 Thread admin

Hi! I have this code:

$lines = gzfile(http://www.example.com/some/resource;);

for its internal needs gzfile() creates a temp file such as 
/var/tmp/phpFjJxNX where the gzipped resource is kept. The file stays 
there forever and eventually the fs runs out of inodes. Any way to 
unlink the temp file from the script? I've found no api for that. 
Alternative code:


$lines = file(compress.zlib://http://www.example.com/some/resource;);

does the same thing still leaving the file around.

Using PHP 4.3.3RC4 (built: Aug 24 2003 14:59:14)
This could be a bug, but upgrading is not an option.


Any help appreciated.

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



[PHP] temp files

2007-07-25 Thread admin

Hi! I have this code:

$lines = gzfile(http://www.example.com/some/resource;);

for its internal needs gzfile() creates a temp file such as
/var/tmp/phpFjJxNX where the gzipped resource is kept. The file stays
there forever and eventually the fs runs out of inodes. Any way to
unlink the temp file from the script? I've found no api for that.
Alternative code:

$lines = file(compress.zlib://http://www.example.com/some/resource;);

does the same thing still leaving the file around.

Using PHP 4.3.3RC4 (built: Aug 24 2003 14:59:14)
This could be a bug, but upgrading is not an option.


Any help appreciated.

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



RE: [PHP] round()

2007-10-10 Thread admin
 While we're entertaining algorithms, has anyone else noticed that 

 php's round() isn't the most accurate algorithm to round?

 

If you will refer to chafy's reply  on 28-Feb-2007 06:13
http://us2.php.net/manual/en/function.round.php#73537 

The function round numbers to a given precision.

function toFixed($number, $round=2)
{ 

$tempd = $number*pow(10,$round);
$tempd1 = round($tempd);
$number = $tempd1/pow(10,$round);
return $number;
 
}
echo toFixed(5.555,2);  //return 5.56 

 

If your rounding issue is passed 2 decimal places. I found this function
covenant and problem solving. As for the accuracy  of the algorithm 

I disagree. I will need to see an example where the round() is inaccurate.

 



[PHP] preg_match_all Help

2007-10-11 Thread admin
I have tried this many way  and for some reason

I cannot pull content between the 2 pattern options.

 

 

function pullchannel($document)

{

preg_match_all('/div class=channel [^]*(.*)div
class=channel [^]*/i',$document,$elements);

$match = implode(\r\n,$elements[0]);

$match = str_replace('',,$match);

return $match;

}

 

 



RE: [PHP] preg_match_all Help

2007-10-12 Thread admin
Okay use this as an example I want put parse the html document and toss
everything between the two
Div class channels into an array. The problem I am having is that I cannot
grab everything in between the 
Pattern of the preg_match_all.
If I preg_match_all('/div class=channel [^]*/i',$document,$elements);
it works perfection
But only arrays the single div statement not everything from div to div. I
think somewhere the syntax of the preg_match_all or the implode that is not
allow this function to work.


Html document
div class=channel id=one
div class=title
bStation Manager/b
div class=topicBecause you Can!
/div
/div
/div
div class=channel id=two

Php script
function pullchannel($document)
{
 preg_match_all('/div class=channel [^]*(.*)div class=channel
[^]*/i',$document,$elements);
$match = implode(\r\n,$elements[0]); 
$match = str_replace('',,$match);  
return $match; 
}






-Original Message-
From: Jim Lucas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 11, 2007 9:41 PM
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] preg_match_all Help

[EMAIL PROTECTED] wrote:
 I have tried this many way  and for some reason
 
 I cannot pull content between the 2 pattern options.
 
  
 
  
 
 function pullchannel($document)
 
 {
 
 preg_match_all('/div class=channel [^]*(.*)div
 class=channel [^]*/i',$document,$elements);
 
 $match = implode(\r\n,$elements[0]);
 
 $match = str_replace('',,$match);
 
 return $match;
 
 }
 
  
 
  
 
 
Give us and example of the input data.  And tell us from that example, 
what it is you are expecting to extract from it.

Jim

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

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



[PHP] HTML Parse Issue

2007-10-14 Thread admin
I am having a issue parsing an html file. 

I want to pull all the data between two html tags.

 

Problem I am having is that no matter what I try  I can pull either tag or
both but not the data in between.

div class=record id=one

div class=rideon

h2

spanWelcome to
Rideon/span

/h2

/div

/div

/div class=record id=one

 

function datamatch($document)

{

preg_match_all('/div class=record [^]*(.*)/\/div
class=record [^]*/i',$document,$elements);

$match = implode(\r\n,$elements[0]);

return $match;

}

 

This should return the following

div class=record id=one

div class=rideon

h2

spanWelcome to
Rideon/span

/h2

/div

/div

/div class=record id=one

 

 



RE: [PHP] Unsetting a header

2007-10-21 Thread admin
Try this never gives me a problem. I use it to keep proxy servers from
caching.

?
header(HTTP/1.1 200 OK);
header(Status: 200 OK);
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
?


Richard L. Buskirk


-Original Message-
From: Richard Heyes [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 21, 2007 7:55 AM
To: PHP General List
Subject: [PHP] Unsetting a header

Does anyone know of a way to unset a header? I have an Expires: header 
that I believe Apache is setting, and I don't want it. Thanks.

-- 
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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

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



Re: [PHP] problems with exec()

2006-11-29 Thread admin
Try

exec('/path/to/copy', $return);
print_r($return);

read the manual : http://nl3.php.net/manual/en/function.exec.php

Description
string exec ( string command [, array output [, int return_var]] )

gr,
Thijs

On Wed, 29 Nov 2006 23:22:13 -0700, Ray [EMAIL PROTECTED] wrote:
 hello;
 I am trying to write a script to do some auto configuration of my
 webserver. Part of the process involves copying some configuration files
 from other places on the server to a working directory where they can be
 modified.
 I am running freeBSD 6.0, Apache 2.2.3, php 5.1.5
 I can't seem to get the exec() command to work.
 I have an external shell script called 'copy' that takes care of getting
 files. script is currently set to mode 777 when run from the shell it
 works perfectly.
 
 however, in the php script
 
 echo exec('whoami');
 exec('/path/to/copy');
 the only return is
 'www' (the username correctly returned from whoami) also files aren't
 changed.
 any suggestions, pointers, log files to check would be appreciated as I
 have spent several hours on google, in manuals, etc. haven't tried the
 ougi board, but that's about it  ;-)
 tia
 Ray
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] problems with exec()

2006-11-30 Thread admin
Output you will only get if something goes wrong with the copy process.

But then again you say the 'whoami' command runs perfect. So the only things 
that
comes to my sleepy brain is incorrect paths or permissions.

Tried it here with 5.2 and 4.4.4 and seems to work. Maybe somebody else has
a clue what's going on.


On Thu, 30 Nov 2006 07:40:45 -0700, Ray [EMAIL PROTECTED] wrote:
 Hi, thanks for your help.
 I was using
 
 exec('/path/to/copy', $return);
 var_dump($return);
 (but I simplified it for posting)
 
 and I was still getting no output.
 actually, the return value is the least of my concerns, I just want this
 script to move some files around and the script works from the command
 line.
 as for safe_mode, it's off. Also the whoami in the previous line works as
 expected.
 Any pointers would be appreciared.
 Tia
 Ray
 
 -Original Message-
 From: Jan Schröter [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Date: Thu, 30 Nov 2006 09:09:49 +0100
 Subject: Re: [PHP] problems with exec()
 
 Think he's not getting an general error - just didn't read the manual
 concerning
 the return value of exec.

 kind regards
 jan

 Juanjo Pascual wrote:
  What is the safe_mode value in your php.ini?
 
  To run exec the value of your safe_mode has to be OFF.
 
 
  [EMAIL PROTECTED] escribió:
  Try
 
  exec('/path/to/copy', $return);
  print_r($return);
 
  read the manual : http://nl3.php.net/manual/en/function.exec.php
 
  Description
  string exec ( string command [, array output [, int return_var]] )
 
  gr,
  Thijs
 
  On Wed, 29 Nov 2006 23:22:13 -0700, Ray [EMAIL PROTECTED] wrote:
 
  hello;
  I am trying to write a script to do some auto configuration of my
  webserver. Part of the process involves copying some configuration
 files
  from other places on the server to a working directory where they
 can be
  modified.
  I am running freeBSD 6.0, Apache 2.2.3, php 5.1.5
  I can't seem to get the exec() command to work.
  I have an external shell script called 'copy' that takes care of
 getting
  files. script is currently set to mode 777 when run from the shell
 it
  works perfectly.
 
  however, in the php script
 
  echo exec('whoami');
  exec('/path/to/copy');
  the only return is
  'www' (the username correctly returned from whoami) also files
 aren't
  changed.
  any suggestions, pointers, log files to check would be appreciated
 as I
  have spent several hours on google, in manuals, etc. haven't tried
 the
  ougi board, but that's about it  ;-)
  tia
  Ray
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

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

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

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



RE: [PHP] newbie question about one php script passing control to another

2008-03-20 Thread admin
Im not sure I understand the question.

Pass control from index.php to welcome.php ???


index.php : ? echo form action=welcome.php method=postinput type=hidden 
name=tagme value=yesinput type=submit value='Continue'/form; ?

welcome.php ? if($_POST['tagme'] == yes){
echo Congrats you are there;}ELSE{echo You failed;}
?

That kind of pass control?



Hello.  I am new to php programming, but have spent many years 
programming in many other languages, most recently perl (with which php 
seems to have much in common!).  In every other language I've worked 
with there is a way for one program to pass control to another.  
However, so far in all of the books and other documentation I've looked 
at for php, I cannot find a way for one php program to pass control to 
another.  Is this possible in php, and, if so, please let me know how.  
Thank you.

Rod Clay
[EMAIL PROTECTED]

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

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



[PHP] Stored Procedure Question

2008-03-24 Thread admin
I am very aware most of you do not use a stored procedure in mysql. 

However with my latest C++ programming I have created a few that make life a 
dream. 

The issue I am having. When I call the stored procedure I would like the end of 
the procedure to call or invoke a php script.

I have read many MySQL Stored Procedure documents, nothing as of yet that 
describes what the best practic syntax or structure of a php script call.




Reality is a delusion brought on by alcohol deficiency $1000
Fixing the GUI between the chair and the keyboard Priceless

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



RE: [PHP] question about select tag in php

2008-03-31 Thread admin
Code wise your form options are too bulky and you need to look at slimming that 
down like below. Not that my example is prefect but easier to control the 
option enviroment.


echo select name='city1';
for($d=1; $d=2; $d++)
{
 if($city1 == region$d){
  echo option selected value='region$d'region$d;
 }ELSE{echo option value='region$d'region$d;}
}
echo /selectBRselect name='city2';
for($d=1; $d=3; $d++)
{
 if($city1 == region$d){
  echo option selected value='region$d'region$d;
 }ELSE{echo option value='region$d'region$d;}
}
echo /select;



Also I would use some onblur or onsubmit javascript for form validation 
submitting and then showing the error is NOT a good way to validate a form. 


Richard L. Buskirk

Blame the GUI between your chair and keyboard.





















i have two select tags as part of a registration form, city1 city2 where
city1 has a list of regions and similar for city2

there are different regions for city1 and city2 so instead of all the
regions appearing one after the other i would like to create a blank option
followed by the next set of regions for formatting purpose only.

ex=
select name=city1
option ?php if ($city1==region1){echo SELECTED;}?
value=region1Select region1/option
option ?php if ($city1==nameofregion1){echo SELECTED;}?
value=nameofregion1nameofregion1/option
option ?php if ($northisland==0){echo SELECTED;}? value=0/option
option ?php if ($city1==nameofregion2){echo SELECTED;}?
value=nameofregion2nameofregion2/option
option ?php if ($northisland==1){echo SELECTED;}? value=1/option
/select


select name=city2
option ?php if ($city2==region2){echo SELECTED;}?
value=region2Select region2/option
option ?php if ($city2==nameofregion1){echo SELECTED;}?
value=nameofregion1nameofregion1/option
option ?php if ($northisland==2){echo SELECTED;}? value=2/option
option ?php if ($city2==nameofregion2){echo SELECTED;}?
value=nameofregion2nameofregion2/option
option ?php if ($northisland==3){echo SELECTED;}? value=3/option
/select


from a php validation perspective if a user does not select any of the
regions or both the regions i am displaying an error message asking them to
either select 1 region from either city1 or city2

as of now there is a blank option being displayed which is working fine, i
am having an issue with the php validation.

until i introduced value=0 my rules for validating the select tag were:

1. user cannot leave both the select tags with the default option which is
Select region1  Select region2
2. user cannot select both the regions from city1  city2 select tags

the code of 2. is
if(!($city1 == region1)  !($city2 == region2))
{
$error.=Please select only 1 Regionbr /;
}


now by introducing option ?php if ($northisland==0){echo SELECTED;}?
value=0/option there is a conflict with the above php validation code
used in point 2.

1.
is it correct to use 1,2,3 as part of the following option tag or should i
only use 0 everywhere
option ?php if ($northisland==0){echo SELECTED;}? value=0/option
option ?php if ($northisland==1){echo SELECTED;}? value=1/option

2.
how can i get around the conflict that is being created by introducing this
value=0 with
if(!($city1 == region1)  !($city2 == region2))
{
$error.=Please select only 1 Regionbr /;
}
as i need the above php code and i also need the blank space for formatting
purpose

please advice.

thanks.

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



Re: [PHP] Google Pagerank script

2008-03-31 Thread admin
If you do have a index.php file in that directory and you are sure the path is 
correct check the chmod and chown of the index.php file.


Richard L. Buskirk

Dont be so -1 cubed.

+++



On Sun, Mar 30, 2008 at 12:25 PM, tedd [EMAIL PROTECTED] wrote:

  Sure, a few years ago I spent a considerable amount of time finding
  the code and here it is:

  http://www.webbytedd.com/a/page-rank/index.php

  It used to work, but now it doesn't.

  Anyone care to tell me why it doesn't work anymore and how to fix it?

Because it's not there.  A lot of times, when you don't have a
script installed and you try to access it, it won't work, it'll just
lead to a 404, like in your case.  ;-P

-- 
/Daniel P. Brown
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283

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

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



[PHP] Date Issue

2008-03-31 Thread admin
Not understanding why this is happening.

$month = date(F, mktime(0,0,0, date(m), date(d), date(Y)));
$zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y)));

echoing out the exact same month
March 
March

Checked server timezone/date/time all is good. Am I half asleep at the wheel on 
this one and just not seeing my mistake here?


Richard L. Buskirk

Hardware Failure: $4,000.
Network Outage: $15,000.
Always blaming the programmers for everything: Priceless.

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



Re: [PHP] Date Issue

2008-03-31 Thread admin
I tried that a big no go.
Seems if I do a +1 i get 2 months from now and a -1 gives me the current month.


$month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y')));
$zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y)));
$nmonth = date(F, mktime(0,0,0, date(m)+1, date(d), date(Y)));


$month echo's MARCH should be Feb
$zomonth echo's MARCH should be March
$nmonth echo's MAY this should be April

You will notice i used all options apostrophes double quotes and no quotes 
exactly the same output.







You need apostrophes (or quotes) around your args to date() in the
parameters...

date('m')

As it stands now, PHP assumes you mean the constant m
(http://php.net/define) and that's not defined, so they are all 0.

So you are passing in 0 to ALL the args.

You also should use E_ALL for your error_reporting so you would SEE
the error messages telling you about this.

On Mon, March 31, 2008 2:07 pm, [EMAIL PROTECTED] wrote:
 Not understanding why this is happening.

 $month = date(F, mktime(0,0,0, date(m), date(d), date(Y)));
 $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y)));

 echoing out the exact same month
 March
 March

 Checked server timezone/date/time all is good. Am I half asleep at the
 wheel on this one and just not seeing my mistake here?


 Richard L. Buskirk

 Hardware Failure: $4,000.
 Network Outage: $15,000.
 Always blaming the programmers for everything: Priceless.

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




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Date Issue

2008-03-31 Thread admin
Thank you again Dan. Thought never crossed my mind the day being the 31st. That 
fixed it. 

Richard L. Buskirk














On Mon, Mar 31, 2008 at 4:15 PM,  [EMAIL PROTECTED] wrote:
 I tried that a big no go.
  Seems if I do a +1 i get 2 months from now and a -1 gives me the current 
month.



  $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y')));
  $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y)));
  $nmonth = date(F, mktime(0,0,0, date(m)+1, date(d), date(Y)));


  $month echo's MARCH should be Feb
  $zomonth echo's MARCH should be March
  $nmonth echo's MAY this should be April

That's because you're using today's date('d');, which is 31.

February doesn't have 31 days, nor does April, so mktime() forces
them to the following month to correct the error.

-- 
/Daniel P. Brown
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283

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



Re: [PHP] Date Issue

2008-04-01 Thread admin
Your doing the same thing i did look at date(d)

When its the 31 like yesteday of course it can not find the 31 of months that 
do not have them. 
Thats why it errored. 


String worked up till monday which explained alot. I just did not look at what 
i was doing. changed the code to 


$zomonth = date(F, mktime(0,0,0, date(m)-1, 1, date('Y')));
works perfect 
thanks to dan who pointed out the lack of sleep in me :)














I generally use 1 hour after midnight with mktime() to avoid the edge
cases of daylight savings etc...

mktime(1, 0, 0, date('m') - 1, date('d'), date('Y'));

You also have to consider that you *COULD* call this right on the cusp
of midnight, and the call to date('d') could happen one day, and the
call to mktime( ) the next day as the clock ticked over...

At 1 am, the day doesn't change over...

Larry's probably right that you should use DateTime, but it's too
new-fangled for an old fart like me to have got around to messing with
it yet...

On Mon, March 31, 2008 3:15 pm, [EMAIL PROTECTED] wrote:
 I tried that a big no go.
 Seems if I do a +1 i get 2 months from now and a -1 gives me the
 current month.


 $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y')));
 $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d),
 date(Y)));
 $nmonth = date(F, mktime(0,0,0, date(m)+1, date(d), date(Y)));


 $month echo's MARCH should be Feb
 $zomonth echo's MARCH should be March
 $nmonth echo's MAY this should be April

 You will notice i used all options apostrophes double quotes and no
 quotes exactly the same output.







 You need apostrophes (or quotes) around your args to date() in the
 parameters...

 date('m')

 As it stands now, PHP assumes you mean the constant m
 (http://php.net/define) and that's not defined, so they are all 0.

 So you are passing in 0 to ALL the args.

 You also should use E_ALL for your error_reporting so you would SEE
 the error messages telling you about this.

 On Mon, March 31, 2008 2:07 pm, [EMAIL PROTECTED] wrote:
 Not understanding why this is happening.

 $month = date(F, mktime(0,0,0, date(m), date(d), date(Y)));
 $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y)));

 echoing out the exact same month
 March
 March

 Checked server timezone/date/time all is good. Am I half asleep at
 the
 wheel on this one and just not seeing my mistake here?


 Richard L. Buskirk

 Hardware Failure: $4,000.
 Network Outage: $15,000.
 Always blaming the programmers for everything: Priceless.

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




 --
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some indie artist.
 http://cdbaby.com/from/lynch
 Yeah, I get a buck. So?



-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] phone number allocation manager

2008-04-01 Thread admin
I work with and design VIOP IVR Applications, and have probably found or made 
everything you’re looking for. I can tell who provides database's for free or 
at a cost the cheapest and if you’re doing ANI cross population I have that as 
well.

WARNING some of the database are around 250 million records and if you are not 
database savvy id rethink importing 250 million records into your database. 

Also beware of No call List phone information, if you publish a Do not call 
phone number your asking for a serious backlash. 

I say this from experience.


Richard L. Buskirk






At 5:21 PM -0700 3/31/08, Jim Lucas wrote:
I work for a telephone  internet company.  Currently we have a tool 
that allows us to track the allocation of IP's to customers.  What I 
am looking for is a tool that will allow me to track the allocation 
of phone numbers to our customers.

Building the tool for IP allocation management was pretty easy since 
the IP world works off a set of rules that govern the allocation of 
IP's. Unfortunately the phone number world does not have the same 
rule set.  Actually, it has no rules.

Has anybody built, heard of, or used a tool like this?

Any suggestions would be great.

Thanks much!

--
Jim Lucas

Jim:

I've never found a phone number dB, but unfortunately, I know they exist.

I came across a zip code database that was very cool in that the 
center of each zip code's geographic area was given in lat/longs. 
 From there, it could provide all the zip codes within a certain 
distance of any entered zip code.

I also came across a IP database that was tied to a general 
geographic region and that tested very well, but did have an 
occasional error (per user replies).

Phone numbers WERE tied to a geographical area because of hard-wire 
(per my olden days with GTE). But today's cell phones break that 
boundary. Furthermore, because of the land-rush to sell cell phones 
as quickly as possible, cell phone developers don't stick to any 
standards with regard to the Internet, thereby causing all sorts of 
problems with Internet communications.

Your job is going to be difficult, I think.

Cheers,

tedd


-- 
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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

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



RE: [PHP] April Fools Easter Egg

2008-04-01 Thread admin
Studied that thing for last 15 minutes before realizing you got me.


Richard L. Buskirk









Don't forget to check your phpinfo() page for the annual easter egg.

-- 
Ray Hauge
www.primateapplications.com

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

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



RE: [PHP] PHP MySQL Insert Syntax

2008-04-01 Thread admin
Insert is for a new row

Alter or Update is for an exsisting row





/*I'm trying to insert values from an array into MySQL DB but the insert
begins at the last record in the table and not at first record in the table.
I have added the cellSuffixes column after I already populated 30 records in
other columns*/

Code:

foreach($list as $key=$value)
{
   $query = INSERT INTO carriers (cellSuffixes) VALUES('$value');
   mysql_query($query,$connex) or die(Query failed: .
mysql_error($connex));
}
echo done;
mysql_close($connex);

//I don't know what the sytax s/b to get the data to be inserted in the
first row of the column.




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

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



RE: [PHP] Get Free Information for Top twenty (20) online colleges and universities

2008-04-02 Thread admin
I ask you remove this spammer from our LIST

Richard L. Buskirk
Senior Software Engineer


-Original Message-
From: steve_carpenter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 02, 2008 5:14 PM
To: php-general@lists.php.net
Subject: [PHP] Get Free Information for Top twenty (20) online colleges and
universities


Site which provide free information about Top twenty online colleges.

http://www.online-colleges-and-degrees.com/
-- 
View this message in context:
http://www.nabble.com/Get-Free-Information-for-Top-twenty-%2820%29-online-co
lleges-and-universities-tp16453305p16453305.html
Sent from the PHP - General mailing list archive at Nabble.com.


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


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



RE: [PHP] How to get a code review?

2008-04-03 Thread admin
You can simply check the session or cookie


if(!session_is_registered(user))
{
 echo I cant see the session_register user;
}else{
echo I see the session $user;
}
User is an example of a session_register(user);
the user variable has been set in the session;




   if (isset($_COOKIE['user']))
{
 echo I cant see the COOKIE[user];
}else{
echo I see the cookie . $_COOKIE['user'];
}

User is an example of setcookie(user, $value);
the user value has been set in the cookie.


Please make sure if you use sessions to start the session in the php script by 
session_start(); on the first line of the php script.



I will look over your code if you want. You came to the right spot for php 
review. You can simply post your code here for a review by many experts. 





Hi,

I'm a perl programmer and I've written a registration/login program in Perl.

I've just finished writing a small program in php to check the login 
cookie created by my perl program
 for any php html page.

Can anyone direct me to a list or forum where one can get a code review 
of the php by other experienced
php programmers.

Thanks
David J.

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

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



RE: [PHP] string

2008-04-07 Thread admin
Do a preg match to find one or preg_match_all to find all the john in the 
string. 

?php
$name = John Taylor;
$pattern = '/^John/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
? 





$name = John Taylor;
I want to verify if $name contains john, if yes echo found;
Cannot remember which to use:
http://ca.php.net/manual/en/ref.strings.php
Sorry,
John

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

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



[PHP] Date comparison Question

2008-04-07 Thread admin
I am having a date time comparison issue. 
I have statically set the values here. But the data is fed from the database, 
CaldTime is timestamp and since it will not allow me to have 2 timestamps in 
the same table I set the CallEnd varchar(12). Storing the data they seem to be 
the same for output. I checked hexadecimal and binary to look for obscurities.


$sqldata['CaldTime']  = 2008-04-07 11:15:32;
$sqldata['CallEnd'] = 2008-04-07 11:17:17;

$time1 = strtotime($sqldata[CaldTime]);
$time2 = strtotime($sqldata[CallEnd]);
$interval = $time2 - $time1;

echo $interval;

+++
Displays like 1.75:0
I am looking for a more precise time like 1:45 instead.
Am I looking at this all wrong for time difference?

Richard L. Buskirk
Sorry my murloc got pawned in AV, and ever since I cant think right!

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



Re: [PHP] Date comparison Question

2008-04-07 Thread admin
Yes my mistake was looking at another record and published another.
But I figured it out now i can publish 1:45 like i wanted. Having a moment 
there.
Thank you 
Richard L. Buskirk 




 
On Mon, Apr 7, 2008 at 9:42 AM, [EMAIL PROTECTED] wrote:

I am having a date time comparison issue.
I have statically set the values here. But the data is fed from the database, 
CaldTime is timestamp and since it will not allow me to have 2 timestamps in 
the same table I set the CallEnd varchar(12). Storing the data they seem to be 
the same for output. I checked hexadecimal and binary to look for obscurities.


$sqldata['CaldTime']  = 2008-04-07 11:15:32;
$sqldata['CallEnd'] = 2008-04-07 11:17:17;

$time1 = strtotime($sqldata[CaldTime]);
$time2 = strtotime($sqldata[CallEnd]);
$interval = $time2 - $time1;

echo $interval;

+++
Displays like 1.75:0
I am looking for a more precise time like 1:45 instead.
Am I looking at this all wrong for time difference?

hmm.
different results for me w/ this code

?php
$time1 = strtotime('2008-04-07 11:15:32');
$time2 = strtotime('2008-04-07 11:17:17');

echo time1: $time1 . PHP_EOL;
echo time2: $time2 . PHP_EOL;

$interval =  $time2 - $time1;
echo $interval . PHP_EOL;
?

time1: 1207588532
time2: 1207588637
105
 -nathan

Re: [PHP] Date comparison Question

2008-04-07 Thread admin
Thank you that is exactly what i did to figure it out.
Just was having a brain fart there for a minute.



On Mon, Apr 7, 2008 at 11:42 AM,  [EMAIL PROTECTED] wrote:
t the data is fed from the database, CaldTime is timestamp and since
it will not allow me to have 2 timestamps in
 the same table

?? What database are you using?  It sounds like it has a specific
meaning of timestamp - probably the last time this row was
modified - and you want an arbitrary date column, which would
probably be a different column type.  Not a string, though.  An actual
date type.  possible names are date, datetime, datestamp...


, and you  I set the CallEnd varchar(12). Storing the data they seem
to be the same for output. I checked hexadecimal and binary to look
for obscurities.


  $sqldata['CaldTime']  = 2008-04-07 11:15:32;
  $sqldata['CallEnd'] = 2008-04-07 11:17:17;

  $time1 = strtotime($sqldata[CaldTime]);
  $time2 = strtotime($sqldata[CallEnd]);
  $interval = $time2 - $time1;

  echo $interval;

  +++
  Displays like 1.75:0
  I am looking for a more precise time like 1:45 instead.
  Am I looking at this all wrong for time difference?

strtotime returns an integer number of seconds.  The difference
between $time1 and $time2 is 105.  If you want minutes and seconds,
you have to do the math yourself.

$interval_min = floor($interval/60);
$interval_sec = $interval % 60;

echo $interval_min:$interval_sec;

-- 
Mark J. Reed [EMAIL PROTECTED]

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

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



Re: [PHP] Date comparison Question

2008-04-07 Thread admin
Dan I made a solution as below.

$time1 = strtotime($sqldata[CaldTime]);
$time2 = strtotime($sqldata[CallEnd]);
$interval = $time2 - $time1;
$TLength = date(i:s, strtotime(2008-01-01 01:00:$interval));

Result 01:45

Works perfect for me. Do you agree or disagree dan?




On Mon, Apr 7, 2008 at 11:42 AM,  [EMAIL PROTECTED] wrote:
 I am having a date time comparison issue.
  I have statically set the values here. But the data is fed from the 
database, CaldTime is timestamp and since it will not allow me to have 2 
timestamps in the same table I set the CallEnd varchar(12). Storing the data 
they seem to be the same for output. I checked hexadecimal and binary to look 
for obscurities.


  $sqldata['CaldTime']  = 2008-04-07 11:15:32;
  $sqldata['CallEnd'] = 2008-04-07 11:17:17;

  $time1 = strtotime($sqldata[CaldTime]);
  $time2 = strtotime($sqldata[CallEnd]);
  $interval = $time2 - $time1;

  echo $interval;

  +++
  Displays like 1.75:0
  I am looking for a more precise time like 1:45 instead.
  Am I looking at this all wrong for time difference?

  Richard L. Buskirk
  Sorry my murloc got pawned in AV, and ever since I cant think right!

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



This could be simplified to a function, but using some basic math

?php
$sqldata['CaldTime'] = 2008-04-07 11:15:32;
$sqldata['CallEnd'] = 2008-04-07 11:17:17;

$converted = explode('.',((strtotime($sqldata['CallEnd']) -
strtotime($sqldata['CaldTime'])) / 60));
$converted[1] = (($converted[1] / 6) * 3.6);
echo implode(':',$converted).\n;

?


-- 
/Daniel P. Brown
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

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

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



[PHP] File Format

2008-04-11 Thread admin
Wave editor?
Here is my dilemma.

In php I have written a script to upload a wave file to the server for the C 
Sharp application to use. No problems on upload or streaming from the file to 
the web. My issue comes when the format of the wave file is PCM and not CCITT 
u-Law. The device cannot play a PCM formatted wave file. Problem comes in when 
the end user just picks a wave file to use for this option and does not have 
the format correct.

Is there a wave format change option in php? 
Has or does anyone know of a solution in php for this?
Is there a way I can check the format of the wave file before uploading?



Richard L. Buskirk

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



[PHP] Safe mode story

2008-05-10 Thread admin

Hi all,

I'm running a Plesk 8.3 mass hosting server equipped with PHP 5.1.6 on 
CentOS 5, and I'm facing the problem of PHP Safe mode barfing at the 
UID mismatch of PHP scripts uploaded by user's FTP UID, and later 
executed by Apache UID, where user's PHP scripts thusly uploaded attempt 
to write any files while doing their job.


Is there an educated solution? What if I relax safe mode checks to gid 
(safe_mode_gid=On), and given that GID is psacln for every Plesk-hosted 
customer, with only UIDs being different, is there any risk that folks 
operating on their own chmod 660 files will be able to overwrite other 
people's chmod 660 files? Or will open_basedir be enough to prevent 
unwanted PHP level file access while relaxing safe mode uid check at the 
same time? (by default, it is properly set by Plesk in 
%mysite%/conf/httpd.include) ?


BTW, safe_mode_exec_dir is empty by default, does it mean if I do set 
safe_mode_gid then users will be able to exec other Plesk users' cgi-bin 
scripts etc. because of GIDs being equal??


Safe mode has _got_ to be there for some good reason.

Thanks in advance for any tips.

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



[PHP] RE:Windows Service Call from linux php server

2008-05-15 Thread admin
I used soap to perfect the Windows service call and resolved the issue so 
simple it kills me. Not happy with the huge upgrade of php process but happy 
with final results.

Resolution:
?php
$wsdl= http://user:[EMAIL PROTECTED]/WebService/service.asmx?WSDL;
$soap = new soapclient($wsdl,wsdl);
$soap-setCredentials(user,password);
$proxy = $soap-getProxy();
$parameters = 
array(Username=,Password=,caltalk=,canum=,audio=,STime=,Email=);
$result = $proxy-makeCall($parameters); 
?

I have one more question if you have time?

I have been requested to give a live results query. I need to not only pull 
results from mysql using php, but I have to display the results like a cicso 
Switch. 

I have to display channels in use realtime. Without refreshing the page a 
gazillion times, is there another method of constantly pulling the data from 
mysql and displaying it in the php script for realtime switch status? 

I looked into AJAX but it seems to pull all the data up into a global of static 
data it does not refresh or regrab every so many seconds, so the display is not 
realtime. 

I do not know that Ajax has this ability does it?
 
Is there a way to refresh the mysql pull in php I am unaware of?

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



RE: [PHP] My open source php CMS

2008-05-15 Thread admin
Page Not Found.





Hello, first of all, sorry for this plug, I am looking for interested 
developers.
I just want to let you know about my open source project that uses over 
15 pear classes and uses pear installer as the primary means to install it
I also wrote a web-based interface for using pear installer to install 
upgrades and modules

I created some flash-based demos on how to install it.

I really hope to find some interested developers to join this project. 
It became too big for me.

Please at least look at it, watch the demos:

http://dev.sharedlog.com/index.php?a=personaluid=1002

I will be adding more demos on how to use other feature.

The anonymous svn is here for anyone who is interested.
http://dev.sharedlog.com/svn/

Is there a better more appropriate list to announce such project?

-- 

Open Source ALL content management
with streaming video
http://wiki.sharedlog.com



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

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



[PHP] php mysql live feed

2008-05-20 Thread admin
Okay before i pull more hair out...

I am trying to use php to pull mysql data and refresh the mysql data every say 
5 seconds for like a live display of the database without the screen reloading.

I want the data to refresh but not the screen. Ajax seems to hate me because 
everything i have seen/read/tried is wrapped around ASP.NET or requires a user 
interaction to invoke the query.

If you have example scripts or a good tutorial that actually works where you 
can open a php script and the data changes on the page as the database does and 
the screen does not refresh, and you don’t have to onclick, onfocus, or onblur 
kind of thing. I would be in your debt

Frustrated Rick

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



RE: [PHP] php mysql live feed

2008-05-21 Thread admin
Todd

I want to thank you. You sent me thinking in the right direction to resolving 
this issue. I now have successfully created a live Pika Card status GUI using 
PHP, MYSQL, AJAX.

The key word in what you said was unique function. I was not thinking to write 
a function. I was looking for the quick solve (php MySQL loop or something 
stupid). Not only does this work flawless but it has surpassed all my 
expectations of the gui.

Todd thank you again for your suggestions and you helped me allot.












Nameless,

I see someone mentioned the setTimeout(function, milliseconds) function for 
JavaScript. I would also like to point out that you can use 
setInterval(function, milliseconds) in order to have an event repeat at a set 
interval. For instance, let's say you had a page laid out like so:

---
div id=blah
Text here
/div
---

You would want to add a script somewhere that would begin the interval in order 
to update the div:

---
script type=text/javascript
function ajaxRequest()
{
// insert postback code here

document.getElementById(blah).innerHTML = ajax.responseText;  

}

var t = setInterval(ajaxRequest(), 5000);
/script
---

This assumes that your XmlHttpRequest object is named ajax. Assigning the 
interval to variable t ensures that you can clear the interval if you need to 
(via clearInterval(t);).

I suppose innerText can be used instead of innerHTML, as well. I would 
recommend using innerHTML only if you will be populating the div with HTML 
code, however.

Hope this helps,


Todd Boyd
Web Programmer


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, May 20, 2008 3:25 PM
 To: php-general@lists.php.net
 Subject: [PHP] php mysql live feed
 
 Okay before i pull more hair out...
 
 I am trying to use php to pull mysql data and refresh the mysql data
 every say 5 seconds for like a live display of the database without the
 screen reloading.
 
 I want the data to refresh but not the screen. Ajax seems to hate me
 because everything i have seen/read/tried is wrapped around ASP.NET or
 requires a user interaction to invoke the query.
 
 If you have example scripts or a good tutorial that actually works
 where you can open a php script and the data changes on the page as the
 database does and the screen does not refresh, and you don’t have to
 onclick, onfocus, or onblur kind of thing. I would be in your debt
 
 Frustrated Rick
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

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



RE: [PHP] RE: Military Service WAS [PHP] Capitalization of variable

2008-06-20 Thread admin
Marine Corps..

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



[PHP] Merge array i think

2008-08-14 Thread admin
Here is my problem in mssql in asp i can 
SELECT (height + 'x' + width) as size FROM Twenty


How can i do that for mysql under php?
I am trying to create a single array result using 2 different fields of data 
plus extra characters.

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



RE: [PHP] Merge array i think

2008-08-14 Thread admin
Never mind I was looking at php and it was a Mysql thing
SELECT CONCAT('My', 'S', 'QL');
will do exactly what i want







Here is my problem in mssql in asp i can 
SELECT (height + 'x' + width) as size FROM Twenty


How can i do that for mysql under php?
I am trying to create a single array result using 2 different fields of data 
plus extra characters.

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

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



[PHP] Altering the error_reporting

2008-09-03 Thread admin
I am looking for a way to alter the error_reporting(E_All)
 This displays 
Parse error: parse error, unexpected '}' in /var/www/html/test.php on line 7

I want to remove the file location and line number from the error
to only produce
Parse error: parse error, unexpected '}'

Why? You may ask.

I am writting a code tester in php but i do not want to display the in 
portion. 
This will make you find the error on your own. As a learning tool.

Understand I have error reporting off in the php.ini file and call the errors 
in the php script with ini_set('display_errors', 1);.

I am sure this is doable I just cant figure out how to do this without altering 
the php.ini file.

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



Re: [PHP] Sepating MySQL result set into html tables

2008-09-26 Thread admin
Might I suggest you count the fields and divide it by the cols you want to 
display? 

Example:
$forest = mysql_query(SELECT * FROM your_table);
$gump = mysql_num_fields($forest);

Because I know my table contains 15 rows I can do this.
$tulip = floor($gump /5);
I know how many fields to display before row break or create a new table.
May seems extremely simple but works very well for me.




Thodoris wrote:
 Hello everybody,
I have a mysql result set that I want to print out in an html table. 
 But some times it gets so big that I will probably need to separate it 
 in to multiple ones. I wrote a function that separates the result set 
 into three ones like this:
 
 ...
 
 But I really need to tell the function in how many tables I need the 
 result set to be separated. How can I do this?
 
 What can I put instead of this for 3 tables: (($j == $limit-1) || ($j == 
 (2*$limit)-1))
 
 I can't find the algorithm although I think I have done this before but 
 I can't remember how.
 

Why not just use LIMIT in your query and make several?

Why do you need to split the data into multiple tables, anyway?

$table = table class='inner';
 
$table .= tabletrtdtable class='inner';

That's going to give you badly-formatted HTML.

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

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



RE: [PHP] Sepating MySQL result set into html tables

2008-09-26 Thread admin
Might I suggest you count the fields and divide it by the cols you want to 
display? 
Example
$forest = mysql_query(SELECT * FROM your_table);
$gump = mysql_num_fields($forest);

Because I know my table contains 15 rows I can do this.
$tulip = floor($gump /5);
I know how many fields to display before a row break.
May seems extremely simple but works very well for me.



Hello everybody,
I have a mysql result set that I want to print out in an html table. 
But some times it gets so big that I will probably need to separate it 
in to multiple ones. I wrote a function that separates the result set 
into three ones like this:

function showTable($columnNames,$data,$alignment,$wrap) {
   
$limit = round(count($data)/3,0);
   
$align = 
array('l'='align=left','c'='align=center','r'='align=right');

$table = table class='inner';


$table .= tabletrtdtable class='inner';

$table .= tr;
foreach ($columnNames as $col_name){
$table .= th.$col_name./th;
}
$table .= /tr\n;

foreach ($data as $j = $row) {

if(($j % 2) == 0){
$table .= tr class=even;
} else {
$table .= tr class=odd;
}
for($i=0;$icount($row);$i++){

$table .= td .$wrap. 
.$align[$alignment[$i]]..$row[$i]./td;

}

$table .= /tr\n;

if (($j == $limit-1) || ($j == (2*$limit)-1)) {
$table .= /table/tdtdtable;
$table .= tr;
foreach ($columnNames as $col_name){
$table .= th.$col_name./th;
}
$table .= /tr\n;
}
}
$table .= '/table/td/tr';
$table .= /table\n;
print $table;
}


But I really need to tell the function in how many tables I need the 
result set to be separated. How can I do this?

What can I put instead of this for 3 tables: (($j == $limit-1) || ($j == 
(2*$limit)-1))

I can't find the algorithm although I think I have done this before but 
I can't remember how.

-- 
Thodoris


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

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



[PHP] Csv issue

2008-10-13 Thread admin
I am using a form to select a csv file and then import it into mysql and maybe 
im just drawling a blank here. But why is it blowing up.
This thing loads like 14 million records into the database and I am clue less 
how it can do that with a 2 record csv file.

form enctype='multipart/form-data' action=? method=post
Upload:input type=file name=filename
input type=submit value='Upload'/form


$row = 1;
$filename = $_POST['filename'];
$handle = fopen($filename, r);
while (($data = fgetcsv($handle, 1000, ,)) !== FALSE)
{
$num = count($data);
echo p $num fields in line $row: br //p\n;
$row++;
}
fclose($handle);
print Import done;

This will produce millions of lines until i go in and stop the process on the 
server. I know its stupid but im drawling a blank as to why its doing this. The 
csv file has 2 lines in period. 
p 0 fields in line 1: br //p
p 0 fields in line 2: br //p
ect for millions of records.

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



[PHP] Date Issue

2008-11-17 Thread admin
$smont = 10;
$sday = 13;
$syear = 2008;
$timestamp = mktime(0,0,0,$smont,$sday,$syear);
$thismonth = getdate($timestamp);

Here is where the problem comes into play.

echo $thismonth['yday'];

This displays 286 when in fact its 287.
Is there a problem in my ini file or what is the deal.

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



[PHP] Php mysql update

2008-12-29 Thread admin
Okay maybe i have just forgot.
I am trying to update the database and do a +1 to a int field without pulling 
the data and adding 1 to it and sticking it back in.

Someone refresh me on this please.
I think it is something like.
$dwsl = mysql_query(UPDATE database set Field='+1' WHERE Criteria='Criteria');

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



RE: [PHP] Php mysql update

2008-12-29 Thread admin
Sorry about that it hit me right after i sent the email.
Thank You so much for you reply


Hello, you have to do :
$dwsl = mysql_query('UPDATE database SET Field=Field+1 WHERE 
Criteria=\'Criteria\''); From: ad...@buskirkgraphics.com To: 
php-general@lists.php.net Date: Mon, 29 Dec 2008 12:05:37 -0500 Subject: 
[PHP] Php mysql update  Okay maybe i have just forgot. I am trying to update 
the database and do a +1 to a int field without pulling the data and adding 1 
to it and sticking it back in.  Someone refresh me on this please. I think 
it is something like. $dwsl = mysql_query(UPDATE database set Field='+1' 
WHERE Criteria='Criteria');  --  PHP General Mailing List 
(http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php 
_
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp

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



[PHP] php rpm

2009-02-04 Thread admin
Okay here is my question.
Does anyone know of an RPM of php that is pre-compiled with all the extras like 
soap, mssql, freetds, etc...

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



Re: [PHP] making a tutorial

2006-03-16 Thread admin
Parse.. It will be an array after you submit the form.
So depends on what you wanna do with it.

Do a print_r($favourite); after form submit and you will see.

How to  store it.. well if you wanna it in seperate fields you can loop
through it and do an insert on every array element in your DB or store it
serialized. Or create a string from the array and store it in a DB field.
enum? Don't think it will work :)

grtz,
Thijs

 I'm making a tutorial and don't really understand how to do this myself :)

 pWhich of the following pets do have at home:
 br /input type=checkbox name=favourite[] value=dogdog
 br /input type=checkbox name=favourite[] value=catcat
 br /input type=checkbox name=favourite[] value=snakesnake
 br /input type=checkbox name=favourite[] value=othersnake
 br /input type=checkbox name=favourite[] value=nonenone of these
 /p

 How do I parse favourite[]? I might have 2 or 5, so I need to parse ^0]
 - nMax. It is a checkbox.

 I might use favourite[] with mail() or store it in a mysql field.

 If mysql, would I store it in a varchar(20) or an enum() and how?

 John



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



Re: [PHP] Query for two fields with the same name

2006-04-20 Thread admin
Maybe something like this :

$connection = SELECT t2.id AS idtwo, t1.id AS idone FROM connection AS
t1, pr AS t2 WHERE t1.area_id
= '$gateway_link' AND t1.pr_id = t2.id;

 This is probably a simple question, but I can't seem to find the
 answer online.

 I'm using this query:

 $connection = select * from connection, pr WHERE connection.area_id
 = '$gateway_link' and connection.pr_id = pr.id;

 Both tables have a field called ID but they have different
 information in them. $row['id'] gets me the one from the table called
 pr but I need to call the ID from the table connection.

 --
 Kevin Murphy
 Webmaster: Information and Marketing Services
 Western Nevada Community College
 www.wncc.edu
 775-445-3326

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



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



Re: [PHP] Need help with an if statement

2006-04-24 Thread admin
Kinda depends on how you build the list of links i guess. What you need is
a unique identifier. But would be more easy if you show some code.

item 1 cart.php?item=1
item 2 cart.php?item=2

Then when you make the links. Use a loop

foreach($links as $link) {
if ($link[id] == $_GET[item])
{
// arrow image here
}
}

Well anyway. Show some code how you build the links list. My code sucks
but it's a start. It's to early :)

Gr,
Thijs

 Hello,

 I am really new to all this and I am really hoping I can get some
 help PLEASE...
 I am making a website with x-cart which uses PHP and Smarty templates.

 I need to make an  if  statement that puts a little arrow gif in
 front of the link that is clicked on! make any sense?

 In other words:

 item 1 (not selected)
 item 2 (not selected)
   item 3 (selected)
 item 4 (not selected)

 This is what I have now, but I don't know what to call my {if ?}

 {if ?}A href={?}FONT class=buttontextonlyIMG
 src={$ImagesDir}/arrow.gif width=9 height=7 border=0
 align=abstop{$menu_content}/FONT/A
 {else}
 FONT class=VertMenuTitle{$menu_content}/FONT
 {/if}/TD

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



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



[PHP] Location header - slow redirect

2003-07-30 Thread admin
I'm using the following short script to redirect users to another page 
on my site (php 4.3.2, Apache 2.0.47).

?php
$goLang='en';
header(Location: http://; . $_SERVER['HTTP_HOST'] . / . $goLang . /);
exit;
?
I'm having a problem where it takes up to 15 seconds for the redirect 
page to load, but for other redirects on the site programmed in a 
similar way using php and the location header the page loads straight away.

I'm a bit perplexed and would appreciate some suggestions.
Thanks
Phil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] fopen errors

2004-02-18 Thread admin
I have a PHP front end with a MySQL back end with a longblob field.

I am thinking the problem exists in the PHP part.

Here is the code I am using:

$fileHandle = fopen($fileUpload, r);
$fileContent = fread($fileHandle, $fileUpload_size);
$fileContent = addslashes($fileContent);

Then it goes into the Db connection part.

When I run the script I get the following error:

Warning: fopen(C:\\0-temp\\100_0078.jpg, r) -No such file or
directory in /var/www/testbed/httpdocs/blob/grabfile.php on line 41

Warning Supplied argument is not a valid File-Handle resource in
/var/www/testbed/httpdocs/blob/grabfile.php on line 45


Then only thing that really jumps out at me in the file source path of
C:\\0-temp\\100_0078.jpg  there is a couple of extra Backslashes (\)
in the path statement.

I am using a sample script that pulled from one of the websites.

Thanks in Advance,

Jess

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



RE: [PHP] verify text in field

2009-02-26 Thread admin
Try
$text = Joe of Egypt;
$sql = SELECT title FROM book WHERE title LIKE '$text';
$result = mysql_query($sql);
If(mysql_num_rows($result) = '1')
{
  while ( $row = mysql_fetch_array($sql) ) {
echo(P . $row[title] . /P);
  }
}

My Ideas my not make some people happy with my design but I use it and it
works very well



-Original Message-
From: PJ [mailto:af.gour...@videotron.ca] 
Sent: Thursday, February 26, 2009 5:07 PM
To: php-general@lists.php.net
Subject: [PHP] verify text in field

Is there a shorter way of determining if a field contains text?
This works but I wonder if I can K.I.S.S. it? I really only need to know
if there is or is not a field containing the text specified. I don't
need to see it.
?php
 
  // Request the text
  $text = Joe of Egypt;
  $sql = SELECT title FROM book WHERE title LIKE '$text';
  $result = mysql_query($sql);
  if (!$result) {
echo(PError performing query:  .
 mysql_error() . /P);
exit();
  }

  // Display the text
  while ( $row = mysql_fetch_array($result) ) {
echo(P . $row[title] . /P);
  }
  if ($row[title] == )
  echo (Empty!)

?

-- 

Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com


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


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



[PHP] Time difference desired load

2009-04-20 Thread admin
Suggestion on faster solutions for extremely large database.

$ledip['started'] = '2009-04-01 13:40:34'; Example time in DB
$ledip['touchedlast'] = '2009-04-01 13:41:28'; Example time in DB


date('i:s', strtotime($ledip['touchedlast']) - strtotime($ledip['started'])); 
// Not a desired solution because of its inability to go past the minute 
correctly I AM AWARE.


or 

concat( truncate( hour( timediff($ledip['touchedlast'],$ledip['started']) ) 
/24, 0 ) ,  days , hour( timediff($ledip['touchedlast'],$ledip['started']) ) 
%24,  hours , minute( timediff($ledip['touchedlast'],$ledip['started'] ) ) , 
 minutes , second( timediff($ledip['touchedlast'],$ledip['started'] ) ) ,  
seconds ) as timeleft


The results of concat truncate, allows me the flexibility or exacting time 
differences out past the minute. I am worried that the vastness of the database 
may cause me a server load or query timeframes that are undesirable as it grows 
even bigger.
Suggestions?

*   PLEASE 
Do not reply to this email with your 9 million page thought of how to,  or some 
custom function that you think is all that, I do not care.
I am asking for load desired results NOT your take on my code…

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



[PHP] php/mysql Query Question.

2009-09-15 Thread admin
Before most of you go on a rampage of how to please read below...

As most of you already know when using MySQL from the shell you can write your 
queries in html format in an out file.

Example:   shellmysql -uyourmom -plovesme --html
This now will return all results in an html format from all queries.

Now I could “tee” this to a file and save the results returned if I so choose 
to save the result of the display .

Let’s say I want to be lazy and write a php MySQL query to do the same so that 
any result I queried for would return the html results in a table without 
actually writing the table tags in the results.

Is there a mysql_connect or select_db or mysql_query tag option to do that 
since mysql can display it from the shell?

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



Re: [PHP] php/mysql Query Question.

2009-09-16 Thread admin
I tend to do this robert,
while looking at your example i thought to myself since i am trying to mimick a 
shell command why not run one.

Result:
?
$db   = 'db';
$host = 'host';
$user = 'user';
$pass = 'pass';
$query = select * from $db.my_table;
$ddvery = shell_exec(mysql -u$user -p$pass --html --execute=$query);
echo pre$ddvery/pre;
?

Not are the results safe but the unlimited possibilites are amazing. Thanks so 
much for the kick starter




ad...@buskirkgraphics.com wrote:
 Would you mind giving me an example of this that i can stick right into a 
blank php file and run.
 
 I get what you are saying but i cant seem to make that even echo out the 
data.  php 5.2 mysql 5.1.3 Apache 2.2

?php

$db   = 'db';
$host = 'host';
$user = 'user';
$pass = 'pass';

$query = select * from my_table;

$db   = escapeShellArg( $db );
$host = escapeShellArg( $host );
$user = escapeShellArg( $user );
$pass = escapeShellArg( $pass );

$query = escapeShellArg( $query );

$command = echo $query | mysql --html -h$host -u$user -p$pass $db;

echo 'Command: '.$command.\n;
$html = `$command`;
echo $html.\n;

?

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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

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



RE: [PHP] Fiscal Years and Quarters

2010-10-19 Thread admin
Don

If you are looking for current quarter you can do this.

$tm = date('Y-m-d H:i:s');
$Current_Fiscal_Quarter = ceil(date(m, $tm)/3);
This will return the quarter you are currently in.
Exmaple 1, 2, 3,or 4 

I have a great quarterly dates function posted on php.net
http://www.php.net/manual/en/function.date.php#100390











-Original Message-
From: Don Wieland [mailto:d...@pointmade.net] 
Sent: Tuesday, October 19, 2010 7:12 PM
To: php-general@lists.php.net
Subject: [PHP] Fiscal Years and Quarters

Hello,

I have a preference field called Fiscal_Year_Start_Month which has  
the Month Names as options.

Based on this value, I need to calculate the following date in UNIX:

Current_1st_Quarter_Start_Date
Current_1st_Quarter_End_Date
Current_2nd_Quarter_Start_Date
Current_2nd_Quarter_End_Date
Current_3rd_Quarter_Start_Date
Current_3rd_Quarter_End_Date
Current_4th_Quarter_Start_Date
Current_4th_Quarter_End_Date

Last_1st_Quarter_Start_Date
Last_1st_Quarter_End_Date
Last_2nd_Quarter_Start_Date
Last_2nd_Quarter_End_Date
Last_3rd_Quarter_Start_Date
Last_3rd_Quarter_End_Date
Last_4th_Quarter_Start_Date
Last_4th_Quarter_End_Date

Next_1st_Quarter_Start_Date
Next_1st_Quarter_End_Date
Next_2nd_Quarter_Start_Date
Next_2nd_Quarter_End_Date
Next_3rd_Quarter_Start_Date
Next_3rd_Quarter_End_Date
Next_4th_Quarter_Start_Date
Next_4th_Quarter_End_Date

Then based on TODAY'S date

Current_Fiscal_Quarter - result will be 1, 2, 3,or 4



Don

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


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



RE: [PHP] Fiscal Years and Quarters

2010-10-19 Thread admin
Is there any way to get rid of, whatever wet behind the ears person whom has
this spam return for every post.

mytr...@mail.ua

I get 3 and 4 of these for every reply, I am sure anyone who is posting to
the list gets the same emails.






-Original Message-
From: Don Wieland [mailto:d...@pointmade.net] 
Sent: Tuesday, October 19, 2010 7:12 PM
To: php-general@lists.php.net
Subject: [PHP] Fiscal Years and Quarters

Hello,

I have a preference field called Fiscal_Year_Start_Month which has  
the Month Names as options.

Based on this value, I need to calculate the following date in UNIX:

Current_1st_Quarter_Start_Date
Current_1st_Quarter_End_Date
Current_2nd_Quarter_Start_Date
Current_2nd_Quarter_End_Date
Current_3rd_Quarter_Start_Date
Current_3rd_Quarter_End_Date
Current_4th_Quarter_Start_Date
Current_4th_Quarter_End_Date

Last_1st_Quarter_Start_Date
Last_1st_Quarter_End_Date
Last_2nd_Quarter_Start_Date
Last_2nd_Quarter_End_Date
Last_3rd_Quarter_Start_Date
Last_3rd_Quarter_End_Date
Last_4th_Quarter_Start_Date
Last_4th_Quarter_End_Date

Next_1st_Quarter_Start_Date
Next_1st_Quarter_End_Date
Next_2nd_Quarter_Start_Date
Next_2nd_Quarter_End_Date
Next_3rd_Quarter_Start_Date
Next_3rd_Quarter_End_Date
Next_4th_Quarter_Start_Date
Next_4th_Quarter_End_Date

Then based on TODAY'S date

Current_Fiscal_Quarter - result will be 1, 2, 3,or 4



Don

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


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



RE: [PHP] questions about if statements regarding a checkbox

2010-10-30 Thread admin


input type=checkbox name=test

If check it will submit the value of 'on'

So 

If($_POST['test'] == on')
{
Do this
}else{
Do this
}


Richard L. Buskirk


-Original Message-
From: Ben Brentlinger [mailto:b...@benbrent.com] 
Sent: Saturday, October 30, 2010 10:05 PM
To: php-general@lists.php.net
Subject: [PHP] questions about if statements regarding a checkbox

hello,

I'd like to know the proper code to use in a php script that processes a 
form with a checkbox in order to send one email if the checkbox has been 
checked and another email if the checkbox hasn't.  I tried if($check == 
true) and I tried putting the word true in double quotes, and both of 
them caused the unexpected variable syntax error.  The only problem 
is, all I could think to use was that line of code I just used, I'm not 
sure what the proper syntax is for checkbox when using the if statement 
to send one email when the checkbox is checked and a different email 
when it's not checked.  I'm wanting to send an email to the site admin 
with the information given by the person who filled out the form that 
contains the checkbox.


Thanks,

Ben

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


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



RE: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread admin
I tested your code and besides adding a form to the beginning it works.

If you want to see the results of the posted for try.

print_r($_POST);

you can see every position of the array passed and validate they are passing as 
intended.

Try this.

//if reallife is not set (Checked it will not pass)
// I am pretty sure I read where someone had responded with the isset


if(isset($_POST['reallife']))
{

print_r($_POST);

}



Richard L. Buskirk


-Original Message-
From: Ben Brentlinger [mailto:b...@benbrent.com] 
Sent: Sunday, October 31, 2010 8:26 AM
To: php-general@lists.php.net
Subject: Re: [PHP] questions about if statements regarding a checkbox

Here's the code I'm using with the exception of the php tags and the 
redirect script that redirects to another page once the form is 
submitted.  This is just a test script I'm working on in order to teach 
myself php.  The php portion will be posted first, than the html form 
related to the php.  I've got the code inside tags similar to the code 
tag which only serves to serarate the php code from the html form.

[php_code]
$name = $_POST['firstname'] . ' ' . $_POST['lastname'];
$email = $_POST['email'];

if($_POST['reallife'] == on)
{
$to = 'b...@benbrent.com';
$subject ='test email one';
$msg = $name has filled out the test form. \n .
this is just a test message;
mail ($to, $subject, $msg, 'From:' . $email);

} else {

$to = 'b...@benbrent.com';
$subject ='test email two';
$msg = $name has filled out the test form. ;
mail ($to, $subject, $msg, 'From:' . $email);
}

if($_POST['reallife'] == on) {

$to = '$email';
$subject = Thank you email number one;
$msg = hello $name, \n .
thank you for filling out the form. \n .
This is the first of two test emails \n .
The second would have been sent \n .
if you had left the checkbox unchecked \n;
mail ($to, $subject, $msg, 'From:' . $...@benbrent.com);
}

header (location:thankyoupage)
[/php_code]



[html_code]
div align=center
table border=0
   cellpadding=3 cellspacing=0 width=59%
tr
td colspan=2
h2 align=centernbsp;/h2
h2 align=centerfont color=blue face=ArialContact Form/font/h2
p align=centernbsp;/p
td width=51% align=right
p align=leftfont face=ArialEmail/fontfont face=Times New 
Roman:/fontfont face=Arial /font/td
td width=49% align=leftinput type=text name=email size=20/td
/tr

tr
td width=51% align=right
p align=leftfont face=ArialFirst Name: /font/td
td width=49% align=leftinput type=text name=firstname 
size=20/td
/tr
tr
td width=51% align=right
p align=leftfont face=ArialLast Name: /font/td
td width=49% align=leftinput type=text name=lastname 
size=20/td
/tr
tr
td width=51% align=right
p align=leftfont face=ArialI know you in real life/font/td
td width=49% align=leftinput type=checkbox name=reallife 
size=20/td
/tr
/table
pinput type=submit value=contact me
   name=B1/p

/center/div
/form
/td
tdnbsp;/td
/tr
/table
[/html_code]


This actual code that is on the portion of my hosting account which I 
use as my test server.  In my opinion, it's much cheaper to pay for a 
hosting account to use as a test server to teach myself php than it is 
to pay some collage professor to teach it to you only to be slapped in 
the face by having him assume you're learning php to be a freelance 
coder working for a company that does freelance work.  The truth is, I 
only have an interest in learning php to use in my own business and when 
I get good enough, I may do some freelancing on the side on sites like 
Scriptlance, but my main focus will be my own business and for anyone to 
have the audacity that I plan on working for someone else my whole life 
pisses me off, so that's why I'd much rather teach myself than to take a 
college class on php.

Thanks,

Ben

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


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



RE: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread admin
I placed an example of your code on my site.
I simply pasted exactly what you had, minus the actual mailing portion.

If you check the box you will see the array, if you do not check the box no 
array.

http://www.richardbuskirk.com/blunk.php


Forgive my prior post, I had not woke up yet.
So the wording is missing things though, yet not put to email mid sentence.

Code from site.


?php
if(isset($_POST['reallife']))
{
print_r($_POST);
}
?

form action=? method=post
div align=center
table border=0
   cellpadding=3 cellspacing=0 width=59%
tr
td colspan=2
h2 align=centernbsp;/h2
h2 align=centerfont color=blue face=ArialContact Form/font/h2
p align=centernbsp;/p
td width=51% align=right
p align=leftfont face=ArialEmail/fontfont face=Times New
Roman:/fontfont face=Arial /font/td
td width=49% align=leftinput type=text name=email size=20/td
/tr

tr
td width=51% align=right
p align=leftfont face=ArialFirst Name: /font/td
td width=49% align=leftinput type=text name=firstname
size=20/td
/tr
tr
td width=51% align=right
p align=leftfont face=ArialLast Name: /font/td
td width=49% align=leftinput type=text name=lastname
size=20/td
/tr
tr
td width=51% align=right
p align=leftfont face=ArialI know you in real life/font/td
td width=49% align=leftinput type=checkbox name=reallife
size=20/td
/tr
/table
pinput type=submit value=contact me
   name=B1/p

/center/div
/form
/td
tdnbsp;/td
/tr
/table






Richard L. Buskirk


-Original Message-
From: ad...@buskirkgraphics.com [mailto:ad...@buskirkgraphics.com] 
Sent: Sunday, October 31, 2010 10:37 AM
To: 'Ben Brentlinger'; php-general@lists.php.net
Subject: RE: [PHP] questions about if statements regarding a checkbox

I tested your code and besides adding a form to the beginning it works.

If you want to see the results of the posted for try.

print_r($_POST);

you can see every position of the array passed and validate they are passing as 
intended.

Try this.

//if reallife is not set (Checked it will not pass)
// I am pretty sure I read where someone had responded with the isset


if(isset($_POST['reallife']))
{

print_r($_POST);

}



Richard L. Buskirk


-Original Message-
From: Ben Brentlinger [mailto:b...@benbrent.com] 
Sent: Sunday, October 31, 2010 8:26 AM
To: php-general@lists.php.net
Subject: Re: [PHP] questions about if statements regarding a checkbox

Here's the code I'm using with the exception of the php tags and the 
redirect script that redirects to another page once the form is 
submitted.  This is just a test script I'm working on in order to teach 
myself php.  The php portion will be posted first, than the html form 
related to the php.  I've got the code inside tags similar to the code 
tag which only serves to serarate the php code from the html form.

[php_code]
$name = $_POST['firstname'] . ' ' . $_POST['lastname'];
$email = $_POST['email'];

if($_POST['reallife'] == on)
{
$to = 'b...@benbrent.com';
$subject ='test email one';
$msg = $name has filled out the test form. \n .
this is just a test message;
mail ($to, $subject, $msg, 'From:' . $email);

} else {

$to = 'b...@benbrent.com';
$subject ='test email two';
$msg = $name has filled out the test form. ;
mail ($to, $subject, $msg, 'From:' . $email);
}

if($_POST['reallife'] == on) {

$to = '$email';
$subject = Thank you email number one;
$msg = hello $name, \n .
thank you for filling out the form. \n .
This is the first of two test emails \n .
The second would have been sent \n .
if you had left the checkbox unchecked \n;
mail ($to, $subject, $msg, 'From:' . $...@benbrent.com);
}

header (location:thankyoupage)
[/php_code]



[html_code]
div align=center
table border=0
   cellpadding=3 cellspacing=0 width=59%
tr
td colspan=2
h2 align=centernbsp;/h2
h2 align=centerfont color=blue face=ArialContact Form/font/h2
p align=centernbsp;/p
td width=51% align=right
p align=leftfont face=ArialEmail/fontfont face=Times New 
Roman:/fontfont face=Arial /font/td
td width=49% align=leftinput type=text name=email size=20/td
/tr

tr
td width=51% align=right
p align=leftfont face=ArialFirst Name: /font/td
td width=49% align=leftinput type=text name=firstname 
size=20/td
/tr
tr
td width=51% align=right
p align=leftfont face=ArialLast Name: /font/td
td width=49% align=leftinput type=text name=lastname 
size=20/td
/tr
tr
td width=51% align=right
p align=leftfont face=ArialI know you in real life/font/td
td width=49% align=leftinput type=checkbox name=reallife 
size=20/td
/tr
/table
pinput type=submit value=contact me
   name=B1/p

/center/div
/form
/td
tdnbsp;/td
/tr
/table
[/html_code]


This actual code that is on the portion of my hosting account which I 
use as my test server.  In my opinion, it's much cheaper to pay for a 
hosting account to use as a test server to teach myself php than it is 
to pay some collage professor to teach it to you only to be slapped in 
the face by having him assume you're learning php to be a freelance 
coder working for a company that does freelance work.  The truth is, I 

RE: [PHP] Problem with shell_exec

2010-10-31 Thread admin
It seems most probably a permission problem.  If I were you I would
check the permissions on the bin directory and the files in it.  PHP
will probably run under the uid of the webserver, which, on most
systems is either apache or nobody depending on the configuration.

Richard L. Buskirk


-Original Message-
From: Boyan Penev [mailto:boyan...@googlemail.com] 
Sent: Sunday, October 31, 2010 11:16 AM
To: php-general@lists.php.net
Subject: [PHP] Problem with shell_exec

Hello,

i have installed php 5.2.14 on an embedded system. I have run a couple of
test scripts and everything works fine,
 but i can't get shell_exec to work. When i invoke shell_exec, the
script doesn't get interpreted, instead
i get prompted to download the whole .php file. I have tried both /bin/php
and /bin/php-cgi- same problem.
When i try to execute it per command line instead of web server, with both
php and php-cgi i get Segmentation fault
and nothing happens. I use busybox http as a web server, if it's relevant.
Does anybody have an idea what the problem
might be? Any help would be appreciated.

Best regards,

Boyan


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



RE: [PHP] Problem with shell_exec

2010-10-31 Thread admin
After going over this a thousand times in my head and on sever.
Here are a few reasons why a shell_exec will not function.

First I tested the PHP CLI
Can I see my version of php.
$output = shell_exec('php -v');
Echo $output;
If I am not getting the information about the php version. Is shell_exec for
php and http on?

In your php.ini file there will be a section called disable_functions.
If you are sure that shell_exec is not in the list.


If neither of these are an issue for you, It has to be a permissions issue.


I do not claim to be an expert in the shell_exec area of php, I cannot
duplicate your error.

Richard L. Buskirk


-Original Message-
From: Boyan Penev [mailto:boyan...@googlemail.com] 
Sent: Sunday, October 31, 2010 12:26 PM
To: ad...@buskirkgraphics.com
Cc: php-general@lists.php.net
Subject: Re: [PHP] Problem with shell_exec

Hello Richard,

thank you for the prompt reply. I just tried to follow your suggestion, but
i couldn't solve my problem:

1. I  have started the server with user nobody. All the binaries i was
trying to execute(e.g. /bin/ls) were chown-ed to the user nobody
Problem presisted. Than i chown -ed /var/www to the user nobody. Than
the php and php-cgi interpreters as well- same thing.
I tried the same with users adm and even root

2. I than gave the executables all the permissions possible(777- i know it
is dangerous, but i am just testing)- still nothing.
 I copied the binaries from /bin to /var/www and tried to execute them
with all kinds of permissions and chown's- didn't work

3. Than i moved to the command line interpreter: i tried to execute it in
/var/www and in the home folder. The permissions were also adjusted. I
executed it with root privileges- i always get Segmentation fault. One
more thing- if i omit the arguments in shell_exec( $output = shell_exec();)
i get Missing parameters but no Segmentation fault

Boyan

On Sun, Oct 31, 2010 at 4:34 PM, ad...@buskirkgraphics.com wrote:

 It seems most probably a permission problem.  If I were you I would
 check the permissions on the bin directory and the files in it.  PHP
 will probably run under the uid of the webserver, which, on most
 systems is either apache or nobody depending on the configuration.

 Richard L. Buskirk


 -Original Message-
 From: Boyan Penev [mailto:boyan...@googlemail.com]
 Sent: Sunday, October 31, 2010 11:16 AM
 To: php-general@lists.php.net
 Subject: [PHP] Problem with shell_exec

 Hello,

 i have installed php 5.2.14 on an embedded system. I have run a couple of
 test scripts and everything works fine,
  but i can't get shell_exec to work. When i invoke shell_exec, the
 script doesn't get interpreted, instead
 i get prompted to download the whole .php file. I have tried both /bin/php
 and /bin/php-cgi- same problem.
 When i try to execute it per command line instead of web server, with both
 php and php-cgi i get Segmentation fault
 and nothing happens. I use busybox http as a web server, if it's relevant.
 Does anybody have an idea what the problem
 might be? Any help would be appreciated.

 Best regards,

 Boyan




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



RE: [PHP] How to code in PHP an onchange event in a select?

2010-11-04 Thread admin
OnChange is Javascript.

 

 

I might suggest you get yourself familiar with JQuery.

JQuery makes your life a lot easier when there is a need for client browser
interaction with site scripting.

 

 

 

 

Richard L. Buskirk

 

From: Tomás Corrales Lemoine [mailto:to...@hog.ecasa.avianet.cu] 
Sent: Thursday, November 04, 2010 4:23 PM
To: php-general@lists.php.net
Subject: [PHP] How to code in PHP an onchange event in a select?

 

Hi, List,

 

I have this two files (“index.php” and “include.php”). They both work fine,
but I want to substitute the code for de onchange event in the select tag.
Can I use PHP to code this event? How?

 

Thanks.

 

 

 

index.php:

 

?php

 

echo 'htmlbody';

 

include_once 'include.php';

 

$mysql_link = tcl_MySQL_ConnectToServer('localhost', 'user', 'password');

 

tcl_MySQL_OpenDataBase($mysql_link, 'production');

 

$query = 'SELECT DISTINCT recipe.product_id, product.description FROM
recipe, product WHERE recipe.product_id = product.product_id ORDER BY
product.description';

$result = tcl_MySQL_DataQuery($mysql_link, $query);

 

tcl_FillComboBox($result, 'Product', 'product_id', 'description',
'alert(\'Alert Message\')');

 

tcl_MySQL_CloseConnection($mysql_link);

 

echo '/body/html';

 

?

 

 

 

include.php:

 

?php

 

function tcl_MySQL_CloseConnection($link) {

  mysql_close($link);

}

 

function tcl_MySQL_ConnectToServer($host, $user, $password) {

  $link = mysql_connect($host, $user, $password);

  if (!$link) {

die('No se pudo conectar: '.mysql_error());

  }

  echo 'h3User '.strtoupper($user).' connected to MySQL server./h3';

  return $link;

}

 

function tcl_MySQL_DataQuery($link, $query) {

  return mysql_query($query, $link);

}

 

function tcl_MySQL_OpenDataBase($link, $database) {

  mysql_select_db($database, $link);

}

 

function tcl_FillComboBox($result, $label, $col1, $col2, $onchange) {

  echo 'label'.$label.'/labelselect
onchange='.$onchange.'option value=';

  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {

echo 'option value='.$line[$col1].''.$line[$col2];

  }

  echo '/select';

}

 

?

 


-- 
Aeropuerto Internacional Frank País García de Holguín. 



  1   2   3   >