Re: [PHP] PHP Question

2010-10-28 Thread Kevin Kinsey

Paulo Work wrote:

Hello, Paulo!


I am building a website with basic CMS functionality.
My problem is that in one of the pages I am using Easyslider to display 
small comments about the clients.


These comments are divided in 3 per slide.
ex:(li
pcomment 1/p
pcomment 1/p
pcomment 1/p
/li)

I am pulling the comments from the db and I would like to know if i can 
split that array in 3's (array_slice) perhaps?


My goal is to within a foreach loop output 3 comments within a 
slide(wrapped in li), so first 3 would output:


(li
pcomment 1/p
pcomment 2/p
pcomment 3/p
/li)
Then another 3


I'm a hacker, so this is a HACK:

?php

$data=(li
pcomment 1/p
pcomment 2/p
pcomment 3/p
/li);

$lines=explode(\n,$data);
array_shift($lines);
array_pop($lines);
print_r($lines);

?

I'll leave it to the big boys to debate and devise more elegant
solutions.

Kevin Kinsey

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



Re: [PHP] PHP Question

2010-10-28 Thread Jim Lucas
Paulo Work wrote:
 Hello my name is Paulo Carvalho and I am struggling with the following:
 
 I am building a website with basic CMS functionality.
 My problem is that in one of the pages I am using Easyslider to display
 small comments about the clients.
 
 These comments are divided in 3 per slide.
 ex:(li
 pcomment 1/p
 pcomment 1/p
 pcomment 1/p
 /li)
 
 Now I am struggling with the following:
 I am pulling the comments from the db and I would like to know if i can
 split that array in 3's (array_slice) perhaps?
 
 My goal is to within a foreach loop output 3 comments within a
 slide(wrapped in li), so first 3 would output:
 
 (li
 pcomment 1/p
 pcomment 2/p
 pcomment 3/p
 /li)
 Then another 3
 
 (li
 pcomment 4/p
 pcomment 5/p
 pcomment 6/p
 /li)
 Thank in advance for all the replies.
 Paulo carvalho
 

This looks like a job for modulo man.

I was hoping to simply give you a list of examples from google, but I couldn't
find any that showed exactly what you were trying to do, so... I wrote this
article for my site.  Let me know if you have any questions.

http://www.bendsource.com/phpModulo


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



Re: [PHP] [php] Question about jsmin-php code

2009-12-29 Thread Daniel Egeberg
On Tue, Dec 29, 2009 at 12:07, hack988 hack988 hack...@dev.htwap.com wrote:
 I have some question about code
 1.what is E_STRICT error level mean?I'm found an explain at
 http://www.php.net/manual/en/errorfunc.constants.php
 but i don't understand which situation need this level?

E_STRICT is an error level indicating that you are doing something
that will work, but is for whatever reason discouraged. An example
would be using var $foo; for class properties instead of using one
of the visibility keywords public/protected/private.

It's basically a way of telling you that you are doing something that
is considered bad practice.

 2.document for STDERR is at http://php.net/manual/en/wrappers.php.php
 but why it write some output to STDERR ?

The reason why one would want to write to STDERR (as opposed to
STDOUT) is if you are writing error messages. By standard on the
console, STDERR and STDOUT go the same place, but it's possible
redirecting both of these streams. If you redirect some output (STDOUT
specifically) to a file, you might still be interested in getting the
error messages on the screen.

See http://en.wikipedia.org/wiki/Standard_streams for more information
about that. Why your specific script would write to STDERR, I don't
know.

-- 
Daniel Egeberg

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



Re: [PHP] [php] question about ob_end_flush

2008-11-27 Thread Robert Cummings
On Fri, 2008-11-28 at 12:01 +0800, jason liang wrote:
 Hi all
 
 I am comfused about the function ob_end_flush.In the manual:This function
 will send the contents of the topmost output buffer (if any) and turn this
 output buffer off.
 
 i have made such tests.
 
 ?php
 ob_start();
 echo hello word!;
 ob_end_flush();
 ?
 this works alright.the script output hello world!.
 
 ?php
 ob_start();
 echo hello word!;
 ob_end_flush();

Right here you said to end the current buffer... which means the active
output buffer becomes the next outer one.

ob_clean();

Here you've told the current buffer to purge. So you've essentially
wiped everything that was flushed from the previous inner buffer to the
current buffer. So you see nothing. Why is there an outer buffer? You
probably have output buffering enabled in your php.ini (see
output_buffering in php.ini).

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



RE: [PHP] PHP Question

2004-12-15 Thread Jay Blanchard
[snip]
I am new to this languaue and need some info. I am not a programmer but
I need some info for a project I am working on. I have data in MS Access
and I want to create graphs and charts using this data to display on a
website. I read on your website PHP is able to do this.
 What do I need to know about setting this up?
 Do you reccommed MS Access or SQL for the database?
 Are there any special hardware I need?
 Once the program is written in PHP, How do I get this on the website?
[/snip]

You have asked a set of very broad questions, and you may not be able to
set it up without the assistance of a programmer.

 What do I need to know about setting this up?
Where do I start?

 Do you reccommed MS Access or SQL for the database?
It really doesn't matter unless you need a superior product.

 Are there any special hardware I need?
No, any server will usually do.

 Once the program is written in PHP, How do I get this on the website?
Place the PHP pages on the web server.

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



Re: [PHP] PHP Question

2004-12-15 Thread Jason Wong
On Wednesday 15 December 2004 21:29, Jay Blanchard wrote:

  Do you reccommed MS Access or SQL for the database?

 It really doesn't matter unless you need a superior product.

MS Access wasn't designed for concurrent access so if you are only serving 
*very* light loads it may suffice. If your aspirations are a bit higher (and 
_if_ you want to stick with MS) then MSSQL is the better choice.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*

It's a fixer-upper.  What's the problem?  We get a bunch of priests in 
here ...

  -- Homer Simpson
 Treehouse of Horror
*/

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


Re: [PHP] php question

2004-08-17 Thread Matthew Sims
 hello,
 I have a webpage which includes a frame containing a table made of 24
 tds which in turn contain little images. When the mouse clicks on a
 little image the appropriate larger image is loaded into an adjacent
 frame.
 Can somebody point me in the direction to do this in php without frames
 please ?

 I've been looking most of the day but I can't see it.

 regards

 mick

Not quite understanding this. You have a web page that when a thumbnail is
clicked, the larger image is displayed in the other frame. But you want to
remove the frames? Where would the image load then?

If you want it to load on the same page, just have the link refresh the
page to load the larger image.

Not sure what you're really asking.

-- 
--Matthew Sims
--http://killermookie.org

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



RE: [PHP] php question... opening external page/writing to it...

2003-06-23 Thread Sævar Öfjörð
I don't know if this is what you mean, but here is what you need to edit
files:

http://us2.php.net/manual/en/function.fopen.php
http://us2.php.net/manual/en/function.fwrite.php
http://us2.php.net/manual/en/function.fclose.php



-Original Message-
From: my [mailto:[EMAIL PROTECTED] 
Sent: 24. júní 2003 00:26
To: [EMAIL PROTECTED]
Subject: [PHP] php question... opening external page/writing to it...

Hey...

A quick question...

How can I do the following (I know it's simple..!!!)

All from the same page...

Do some processing...
Open an external page
Write some stuff to the external page...

The issue I seem to have is that if I open the external page during the
onload... it's not ready when I want to write the data

Any hints/comments/samples

Thanks...

Bruce
[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] php question... opening external page/writing to it...

2003-06-23 Thread my
sorry

to make it a little more clear...

I'd like the external page to be a separate web page...I'm using it to
simply write out some debug data on the fly

thanks

bruce


-Original Message-
From: Sævar Öfjörð [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 5:31 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] php question... opening external page/writing to
it...


I don't know if this is what you mean, but here is what you need to edit
files:

http://us2.php.net/manual/en/function.fopen.php
http://us2.php.net/manual/en/function.fwrite.php
http://us2.php.net/manual/en/function.fclose.php



-Original Message-
From: my [mailto:[EMAIL PROTECTED]
Sent: 24. júní 2003 00:26
To: [EMAIL PROTECTED]
Subject: [PHP] php question... opening external page/writing to it...

Hey...

A quick question...

How can I do the following (I know it's simple..!!!)

All from the same page...

Do some processing...
Open an external page
Write some stuff to the external page...

The issue I seem to have is that if I open the external page during the
onload... it's not ready when I want to write the data

Any hints/comments/samples

Thanks...

Bruce
[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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php question... opening external page/writing to it...

2003-06-23 Thread Justin French
on 24/06/03 10:26 AM, my ([EMAIL PROTECTED]) wrote:

 Do some processing...

easy :)

 Open an external page

I assume you mean open a window with another URL in it

 Write some stuff to the external page...

Wrong order...


1. do some processing (eg home.php)
2. open/create a file (eg debugger.php)
3. write to it during the processing of your page, save it
4. open the new window with the url of the debug file, most probably as a
onload javascript command.


 Any hints/comments/samples

Any coding examples you need will be in the manual pages and user comments
relating to fopen, fwrite, etc... read them and if you're STILL stuck, post
what code you have, and we can help more.

FWIW, this seems like too much work to me... I just debug IN my code, and
set a global config of $debug to true for development, and false for live
server, and do things like this:

if($debug) {
echo p class='error'Justin, you're an idiot: .mysql_error()./p;
}


Justin French
-
Indent.com.au
-
Graphic, Web  Information Design
Web Application Development
-
e: mailto:[EMAIL PROTECTED]
w: http://www.indent.com.au
t: 03 9531 4304 (+61 3 9531 4304)
m: 0414 243 462 (+61 414 243 462)
-


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



Re: [PHP] PHP question

2002-12-17 Thread Joseph W. Goff
You can set this up in the php.ini file in the /etc directory.
You can set php to run an any user and any group that you have set up on
your system.  Just make sure that you set permissions properly so that it
can function in the directories that it is accessed.
- Original Message -
From: Tom Ray [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 1:11 PM
Subject: [PHP] PHP question


 Are PHP script supposed to run as the user or as the web server?
 Currently I'm running Red Hat 7.3 with apache 1.3.x and all my PHP
 scripts run as apache, not as the user. I'm wonder if I can run the
 scripts as the user and how do I fix this?

 Any help would be great!


 --
 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 question

2002-12-17 Thread 1LT John W. Holmes
 Are PHP script supposed to run as the user or as the web server?
 Currently I'm running Red Hat 7.3 with apache 1.3.x and all my PHP
 scripts run as apache, not as the user. I'm wonder if I can run the
 scripts as the user and how do I fix this?

As a module, that's the way it is. I think you can install it as a CGI and
it'll run as the user.

---John Holmes...


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




Re: [PHP] PHP question

2002-12-17 Thread Joseph W. Goff
Actually, I was mistaken.  It isn't php.ini that has to be changed.  I
believe it is httpd.conf.
php runs as what ever the webserver is set up to run as.
- Original Message -
From: Joseph W. Goff [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]; Tom Ray
[EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 1:18 PM
Subject: Re: [PHP] PHP question


 You can set this up in the php.ini file in the /etc directory.
 You can set php to run an any user and any group that you have set up on
 your system.  Just make sure that you set permissions properly so that it
 can function in the directories that it is accessed.
 - Original Message -
 From: Tom Ray [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Tuesday, December 17, 2002 1:11 PM
 Subject: [PHP] PHP question


  Are PHP script supposed to run as the user or as the web server?
  Currently I'm running Red Hat 7.3 with apache 1.3.x and all my PHP
  scripts run as apache, not as the user. I'm wonder if I can run the
  scripts as the user and how do I fix this?
 
  Any help would be great!
 
 
  --
  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] PHP question

2002-12-17 Thread Sean Burlington
1LT John W. Holmes wrote:

Are PHP script supposed to run as the user or as the web server?
Currently I'm running Red Hat 7.3 with apache 1.3.x and all my PHP
scripts run as apache, not as the user. I'm wonder if I can run the
scripts as the user and how do I fix this?



As a module, that's the way it is. I think you can install it as a CGI and
it'll run as the user.




coments valid for apache/linux

if you run the module all the php scripts run as the user/group set in 
apache conf

if you run in cgi mode you can set a different user/group for each 
virtual host (running php in cgi mode is slower)

for security scripts should be run as a user with few system priveleges 
(ie the apache user)

--

Sean




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



RE: [PHP] php question

2002-10-02 Thread Ford, Mike [LSS]

 -Original Message-
 From: michael saxbury [mailto:[EMAIL PROTECTED]]
 Sent: 01 October 2002 22:57
 
 I am trying to understand in deatil exactly what PHP is, I 
 know that it is a 
 scripting markup type language, but.
 
 Is it correct to say that PHP is essentially just C++ code 
 wrapped in PHP 
 blocks which are embedded in HTML?

Good grief, no!

PHP syntax may be c-*like*, but it is definitely *not* c++.  There are many
important differences (some of them very subtle) that will reach out and
bite you if you think of it as c++.

PHP is itself, a separate and distinct language, and should not be thought
of in any other clothes...!!  Its original and principal use is as a
server-side scripting language, but it now has a command-line version, and
people have even played with active-scripting and (if I've read recent
postings right!) c-embedded versions.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] php question

2002-10-01 Thread John W. Holmes

 I am trying to understand in deatil exactly what PHP is, I know that
it is
 a
 scripting markup type language, but.
 
 Is it correct to say that PHP is essentially just C++ code wrapped in
PHP
 blocks which are embedded in HTML?

Well, more of a C/C++ syntax, actually. PHP has a lot of built in
functions that make it different from C/C++. But, yeah, in an extremely
broad manner, you could say that's what it is. The PHP code is evaluated
and ran on the server and the resulting HTML is sent to the client. Note
that you can't compile PHP, like C/C++.

---John Holmes...



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




Re: [PHP] php question

2002-10-01 Thread Brad Bonkoski

Of course compiled versus interpreted code is a pretty major difference, so
it would be hard for me to say it is like a compiled language like C/C++
just because is borrows some of the syntax.  I have seen only very generic
classifications, but IMHO I would lean more towards saying it is a scripting
language specifically written to act as a CGI web interface, as opposed to
molding a language like Perl to do CGI.  Of course those database specific
functions thrown in is always a huge plus!
(I often wonder how some of the originators would classify it?)
I guess that would be here:
http://www.php.net/manual/en/faq.general.php#faq.general.what

-Brad

John W. Holmes wrote:

  I am trying to understand in deatil exactly what PHP is, I know that
 it is
  a
  scripting markup type language, but.
 
  Is it correct to say that PHP is essentially just C++ code wrapped in
 PHP
  blocks which are embedded in HTML?

 Well, more of a C/C++ syntax, actually. PHP has a lot of built in
 functions that make it different from C/C++. But, yeah, in an extremely
 broad manner, you could say that's what it is. The PHP code is evaluated
 and ran on the server and the resulting HTML is sent to the client. Note
 that you can't compile PHP, like C/C++.

 ---John Holmes...

 --
 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 question regarding Cold Fusion

2002-01-12 Thread Wandrer

At 09:43 PM 1/11/02 -0500, you wrote:
The tag I am talking about is CFHTTP.  This tag allows you to emulate the
posting of a form, but also allows you to capture the results of the post.
There are a couple of forms written in CF that connect to the merchant
account, check a credit card, for example, and then wait for the
approval/denial response.
Is there anything in PHP that can do this same kind of thing?  Any help
would be appreciated.

Check out Snoopy - http://snoopy.sourceforge.net/



-- 
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] PHP question regarding Cold Fusion

2002-01-12 Thread [EMAIL PROTECTED]


I believe another option is the CURL library module for PHP.

see manual:

XII. CURL, Client URL Library Functions

bvr.

On Sat, 12 Jan 2002 09:01:39 -0500, Wandrer wrote:

At 09:43 PM 1/11/02 -0500, you wrote:
The tag I am talking about is CFHTTP.  This tag allows you to emulate the
posting of a form, but also allows you to capture the results of the post.
There are a couple of forms written in CF that connect to the merchant
account, check a credit card, for example, and then wait for the
approval/denial response.
Is there anything in PHP that can do this same kind of thing?  Any help
would be appreciated.

Check out Snoopy - http://snoopy.sourceforge.net/



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






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




Re: [PHP] PHP question regarding Cold Fusion

2002-01-11 Thread Rasmus Lerdorf

Google for something called PostToHost I wrote ages ago.  Lots of
variations of that around.  Basically you just fsockopen() to the site in
question and fputs() your request and POST data and then fgets() the
result.

-Rasmus

On Fri, 11 Jan 2002, Jeremy Reed wrote:

 Cold Fusion, as far as I'm concerned, stinks.  However, I have been involved
 in porting a website from Cold Fusion to PHP and during this
 transmogrification, I've come across something I'm not sure how to emulate
 in PHP.  Perhaps if there are any CF/PHP gurus out there, they can help me
 out.

 The tag I am talking about is CFHTTP.  This tag allows you to emulate the
 posting of a form, but also allows you to capture the results of the post.
 There are a couple of forms written in CF that connect to the merchant
 account, check a credit card, for example, and then wait for the
 approval/denial response.

 Is there anything in PHP that can do this same kind of thing?  Any help
 would be appreciated.

 Best regards,

 Jeremy Reed



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



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




Re: [PHP] PHP question regarding Cold Fusion

2002-01-11 Thread Philip Olson

On Fri, 11 Jan 2002, Rasmus Lerdorf wrote:
 Google for something called PostToHost I wrote ages ago.  Lots of
 variations of that around.  Basically you just fsockopen() to the site in
 question and fputs() your request and POST data and then fgets() the
 result.

With one variation being sendtohost()

  http://dodds.net/~cardinal/sendtohost.txt

regards,
Philip Olson


-- 
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]