php-general Digest 28 Dec 2008 11:54:49 -0000 Issue 5869

2008-12-28 Thread php-general-digest-help

php-general Digest 28 Dec 2008 11:54:49 - Issue 5869

Topics (messages 285110 through 285134):

Webhotel structure
285110 by: Nordstjernealle 10
285112 by: Daniel Brown
285116 by: Richard Heyes
285117 by: John Corry
285118 by: Dotan Cohen
285122 by: Carlos Medina
285131 by: Robert Cummings

Re: PHP script gives no output or error message
285111 by: John Musbach
285113 by: John Musbach

Re: PHP (under httpd) reading a file outside DocumentRoot?
285114 by: Jeff Weinberger

how to update PHP 5.2.6 to 5.2.8 under Fedora Redhat Linux 9
285115 by: Fred Silsbee

Is PHP truly faster on the JVM?
285119 by: John Papas
285124 by: Nathan Nobbe

Re: Decorator with public methods
285120 by: Nathan Nobbe
285121 by: Nathan Nobbe

Architecture patterns in PHP
285123 by: Michael C. Yates
285125 by: Daniel Brown
285126 by: Ashley Sheridan
285127 by: Michael C. Yates
285128 by: Nathan Nobbe
285130 by: Murray
285132 by: Larry Garfield
285133 by: Phpster

errors still being displayed even if variables in php.ini set to off
285129 by: Fred Silsbee
285134 by: Ashley Sheridan

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
Hi PHP experts

What is the overall structure on webhotels, how do I remove/clean everythink 
including everythinnk liek databases etc?

Sorry if this is not the proper news group for this question, please redirect 
me.
I am a newbie trying to make my osn webside with a minimum effort.

First I had a student to make some think for me, but he never finished it, so 
the useless remains are on my web.

My first plan was to use php gallery, but my web host surftown do not support 
safemode off.
So I found coppermine, surftown even support the install as one click.
First trial looked good, but then I ran into trouble, I get different error 
messages.

So I would prefer to remove everythink and start all over .



best regards

Peter Sørensen


---End Message---
---BeginMessage---
On Sat, Dec 27, 2008 at 15:27, Nordstjernealle 10
nordstjerneall...@gmail.com wrote:
 Hi PHP experts

 What is the overall structure on webhotels, how do I remove/clean everythink 
 including everythinnk liek databases etc?

 Sorry if this is not the proper news group for this question, please redirect 
 me.
 I am a newbie trying to make my osn webside with a minimum effort.

 First I had a student to make some think for me, but he never finished it, so 
 the useless remains are on my web.

 My first plan was to use php gallery, but my web host surftown do not support 
 safemode off.
 So I found coppermine, surftown even support the install as one click.
 First trial looked good, but then I ran into trouble, I get different error 
 messages.

 So I would prefer to remove everythink and start all over .

What?

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
---End Message---
---BeginMessage---
What?

Seconded. Are you talking about hosting?

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 20th)
---End Message---
---BeginMessage---
+1

Is it me or has the php mailing list kind of dumbed itself down in the
last 5 years?




What?

 --
 /Daniel P. Brown
 daniel.br...@parasane.net || danbr...@php.net
 http://www.parasane.net/ || http://www.pilotpig.net/
 Unadvertised dedicated server deals, too low to print - email me to find out!

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


---End Message---
---BeginMessage---
2008/12/27 Daniel Brown danbr...@php.net:
What?


What's not clear? He asked about webhotels, he obviously intends on
having extramarital cybersex.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
---End Message---
---BeginMessage---

Nordstjernealle 10 schrieb:

Hi PHP experts

What is the overall structure on webhotels, how do I remove/clean everythink 
including everythinnk liek databases etc?

Sorry if this is not the proper news group for this question, please redirect 
me.
I am a newbie trying to make my osn webside with a minimum effort.

First I had a student to make some 

Re: [PHP] errors still being displayed even if variables in php.ini set to off

2008-12-28 Thread Ashley Sheridan
On Sat, 2008-12-27 at 16:23 -0800, Fred Silsbee wrote:
 on page 1
 Notice: Undefined index: in C:\Inetpub\wwwroot\handle_log_book_MySQL.php on 
 line 71
 
 Notice: Undefined index: in C:\Inetpub\wwwroot\handle_log_book_MySQL.php on 
 line 72
 
 in php.ini:
 
 error_reporting  =  Off
 
 display_errors = Off (in 2 places)
 
 display_startup_errors = Off
 
 
 
 
 
   
 
 
What does phpinfo() tell you? Don't forget that there are several places
where this can be set; the php.ini file, the .htaccess file, and within
the PHP code itself. If phpinfo() tells you that both settings are for
errors off, then it's most likely that a line in your PHP code is
turning them back on


Ash
www.ashleysheridan.co.uk


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



[PHP] table mixing PHP, javascript, ajax and CSS

2008-12-28 Thread Alain Roger
Hi,

i'm currently working on some project which needs in several pages, a table
to display query results...till now nothing special.
however, in order to not create several time the table and features i've
decided to create my own templates including PHP classes, CSS and
javascript.

this table class should have filter, colors schemes, multi selection and
header/paging header.
I would like to know what are your suggestions, recommendations or tips to
have something easy to deploy and upgrade ?

i was thinking to have a common (framework) base : a simple html file having
3 divs, each div receiving a particular php file (header, pagin, or the
table itself)
header, paging or table PHP files could be located in some folder being
different for each template... main changes in templates are usually for the
table it self (in terms of columns amount, of presented data record,...)

basically my structure is the following one:
/folder_to_include_by_user_in_his_development_environment
   /templates
  /template1
 pager.php
 table.php
  /template2
 pager.php
 table.php
  header.php
   frame.php
   /class
  table_class.php
  helping_classes.php
  ...
   /js_and_ajax
 function.js

the user will have only to run a js function which will include the
frame.php file into his own webpage with the template given as parameter.

thx for any suggestion.

-- 
Alain
---
Windows XP x64 SP2 / Fedora 10 KDE 4.2
PostgreSQL 8.3.5 / MS SQL server 2005
Apache 2.2.10
PHP 5.2.6
C# 2005-2008


[PHP] turn shared hosting server to external image storage hosting

2008-12-28 Thread paragasu
do you have any idea how to do this. i have a small vps about 10GB
space. i live somewhere is south east asia where solutions like Amazon
S3 is incredibly slow. (500ms ping time).

i have a simple php gallery. But dedicated server is quite expensive
($100/month). searching around, i found several local hosting
companies provide a very cheap shared hosting. ($100 / year, 300GB).
local server with 40ms ping time.

i am interested to use that shared hosting just as storage for images
of my gallery and a cheap vps to store the database.

What is the best way for me to accomplish this? Amazon S3 using REST
etc. Is it possible to write a simple storage (REST system) like
amazon s3 in PHP? is there anyone wrote this before. I am interested
in your solutions..

thanks

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



Re: [PHP] table mixing PHP, javascript, ajax and CSS

2008-12-28 Thread Benjamin Hawkes-Lewis

On 28/12/08 13:33, Alain Roger wrote:


i'm currently working on some project which needs in several pages, a table
to display query results...till now nothing special.
however, in order to not create several time the table and features i've
decided to create my own templates including PHP classes, CSS and
javascript.

this table class should have filter, colors schemes, multi selection and
header/paging header.


An appropriate set of classes (data types, field names, even/odd 
designators for zebra styling) plus CSS is everything you need for color 
schemes.


Can you elaborate on what you mean by multi selection and paging header?


I would like to know what are your suggestions, recommendations or tips to
have something easy to deploy and upgrade ?


I'd look into:

http://developer.yahoo.com/yui/datatable/

It includes filtering.

I usually write my own code for generating raw table markup - that could 
be used by as a progressive enhancement by YUI datatable - with a 
minimum of repetition.


http://www.webaim.org/techniques/tables/data.php has information about 
what constitutes good markup for data tables.



i was thinking to have a common (framework) base : a simple html file having
3 divs, each div receiving a particular php file (header, pagin, or the
table itself)
header, paging or table PHP files could be located in some folder being
different for each template... main changes in templates are usually for the
table it self (in terms of columns amount, of presented data record,...)

the user will have only to run a js function which will include the
frame.php file into his own webpage with the template given as parameter.


The use of JS as an include mechanism is largely pernicious. Couldn't 
they just use include()?


--
Benjamin Hawkes-Lewis

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



[PHP] retrieve result of a query

2008-12-28 Thread Alain Roger
Hi,

basically i have a php file with several parameter received in GET or POST.
this PHP page execute a db query and should return a specific amount of
records and columns.

however i do not want to display those records like that...
i have a web page with javascript and the javascript should read those
records/quesry result and display them.

how can javascript read those result ?
i do not want php file to create a temporary file on server, i would like to
read those data on fly.
so how can i do that ? i mean how or what should i do from php side ?

thx.

-- 
Alain
---
Windows XP x64 SP2 / Fedora 10 KDE 4.2
PostgreSQL 8.3.5 / MS SQL server 2005
Apache 2.2.10
PHP 5.2.6
C# 2005-2008


Re: [PHP] retrieve result of a query

2008-12-28 Thread Thiago H. Pojda
You can return (echo) a JSON or a XML with those results.

That way it doesn't store the file anywhere. :)

(I'd go for JSON + jquery)

Regards,
Thiago Henrique Pojda


On Sun, Dec 28, 2008 at 11:32 AM, Alain Roger raf.n...@gmail.com wrote:
 Hi,

 basically i have a php file with several parameter received in GET or POST.
 this PHP page execute a db query and should return a specific amount of
 records and columns.

 however i do not want to display those records like that...
 i have a web page with javascript and the javascript should read those
 records/quesry result and display them.

 how can javascript read those result ?
 i do not want php file to create a temporary file on server, i would like to
 read those data on fly.
 so how can i do that ? i mean how or what should i do from php side ?

 thx.

 --
 Alain
 ---
 Windows XP x64 SP2 / Fedora 10 KDE 4.2
 PostgreSQL 8.3.5 / MS SQL server 2005
 Apache 2.2.10
 PHP 5.2.6
 C# 2005-2008


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



Re: [PHP] retrieve result of a query

2008-12-28 Thread Phpster
Ajax is what you need to look at. JS can certainly accept the data  
being posted back from the server.


Bastien

Sent from my iPod

On Dec 28, 2008, at 9:32 AM, Alain Roger raf.n...@gmail.com wrote:


Hi,

basically i have a php file with several parameter received in GET  
or POST.
this PHP page execute a db query and should return a specific amount  
of

records and columns.

however i do not want to display those records like that...
i have a web page with javascript and the javascript should read those
records/quesry result and display them.

how can javascript read those result ?
i do not want php file to create a temporary file on server, i would  
like to

read those data on fly.
so how can i do that ? i mean how or what should i do from php side ?

thx.

--
Alain
---
Windows XP x64 SP2 / Fedora 10 KDE 4.2
PostgreSQL 8.3.5 / MS SQL server 2005
Apache 2.2.10
PHP 5.2.6
C# 2005-2008


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



Re: [PHP] Read Form values prior to submit?

2008-12-28 Thread Thiago H. Pojda
On Sun, Dec 28, 2008 at 12:41 PM, Tim Rude tim_r...@yahoo.com wrote:
 Using PHP, is there a way for me to read the values that a user has
 entered into the text fields of a FORM prior to the user clicking the
 submit button?

If the user doesnt press the submit button PHP has no idea what's
going on there.

That's client-side and you should use JavaScript for that.

 Essentially what I want to do is make sure the user has filled in all
 three text fields on my form before allowing it to be submitted [to a
 third party website].

In case you have a specific business logic in that field and don't
want the user to know about it, you should use AJAX.

But this sounds simple, a small JS should help you.

The JS can submit the form, if it's okay. Or you can add a action to
form's onsubmit event. (you can return false if the validation
fails).

Hope this helps!

Regards,
Thiago Henrique Pojda
nerdnaweb.blogspot DOT com

 --

 Tim Rude [PHP newbie]



 --
 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] errors still being displayed even if variables in php.ini set to off

2008-12-28 Thread tedd

At 4:23 PM -0800 12/27/08, Fred Silsbee wrote:

on page 1
Notice: Undefined index: in 
C:\Inetpub\wwwroot\handle_log_book_MySQL.php on line 71


Notice: Undefined index: in 
C:\Inetpub\wwwroot\handle_log_book_MySQL.php on line 72


in php.ini:

error_reporting  =  Off

display_errors = Off (in 2 places)

display_startup_errors = Off



Try:

error_reporting(0);

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] What does ?xml have to do with it?

2008-12-28 Thread tedd

Hi gang:

I have a small php routine to provide the user with a style choice. 
The working url is here:


http://php1.net/a1/david/

The simple code that allows style switching follows:

?php session_start();
$the_style = isset($_SESSION['the_style']) ? $_SESSION['the_style'] : 'style1';

if(isset($_GET['set']))
   {
   $set = $_GET['set'];
   if($set == 'style1')
  {
  $the_style = 'style1.css';
  }
   else
  {
  $the_style = 'style2.css';
  }
   $_SESSION['the_style'] = $the_style;
   }

$the_style = $_SESSION['the_style'];
?

As you can see, the code works. However, if I add the following line 
IN THE HTML (i.e., after ?):


?xml version=1.0 encoding=UTF-8 ?

I receive a:

Parse error: syntax error, unexpected T_STRING

What's up with that? Apparently the php interpreter is considering 
?xml tag as a php declaration -- how do I turn that off? Or is 
this something else?


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



Re: [PHP] What does ?xml have to do with it?

2008-12-28 Thread Jim Lucas
tedd wrote:
 Hi gang:
 
 I have a small php routine to provide the user with a style choice. The
 working url is here:
 
 http://php1.net/a1/david/
 
 The simple code that allows style switching follows:
 
 ?php session_start();
 $the_style = isset($_SESSION['the_style']) ? $_SESSION['the_style'] :
 'style1';
 
 if(isset($_GET['set']))
{
$set = $_GET['set'];
if($set == 'style1')
   {
   $the_style = 'style1.css';
   }
else
   {
   $the_style = 'style2.css';
   }
$_SESSION['the_style'] = $the_style;
}
 
 $the_style = $_SESSION['the_style'];
 ?
 
 As you can see, the code works. However, if I add the following line IN
 THE HTML (i.e., after ?):
 
 ?xml version=1.0 encoding=UTF-8 ?
 
 I receive a:
 
 Parse error: syntax error, unexpected T_STRING
 
 What's up with that? Apparently the php interpreter is considering
 ?xml tag as a php declaration -- how do I turn that off? Or is this
 something else?
 
 Cheers,
 
 tedd
 

short tags are enabled.  Disable them in your php.ini file and you will be good.

-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME

2008-12-28 Thread tedd

At 7:31 PM +0200 12/27/08, Dotan Cohen wrote:

Is there a compelling reason to use either REQUEST_URI or SCRIPT_NAME
in the action of a form that I want to submit to the same URL that it
came from (the script parses whether or not there is a Submit to know
if it should display the form or the results). I need a portable
solution, that is why I am not hardcoding it. Also, the users _may_
save the form to their hard drives, so simply leaving the action blank
will not do.

I know that REQUEST_URI includes the ?variable=value string and that
SCRIPT_NAME does not. This form does not depend upon get variables, so
this should never be an issue, but I ask here anyway to know if there
are other differences that I did not account for.

Thanks!

--
Dotan Cohen



Dotan:

Maybe this is too simple, but what I do is to leave the form 
attribute action= blank.


My understanding (may be wrong) is that forms always submit to 
themselves unless directed to do so otherwise.


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



Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME

2008-12-28 Thread Dotan Cohen
2008/12/28 tedd tedd.sperl...@gmail.com:
 Dotan:

 Maybe this is too simple, but what I do is to leave the form attribute
 action= blank.

 My understanding (may be wrong) is that forms always submit to themselves
 unless directed to do so otherwise.

 Cheers,

 tedd


Thanks, Tedd. That approach seems a bit dangerous for non-standard
browsers such as mobile phones and the like who's developers might not
have though about it. Also, in the event that a user saves the form
locally (likely in this case) I need it to have a place to go!

Thanks!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü


Re: [PHP] Read Form values prior to submit?

2008-12-28 Thread tedd

At 9:41 AM -0600 12/28/08, Tim Rude wrote:

Using PHP, is there a way for me to read the values that a user has
entered into the text fields of a FORM prior to the user clicking the
submit button?

Essentially what I want to do is make sure the user has filled in all
three text fields on my form before allowing it to be submitted [to a
third party website].

--

Tim Rude [PHP newbie]


Tim:

Can not do that using php. Php is server-side and hasn't a clue as to 
what the user is doing until the user clicks the submit.


If you want to check for user input in real-time, then you'll have to 
do that client-side with javascript.


Here's an example:

http://webbytedd.com/c/form-submit/

All the code is there -- use as you may.

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



Re: [PHP] What does ?xml have to do with it?

2008-12-28 Thread Daniel Brown
On Sun, Dec 28, 2008 at 11:47, Jim Lucas li...@cmsws.com wrote:

 short tags are enabled.  Disable them in your php.ini file and you will be 
 good.

Correct.  It's shared hosting, so short_open_tags is on for
compatibility's sake.  That's on one of my servers, so let me know if
you need a hand, Tedd.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] Webhotel structure

2008-12-28 Thread tedd

At 10:03 PM -0500 12/27/08, Robert Cummings wrote:

On Sat, 2008-12-27 at 15:54 -0500, John Corry wrote:

 +1


  Is it me or has the php mailing list kind of dumbed itself down in the

 last 5 years?


Hey, that's almost as long as I've been here...

*blink* ... *blink* *blink*

:O

Cheers,
Rob.



Oddly enough, that's what I was thinking. I know that Rob hasn't 
dumbed the list down but I, on the other hand, may be in some minor 
way responsible for causing list to dwell on the obvious more often.


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



Re: [PHP] Webhotel structure

2008-12-28 Thread tedd

At 3:36 PM -0500 12/27/08, Daniel Brown wrote:

On Sat, Dec 27, 2008 at 15:27, Nordstjernealle 10
nordstjerneall...@gmail.com wrote:

 Hi PHP experts

 What is the overall structure on webhotels, how do I remove/clean 
everythink including everythinnk liek databases etc?


 Sorry if this is not the proper news group for this question, 
please redirect me.

 I am a newbie trying to make my osn webside with a minimum effort.

 First I had a student to make some think for me, but he never 
finished it, so the useless remains are on my web.


 My first plan was to use php gallery, but my web host surftown do 
not support safemode off.

 So I found coppermine, surftown even support the install as one click.
 First trial looked good, but then I ran into trouble, I get 
different error messages.


 So I would prefer to remove everythink and start all over .


What?


Daniel:

He's talking about everythink. Whenever I do that, I have problems too.

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



Re: [PHP] Online Members

2008-12-28 Thread tedd

At 12:07 PM -0500 12/27/08, Daniel Brown wrote:

Check the archives and STFW for examples, but the general gist is
of it is to use $_SESSION tracking with activity checking.  I'm just
typing this in quickly as I go, so it's untested (read: don't copy and
paste for production), but here's a simple example (you should be able
to fill in the blanks easily):


-snip code-

Neat -- thanks.

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

2008-12-28 Thread Nordstjernealle 10



Hi Carlos and what people

Thank for trying to help.

As I said Im a newbie or rather total beginner in the web territory
My webhotel is surftown starter (I paid for 5 years long ago before the 
price went up so I do not want to change.

I got a domain attached.

The surftown webserver runs linux has 10GB space and
Linux Webhotel STARTER
PHP Safe Mode On
Sun ASP, PHP4 , PHP5
MySQL 5.0 databaser
phpMyAdmin
PostgreSQL 7.4 databaser
phpPgAdmin
FTP accounts
Webalizer  Modlogan statistik
1click Toolbox installation
Your own CGI-scripts

It also has mail support , but I do not plan to use that, and I am pretty 
sure it has not been configured.


I tryed Surftowns help and wiki offcourse, but did not find any usefull 
info about the overall structure.
Is it possible to see what is running on my web hotel like SQL databases + 
?

Is there somethink like windows taskmanager or linux ps command?


Yes then I properly want to start all over and delete everythink including 
databases and what else could be running?
Problem is a student tryed to set up my web and do not know what he has 
installed and why features he has started.
After clearing everythink I will install the php program coppermine, due 
to safe mode on I can not use the Gallery.
Coppermine is a one click install on surftown, I have tryed but get a 
number of different errors, so I want to start over from a clean web 
instead of finding that the problems relate to the unknown code from the 
student.


I guess I just have to delete all files below my domain name and 
stop/delete any database I can find, but is that all or could there be 
other thinks I have heard off?


best regards
Peter Sørensen




- Original Message - 
From: Carlos Medina i...@simply-networks.de

Newsgroups: php.general
To: php-general@lists.php.net
Sent: Sunday, December 28, 2008 12:22 AM
Subject: Re: Webhotel structure



Nordstjernealle 10 schrieb:

Hi PHP experts

What is the overall structure on webhotels, how do I remove/clean 
everythink including everythinnk liek databases etc?


Sorry if this is not the proper news group for this question, please 
redirect me.

I am a newbie trying to make my osn webside with a minimum effort.

First I had a student to make some think for me, but he never finished 
it, so the useless remains are on my web.


My first plan was to use php gallery, but my web host surftown do not 
support safemode off.

So I found coppermine, surftown even support the install as one click.
First trial looked good, but then I ran into trouble, I get different 
error messages.


So I would prefer to remove everythink and start all over .



best regards

Peter Sørensen




Hallo Peter,
i think i understand what you mean (again: i think) but i am not really 
sure to understand what you need.

You need some Support on PHP? and when yes, by what?
When you dont need support for PHP please tell us, what you are looking 
for? Do you need Suport for coppermine? then look here 
http://documentation.coppermine-gallery.net/en/languages.htm
You want remove all the Application on your server and you dont know how? 
What is your System, where ist Your Server System?
Do you need some Support from PHP programmer? Please contact me then :-) 
(reply only to me then)



Regards

Carlos Medina







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



[PHP] Problem with fetching values...

2008-12-28 Thread Michelle Konzack
Hello,

I have to code a compatibility  layer  under  PHP5  for  PostgreSQl  and
MySQL, which mean, I have to code something like db_query()  which  then
can be used with mysql_query() and pg_query().

But now I have hit an weird error, since in PostgreSQL it is wotking but
in MySQL it get the right number of values but NO the value itself.

I use:

[ '~/.tdphp-vserver/includes/database_mysql.inc' ]--
snip
} elseif (DB_TYPE == 'mysql') {

  function db_connect($host=DB_HOST, $port=DB_PORT, $database=DB_NAME, 
$user=DB_USER, $pass=DB_PASS, $link='db_link') {
global $$link;
$$link=mysql_connect($host . ':' . $port, $user, $pass);
if (!$$link) { db_error($query, '', mysql_error()); }
$tmp=mysql_select_db($database, $$link);
  if (!$tmp) { db_error($query, '', mysql_error()); }
return $$link;
  }

  function db_close($link='db_link') {
global $$link;
return mysql_close($link);
  }

  function db_error($query, $errno, $error) {
die(FONT size=\+2\ color=\red\BError $errno/B/FONTHR 
size=\+3\ noshade$errorP$query);
  }

  function db_query($query) {
global $$link;
$result=mysql_query($query) or db_error($query, '', mysql_error($$link));
return $result;
  }

  function db_fetch_array($db_query) {
return mysql_fetch_array($db_query, MYSQL_NUM);
  }

  function db_free_result($db_query) {
return mysql_free_result($db_query);
  }

  function db_fetch_fields($db_query) {
return mysql_fetch_fields($db_query);
  }

  function db_input($string) {
return mysql_real_escape_string($string);
  }


and the code which produce the error is:

[ '~/.tdphp-vserver/includes/10_electronica_admin.inc' ]
snip
function setupOverviewProjects($type='projects') {
  if ($type == 'sub_projects') {
$VAL1=Current Sub-Projects;
$VAL2=sub_projects;
  } else {
$VAL1=Current Main-Projects;
$VAL2=projects;
  }

  $output  = div class=\setupOverviewBorder\\n;
  $output .= div class=\setupOverviewTitle\ . T_gettext($VAL1) . 
/div\n;
  $output .= br /\n;
  $output .=   ol class=\setupOverviewNameList\\n;

  $DB_connect=db_connect()
or die('Could not connect: ' . db_error());

  $DB_query='SELECT serno,name,desc_short FROM ' . $VAL2 . ' ORDER BY serno';
  $DB_result=db_query($DB_query, $DB_connect)
or die('Query failed: ' . db_error());

  while ($DB_list=db_fetch_array($DB_result)) {
$output .= lia href=\/?what=adminwhere= . $VAL2 . 
action=editserno=$DB_list[serno]referer= . urlencode(http://; . 
$_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']) . \span 
class=\setupOverviewName\Argh...  . $DB_list['name'] . /span/a;
if ($_COOKIE[$VAL2 . '_desc_short'] == 'show') {
  $output .= dt / . $DB_list['desc_short'];
}
$output .= /li\n;
  }

  db_free_result($DB_result);
  db_close($DB_connect);


and then I get in the Webpage something like:

[ STDIN ]---
Current Main-Projects

   1. Argh...
   2. Argh...
   3. Argh...
   4. Argh...
   5. Argh...
   6. Argh...
   7. Argh...
   8. Argh...
   9. Argh...
  10. Argh...

Add new Project | Show short describtion


which mean, the db_fetch_array() give the right number of  entries  back
since it count up to 10, but it can not get the value $DB_list['name'].

The SQL data for the this part is:

[ '~/BACKUPS/electronica.sql']--
snip
--
-- Tabellenstruktur fÃŒr Tabelle `projects`
--

CREATE TABLE `projects` (
  `serno` bigint(20) unsigned NOT NULL auto_increment,
  `active` int(11) NOT NULL default '0',
  `name` varchar(50) collate latin1_german2_ci NOT NULL,
  `desc_short` varchar(250) collate latin1_german2_ci NOT NULL,
  `desc_long` varchar(16000) collate latin1_german2_ci NOT NULL,
  `sub_projects` varchar(1000) collate latin1_german2_ci default NULL,
  `photos` varchar(1000) collate latin1_german2_ci default NULL,
  PRIMARY KEY  (`serno`),
  UNIQUE KEY `serno` (`serno`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci 
AUTO_INCREMENT=11 ;

--
-- Daten fÃŒr Tabelle `projects`
--

INSERT INTO `projects` VALUES (1, 0, '24V DC Modular ATX PSU', 'foo', '', '', 
'');
INSERT INTO `projects` VALUES (2, 0, '24V DC Modular Solar-Wind-Charger and 
Distributor', 'foo', '', '', '');
INSERT INTO `projects` VALUES (3, 0, '24V DC Multichemistry Charger', 'foo', 
'', '', '');
INSERT INTO `projects` VALUES (4, 0, 'GSM Modem', 'foo', '', '', '');
INSERT INTO `projects` VALUES (5, 0, 'GSM Router', 'foo', '', '', '');
INSERT INTO `projects` VALUES (6, 0, 'Outdoor HandBag TablePC', 'foo', '', '', 
'');
INSERT INTO `projects` VALUES (7, 0, 'Industrial TablePC', 'foo', '', '', '');
INSERT INTO `projects` VALUES (8, 0, 'MicroPC', 'foo', '', '', '');
INSERT INTO 

Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME

2008-12-28 Thread tedd

At 6:59 PM +0200 12/28/08, Dotan Cohen wrote:

2008/12/28 tedd tedd.sperl...@gmail.com:

 Dotan:

 Maybe this is too simple, but what I do is to leave the form attribute
 action= blank.

 My understanding (may be wrong) is that forms always submit to themselves
 unless directed to do so otherwise.

 Cheers,

 tedd



Thanks, Tedd. That approach seems a bit dangerous for non-standard
browsers such as mobile phones and the like who's developers might not
have though about it. Also, in the event that a user saves the form
locally (likely in this case) I need it to have a place to go!

Thanks!

--
Dotan Cohen



Dotan:

Sometimes the simplest is the best, but you might try this:

action=?php echo basename($_SERVER['SCRIPT_NAME']) ;?

At least you can say it's not as simple.  :-)

As for saving a form locally, then you'll have to get the entire url. 
Here's a less than simple solution:


function selfURL()
   {
   $s = empty($_SERVER[HTTPS]) ? '' : ($_SERVER[HTTPS] == on) ? s : ;
   $protocol = strleft(strtolower($_SERVER[SERVER_PROTOCOL]), /).$s;
   $port = ($_SERVER[SERVER_PORT] == 80) ?  : 
(:.$_SERVER[SERVER_PORT]);
   return 
$protocol.://.$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];

   }

function strleft($s1, $s2)
   {
   return substr($s1, 0, strpos($s1, $s2));
   }

It works.

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] is_readable(http://.... text file) says not, but I can in browser

2008-12-28 Thread John Allsopp

Hi

I'm sure this is simple for yous all but I'm not sure I know the answer.

   $myFileLast = http://www.myDomain.com/text.txt;;
   if (is_readable($myFileLast))
   {
   $fh = fopen($myFileLast, 'r');
   $theDataLast = fread($fh, 200);
   fclose($fh);
   echo (The dataLast: .$theDataLast.br\n);
   } else
   {
   echo (Last fix file unavailable: $myFileLastbr\n);
   }

returns Last fix file unavailable even for a file that my browser can 
read. All I want to do is skip over files


This could be a very simple error, I'd appreciate a pointer. Is it 
permissions being different for PHP versus the browser or something? PHP 
is running on a different server.


Cheers
J



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



Re: [PHP] What does ?xml have to do with it?

2008-12-28 Thread Benjamin Hawkes-Lewis

On 28/12/08 16:47, Jim Lucas wrote:

short tags are enabled.  Disable them in your php.ini file and you will be good.


Alternately:

?php
echo '?xml version=1.0 encoding=UTF-8 ?';
?

--
Benjamin Hawkes-Lewis


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



Re: [PHP] errors still being displayed even if variables in php.ini set to off

2008-12-28 Thread Fred Silsbee



--- On Sun, 12/28/08, Ashley Sheridan a...@ashleysheridan.co.uk wrote:

 From: Ashley Sheridan a...@ashleysheridan.co.uk
 Subject: Re: [PHP] errors still being displayed even if variables in php.ini 
 set to off
 To: fredsils...@yahoo.com
 Cc: php-general@lists.php.net
 Date: Sunday, December 28, 2008, 12:01 PM
 On Sat, 2008-12-27 at 16:23 -0800, Fred Silsbee wrote:
  on page 1
  Notice: Undefined index: in
 C:\Inetpub\wwwroot\handle_log_book_MySQL.php on
 line 71
  
  Notice: Undefined index: in
 C:\Inetpub\wwwroot\handle_log_book_MySQL.php on
 line 72
  
  in php.ini:
  
  error_reporting  =  Off
  
  display_errors = Off (in 2 places)
  
  display_startup_errors = Off
  
  
  
  
  

  
  
 What does phpinfo() tell you? Don't forget that there
 are several places
 where this can be set; the php.ini file, the .htaccess
 file, and within
 the PHP code itself. If phpinfo() tells you that both
 settings are for
 errors off, then it's most likely that a line in your
 PHP code is
 turning them back on
 
 
 Ash
 www.ashleysheridan.co.uk

sincere thanks mate...I'm sure there is a good reason for having flags all over 
the place somewhat mislabelled or ill described in the php.ini

Surely I thought there'd be a master-turn off all the  errors!

The php.ini describes good sense security know how in affirming the need for 
no errors!

here in the colonies I have become addicted to Eastenders on tonight at 10 pm

Here in Houston...should the program ever get messed up somehow, there are 
hundreds of calls, emails, bottle throwing, diesel locos being overturned

Bennie Hill should have been knighted!!!

sure and you'd be goin for a pint uf the dark


  


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



Re: [PHP] What does ?xml have to do with it?

2008-12-28 Thread Yeti
I think it can also be set in .htaccess

php_flag short_open_tag off

somebody confirm this or not.

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



[PHP] system() Question

2008-12-28 Thread Ryan O'Sullivan
Hello all,

I am using system to convert some files using a binary in linux.  My code 
looks like this:
 $response = system('gpsbabel -p  -r -t -i gpx -f test.gpx -o kml -F 
test2.kml', $retval);
 echo pResponse: , $response, /ppReturn Value: , $retval;

The $retval is returning code 127 - Any ideas on why this?

Thanks! 



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



Re: [PHP] What does ?xml have to do with it?

2008-12-28 Thread Ashley Sheridan
On Sun, 2008-12-28 at 11:40 -0500, tedd wrote:
 Hi gang:
 
 I have a small php routine to provide the user with a style choice. 
 The working url is here:
 
 http://php1.net/a1/david/
 
 The simple code that allows style switching follows:
 
 ?php session_start();
 $the_style = isset($_SESSION['the_style']) ? $_SESSION['the_style'] : 
 'style1';
 
 if(isset($_GET['set']))
 {
 $set = $_GET['set'];
 if($set == 'style1')
{
$the_style = 'style1.css';
}
 else
{
$the_style = 'style2.css';
}
 $_SESSION['the_style'] = $the_style;
 }
 
 $the_style = $_SESSION['the_style'];
 ?
 
 As you can see, the code works. However, if I add the following line 
 IN THE HTML (i.e., after ?):
 
 ?xml version=1.0 encoding=UTF-8 ?
 
 I receive a:
 
 Parse error: syntax error, unexpected T_STRING
 
 What's up with that? Apparently the php interpreter is considering 
 ?xml tag as a php declaration -- how do I turn that off? Or is 
 this something else?
 
 Cheers,
 
 tedd
 
 -- 
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com
 
Sounds like you have short tags turned on in your php.ini. Search the
php.ini file for short tags (possibly short_tags) and make sure it is
set to off. Note however, that if you have an older app, it may require
these types of PHP tags to function. In that case, you could use an echo
(or print) as the last line of PHP and output the line of XML you need
instead of putting it as standard output after the ? closing tag for
the PHP.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME

2008-12-28 Thread Ashley Sheridan
On Sun, 2008-12-28 at 18:59 +0200, Dotan Cohen wrote:
 2008/12/28 tedd tedd.sperl...@gmail.com:
  Dotan:
 
  Maybe this is too simple, but what I do is to leave the form attribute
  action= blank.
 
  My understanding (may be wrong) is that forms always submit to themselves
  unless directed to do so otherwise.
 
  Cheers,
 
  tedd
 
 
 Thanks, Tedd. That approach seems a bit dangerous for non-standard
 browsers such as mobile phones and the like who's developers might not
 have though about it. Also, in the event that a user saves the form
 locally (likely in this case) I need it to have a place to go!
 
 Thanks!
 
It's standard form behaviour that the attribute defaults to itself if
not set. If it doesn't work with some browsers, then it's more a case of
bad browser than anything. 


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 12:40 PM, Ryan O'Sullivan r...@rynet.com wrote:

 Hello all,

 I am using system to convert some files using a binary in linux.  My code
 looks like this:
 $response = system('gpsbabel -p  -r -t -i gpx -f test.gpx -o kml -F
 test2.kml', $retval);
 echo pResponse: , $response, /ppReturn Value: , $retval;

 The $retval is returning code 127 - Any ideas on why 
 this?http://www.php.net/unsub.php


you might try shell_exec() instead to see if you can get any more mileage.
the return value of shell_exec() is the output of the executed command.

-nathan


Re: [PHP] Architecture patterns in PHP

2008-12-28 Thread Michael C. Yates

Nathan Nobbe wrote:




Hey,

How do you structure your web applications? I am thinking in terms of 
separating presentation  and logic. How is that done in PHP?


mvc is pretty popular, but php is so flexible you often don't need it 
for smaller applications.


For example, if you take a page-controller approach, a php app is dead 
simple.  You have a seperate entery point for evrything; login.php, 
register.php, etc could be considered controllers, then all your common 
logic comes in via some includes, hopefully files outside the webroot.  
then you have some template directory w/ files that are a mixture of php 
and html(for example).  your 'controller' files include the library 
code, hit the db (if necc.) and then stuff data into the templates for 
output.


if you want to see an exmple if a more traditional mvc there are scads 
of open source frameworks out there which use a front controller 
approach. Code igniter is really straight forward, you can probly learn 
quickly from it.





Thanks for the reply.

Does anyone know of a good written guide about patterns like Front 
controller, Page Controller, MVC etc. and how they are implemented in PHP?


I found something about these patterns in a guide on MSDN called 
Enterprise Solution Patterns Using Microsoft .NET 
(http://msdn.microsoft.com/library/ms998516(en-us).aspx).


It describes MVC, Page Controller, Front Controller and a lot of other 
patterns for ASP.NET applications.


Something like this for PHP would be cool.


Thanks

Michael C. Yates


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



Re: [PHP] Architecture patterns in PHP

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 3:29 PM, Michael C. Yates quw...@gmail.com wrote:

 Nathan Nobbe wrote:



  Hey,

 How do you structure your web applications? I am thinking in terms of
 separating presentation  and logic. How is that done in PHP?


 mvc is pretty popular, but php is so flexible you often don't need it for
 smaller applications.

 For example, if you take a page-controller approach, a php app is dead
 simple.  You have a seperate entery point for evrything; login.php,
 register.php, etc could be considered controllers, then all your common
 logic comes in via some includes, hopefully files outside the webroot.  then
 you have some template directory w/ files that are a mixture of php and
 html(for example).  your 'controller' files include the library code, hit
 the db (if necc.) and then stuff data into the templates for output.

 if you want to see an exmple if a more traditional mvc there are scads of
 open source frameworks out there which use a front controller approach. Code
 igniter is really straight forward, you can probly learn quickly from it.



 Thanks for the reply.

 Does anyone know of a good written guide about patterns like Front
 controller, Page Controller, MVC etc. and how they are implemented in PHP?

 I found something about these patterns in a guide on MSDN called Enterprise
 Solution Patterns Using Microsoft .NET (
 http://msdn.microsoft.com/library/ms998516(en-us).aspxhttp://msdn.microsoft.com/library/ms998516%28en-us%29.aspx
 ).

 It describes MVC, Page Controller, Front Controller and a lot of other
 patterns for ASP.NET applications.

 Something like this for PHP would be cool.


i used to be a pretty big fan of
http://www.phppatterns.com
its a bit dusty (not updated in years) but a lot of the material is still
relevant, its free, and imo a great starting point.

also, google is your friend ;)

-nathan


Re: [PHP] Read Form values prior to submit?

2008-12-28 Thread Tim Rude
Thanks! I haven't played with javascript but it looks pretty
straight-forward. I appreciate the samples.

Tim Rude

-- 

tedd tedd.sperl...@gmail.com wrote in message
news:p06240817c57d610ba...@[192.168.1.101]...
 At 9:41 AM -0600 12/28/08, Tim Rude wrote:
 Using PHP, is there a way for me to read the values that a user has
 entered into the text fields of a FORM prior to the user clicking
the
 submit button?
 
 Essentially what I want to do is make sure the user has filled in all
 three text fields on my form before allowing it to be submitted [to a
 third party website].
 
 --
 
 Tim Rude [PHP newbie]

 Tim:

 Can not do that using php. Php is server-side and hasn't a clue as to
 what the user is doing until the user clicks the submit.

 If you want to check for user input in real-time, then you'll have to
 do that client-side with javascript.

 Here's an example:

 http://webbytedd.com/c/form-submit/

 All the code is there -- use as you may.

 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



Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 11:02 AM, John Allsopp j...@johnallsopp.co.ukwrote:

 Hi

 I'm sure this is simple for yous all but I'm not sure I know the answer.

   $myFileLast = http://www.myDomain.com/text.txt;;
   if (is_readable($myFileLast))
   {
   $fh = fopen($myFileLast, 'r');
   $theDataLast = fread($fh, 200);
   fclose($fh);
   echo (The dataLast: .$theDataLast.br\n);
   } else
   {
   echo (Last fix file unavailable: $myFileLastbr\n);
   }

 returns Last fix file unavailable even for a file that my browser can read.
 All I want to do is skip over files

 This could be a very simple error, I'd appreciate a pointer. Is it
 permissions being different for PHP versus the browser or something? PHP is
 running on a different server.


are you basically trying to tell if theres a resource @ the given url?  if
so, id prefer curl myself.

something like

if(($ch = curl_init($url) === false)
  echo (Last fix file unavailable: $myFileLastbr\n);
else {
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);*
*  $theDataLast = curl_exec($ch);
  echo (The dataLast: .$theDataLast.br\n);*
*  curl_close($ch);*
*}

obviously, youll need the curl extension installed for this to work.  i know
the fopen wrappers will allow you to get a read-only handle to an http url,
but im not sure what is_readable() will do w/ that, it may be limited to the
local filesystem.

-nathan


Re: [PHP] system() Question

2008-12-28 Thread Rick Pasotto
On Sun, Dec 28, 2008 at 12:40 PM, Ryan O'Sullivan r...@rynet.com wrote:

 Hello all,

 I am using system to convert some files using a binary in linux.  My code
 looks like this:
 $response = system('gpsbabel -p  -r -t -i gpx -f test.gpx -o kml -F 
 test2.kml', $retval);
 echo pResponse: , $response, /ppReturn Value: , $retval;

 The $retval is returning code 127 - Any ideas on why this?

You overlooked the ampersand in front of $retval. The syntax for
'system' is:

string system  ( string $command  [, int $return_var  ] )

You have to pass a pointer to the variable, not the variable itself.

-- 
Paper has a genius for multiplication that cannot be equaled anywhere
 else in nature. -- Hugh Keenleyside
Rick Pasottor...@niof.nethttp://www.niof.net

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



Re: [PHP] Problem with fetching values...

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 10:41 AM, Michelle Konzack 
linux4miche...@tamay-dogan.net wrote:

 Hello,

 I have to code a compatibility  layer  under  PHP5  for  PostgreSQl  and
 MySQL, which mean, I have to code something like db_query()  which  then
 can be used with mysql_query() and pg_query().


OK.  i would stop right there and ask yourself why..  there are tons of
stable, working solutions out there that already do this, most notably for
php5, PDO,

http://us.php.net/manual/en/pdo.drivers.php

which btw, is written in C ;)

-nathan


Re: [PHP] Architecture patterns in PHP

2008-12-28 Thread Phpster
The pup architect framework Book on zend also has excellent detail on  
the mvc pattern


Bastien

Sent from my iPod

On Dec 28, 2008, at 5:38 PM, Nathan Nobbe quickshif...@gmail.com  
wrote:


On Sun, Dec 28, 2008 at 3:29 PM, Michael C. Yates quw...@gmail.com  
wrote:



Nathan Nobbe wrote:




Hey,


How do you structure your web applications? I am thinking in  
terms of

separating presentation  and logic. How is that done in PHP?



mvc is pretty popular, but php is so flexible you often don't need  
it for

smaller applications.

For example, if you take a page-controller approach, a php app is  
dead

simple.  You have a seperate entery point for evrything; login.php,
register.php, etc could be considered controllers, then all your  
common
logic comes in via some includes, hopefully files outside the  
webroot.  then
you have some template directory w/ files that are a mixture of  
php and
html(for example).  your 'controller' files include the library  
code, hit

the db (if necc.) and then stuff data into the templates for output.

if you want to see an exmple if a more traditional mvc there are  
scads of
open source frameworks out there which use a front controller  
approach. Code
igniter is really straight forward, you can probly learn quickly  
from it.





Thanks for the reply.

Does anyone know of a good written guide about patterns like Front
controller, Page Controller, MVC etc. and how they are implemented  
in PHP?


I found something about these patterns in a guide on MSDN called  
Enterprise

Solution Patterns Using Microsoft .NET (
http://msdn.microsoft.com/library/ms998516(en-us).aspxhttp://msdn.microsoft.com/library/ms998516%28en-us%29.aspx 


).

It describes MVC, Page Controller, Front Controller and a lot of  
other

patterns for ASP.NET applications.

Something like this for PHP would be cool.



i used to be a pretty big fan of
http://www.phppatterns.com
its a bit dusty (not updated in years) but a lot of the material is  
still

relevant, its free, and imo a great starting point.

also, google is your friend ;)

-nathan


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



Re: [PHP] What does ?xml have to do with it?

2008-12-28 Thread tedd

At 6:06 PM + 12/28/08, Benjamin Hawkes-Lewis wrote:

On 28/12/08 16:47, Jim Lucas wrote:
short tags are enabled.  Disable them in your php.ini file and you 
will be good.


Alternately:

?php
echo '?xml version=1.0 encoding=UTF-8 ?';
?

--
Benjamin Hawkes-Lewis


Bingo -- we have a winner!

Thanks Benjamin -- that works without me having to fix the short tag 
in the php init file, which I'm really fuzzy about doing anyway.


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



Re: [PHP] system() Question

2008-12-28 Thread Daniel Brown
On Sun, Dec 28, 2008 at 18:10, Rick Pasotto r...@niof.net wrote:

 You overlooked the ampersand in front of $retval. The syntax for
 'system' is:

 string system  ( string $command  [, int $return_var  ] )

 You have to pass a pointer to the variable, not the variable itself.

Actually, that's not entirely correct while the documentation
shows it as a reference variable, it's not actually required to be a
pointer.  And in either case, the OP had the error code returned
(127), and $retval would have nothing to do with causing the error.

What I would recommend trying is:

?php
exec('./gpsbabel -p  -r -t -i gpx -f test.gpx -o kml -F
test2.kml 21',$ret);
print_r($ret);
?

On a side note, I'm curious as to what 'gpsbabel' does.  I've
worked a bit with Keyhole markups and GIS overlays, etc.  Neat stuff.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2008-12-28 Thread Daniel Brown
On Sun, Dec 28, 2008 at 13:02, John Allsopp j...@johnallsopp.co.uk wrote:

   $myFileLast = http://www.myDomain.com/text.txt;;
   if (is_readable($myFileLast))
   {
   $fh = fopen($myFileLast, 'r');
   $theDataLast = fread($fh, 200);
   fclose($fh);
   echo (The dataLast: .$theDataLast.br\n);
   } else
   {
   echo (Last fix file unavailable: $myFileLastbr\n);
   }

Simplified:

?php
$myFileLast = http://www.myDomain.com/text.txt;;
$theDataLast = file_get_contents($myFileLast);
?

You can manipulate the code as you see fit.  If it doesn't work,
then check your php.ini file (if you have access) to ensure that you
have this line:

allow_url_fopen = On

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 6:49 PM, Daniel Brown danbr...@php.net wrote:

 On Sun, Dec 28, 2008 at 18:10, Rick Pasotto r...@niof.net wrote:
 
  You overlooked the ampersand in front of $retval. The syntax for
  'system' is:
 
  string system  ( string $command  [, int $return_var  ] )
 
  You have to pass a pointer to the variable, not the variable itself.

 Actually, that's not entirely correct while the documentation
 shows it as a reference variable, it's not actually required to be a
 pointer.


good point dan, and just to add further clarification, thats b/c the
function specifies $return_var is passed by reference in the formal
parameter.  when you include the  along w/ an actual parameter (during
function invocation) thats referred to as call-time-pass-by-reference in
php, and its typically frowned upon.  in fact, i think its being removed
from a future version of php.

-nathan


[PHP] Re: Read Form values prior to submit?

2008-12-28 Thread Manuel Lemos
Hello,

on 12/28/2008 01:41 PM Tim Rude said the following:
 Using PHP, is there a way for me to read the values that a user has
 entered into the text fields of a FORM prior to the user clicking the
 submit button?
 
 Essentially what I want to do is make sure the user has filled in all
 three text fields on my form before allowing it to be submitted [to a
 third party website].

You may want to try this forms generation and validation class. It can
perform both server side and browser side validations by generating the
necessary Javascript (so you do not have to learn it too much) using a
single definition of the validations you want.

http://www.phpclasses.org/formsgeneration

Here is a live demo form:

http://www.meta-language.net/forms-examples.html?example=test_form


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: turn shared hosting server to external image storage hosting

2008-12-28 Thread Manuel Lemos
Hello,

on 12/28/2008 11:37 AM paragasu said the following:
 do you have any idea how to do this. i have a small vps about 10GB
 space. i live somewhere is south east asia where solutions like Amazon
 S3 is incredibly slow. (500ms ping time).
 
 i have a simple php gallery. But dedicated server is quite expensive
 ($100/month). searching around, i found several local hosting
 companies provide a very cheap shared hosting. ($100 / year, 300GB).
 local server with 40ms ping time.
 
 i am interested to use that shared hosting just as storage for images
 of my gallery and a cheap vps to store the database.
 
 What is the best way for me to accomplish this? Amazon S3 using REST
 etc. Is it possible to write a simple storage (REST system) like
 amazon s3 in PHP? is there anyone wrote this before. I am interested
 in your solutions..

Amazon released a CDN (Content Delivery Network) that expands S3 to
serve files closer to different world regions.

http://aws.amazon.com/cloudfront/

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] turn shared hosting server to external image storage hosting

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 6:37 AM, paragasu parag...@gmail.com wrote:

 do you have any idea how to do this. i have a small vps about 10GB
 space. i live somewhere is south east asia where solutions like Amazon
 S3 is incredibly slow. (500ms ping time).

 i have a simple php gallery. But dedicated server is quite expensive
 ($100/month). searching around, i found several local hosting
 companies provide a very cheap shared hosting. ($100 / year, 300GB).
 local server with 40ms ping time.

 i am interested to use that shared hosting just as storage for images
 of my gallery and a cheap vps to store the database.

 What is the best way for me to accomplish this? Amazon S3 using REST
 etc. Is it possible to write a simple storage (REST system) like
 amazon s3 in PHP? is there anyone wrote this before. I am interested
 in your solutions..


have you tried photobucket ?  we have an api in php which is freely
available and we use a CDN for caching all around the globe.  in fact, id be
interested to find out how it stacks up over there, in your neck of the
woods.

-nathan


Re: [PHP] system() Question

2008-12-28 Thread Micah Gersten
Nathan Nobbe wrote:
 good point dan, and just to add further clarification, thats b/c the
 function specifies $return_var is passed by reference in the formal
 parameter.  when you include the  along w/ an actual parameter (during
 function invocation) thats referred to as call-time-pass-by-reference in
 php, and its typically frowned upon.  in fact, i think its being removed
 from a future version of php.

 -nathan

   
You don't call system using the ampersand.  The reference is declared in
the function definition.  There's no reason for this to be frowned
upon.   What you are referring to is the old PHP4 style of explicit
pass-by-reference in function usage which is frowned upon.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com


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



Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten mi...@onshore.com wrote:

 Nathan Nobbe wrote:
  good point dan, and just to add further clarification, thats b/c the
  function specifies $return_var is passed by reference in the formal
  parameter.  when you include the  along w/ an actual parameter (during
  function invocation) thats referred to as call-time-pass-by-reference in
  php, and its typically frowned upon.  in fact, i think its being removed
  from a future version of php.
 
  -nathan
 
 
 You don't call system using the ampersand.  The reference is declared in
 the function definition.  There's no reason for this to be frowned
 upon.


well i dont think they deprecated it for shits--giggles.

http://us.php.net/manual/en/language.references.pass.php

its disabled by default in php.ini; wonder why.. ;)


   What you are referring to is the old PHP4 style of explicit
 pass-by-reference in function usage which is frowned upon.


no im referring to call-time-pass by reference, which works just as well in
php5; as long as you enable it in php.ini (or one of the other various
ways).

and also, for clarification, marking parameters as pass-by-reference works
during method definition in php4 as well, of course.

-nathan


[PHP] Re: Architecture patterns in PHP

2008-12-28 Thread Manuel Lemos
Hello,

on 12/27/2008 09:40 PM Michael C. Yates said the following:
 How do you structure your web applications? I am thinking in terms of
 separating presentation  and logic. How is that done in PHP? And how
 many architecture patterns are there?

I use the Use Case Mapping as methodology to implement Web applications
in PHP since 1999 .

It does not mean that this is necessarily the best Web development
methodology, nor that you could not use another methodology that you may
prefer.

It is a methodology that I have been using for developing PHP Web
applications with very satisfactory productivity results. I have been
using it since 1999, when Object Oriented Programming support was added
to PHP 3. Over time, it has been refined to address better the real
world needs of sites of growing complexity.

This methodology has been used extensively to develop busy sites like
the PHPClasses repository. Therefore, it has proven to be suitable to
develop enterprise grade Web applications. It does not impose
excessively complex development procedures. So, it is also suitable for
developing small Web applications.

You may want to read this document that explains what are use cases in
the scope of a well structured project and the methodology that
describes how map use cases to PHP code for Web applications.

http://www.meta-language.net/metastorage-example.html


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Architecture patterns in PHP

2008-12-28 Thread Carlos Medina

Manuel Lemos schrieb:

Hello,

on 12/27/2008 09:40 PM Michael C. Yates said the following:

How do you structure your web applications? I am thinking in terms of
separating presentation  and logic. How is that done in PHP? And how
many architecture patterns are there?


I use the Use Case Mapping as methodology to implement Web applications
in PHP since 1999 .

It does not mean that this is necessarily the best Web development
methodology, nor that you could not use another methodology that you may
prefer.

It is a methodology that I have been using for developing PHP Web
applications with very satisfactory productivity results. I have been
using it since 1999, when Object Oriented Programming support was added
to PHP 3. Over time, it has been refined to address better the real
world needs of sites of growing complexity.

This methodology has been used extensively to develop busy sites like
the PHPClasses repository. Therefore, it has proven to be suitable to
develop enterprise grade Web applications. It does not impose
excessively complex development procedures. So, it is also suitable for
developing small Web applications.

You may want to read this document that explains what are use cases in
the scope of a well structured project and the methodology that
describes how map use cases to PHP code for Web applications.

http://www.meta-language.net/metastorage-example.html




Hi all,
I can not understand what is the Target of this question like 
Architecture Patterns in PHP. This is for me like the question, what 
is your favorite IDE. If i need to know about design Patterns in PHP, 
then i can buy a book about it or i search the Internet for my information.


Regards

Carlos

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



Re: [PHP] Re: Architecture patterns in PHP

2008-12-28 Thread Nathan Nobbe
On Mon, Dec 29, 2008 at 12:01 AM, Carlos Medina i...@simply-networks.dewrote:

 Manuel Lemos schrieb:

 Hello,

 on 12/27/2008 09:40 PM Michael C. Yates said the following:

 How do you structure your web applications? I am thinking in terms of
 separating presentation  and logic. How is that done in PHP? And how
 many architecture patterns are there?


 I use the Use Case Mapping as methodology to implement Web applications
 in PHP since 1999 .

 It does not mean that this is necessarily the best Web development
 methodology, nor that you could not use another methodology that you may
 prefer.

 It is a methodology that I have been using for developing PHP Web
 applications with very satisfactory productivity results. I have been
 using it since 1999, when Object Oriented Programming support was added
 to PHP 3. Over time, it has been refined to address better the real
 world needs of sites of growing complexity.

 This methodology has been used extensively to develop busy sites like
 the PHPClasses repository. Therefore, it has proven to be suitable to
 develop enterprise grade Web applications. It does not impose
 excessively complex development procedures. So, it is also suitable for
 developing small Web applications.

 You may want to read this document that explains what are use cases in
 the scope of a well structured project and the methodology that
 describes how map use cases to PHP code for Web applications.

 http://www.meta-language.net/metastorage-example.html



 Hi all,
 I can not understand what is the Target of this question like Architecture
 Patterns in PHP. This is for me like the question, what is your favorite
 IDE. If i need to know about design Patterns in PHP, then i can buy a book
 about it or i search the Internet for my information.


i find this list to me a most excellent supplement to these other resources,
in fact in many ways its often times better.

this topic is no less relevant than most ive seen since ive joined the list,
which most likely is the reason for the several long, well thought
responses.

-nathan

-nathan


RE: [PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-28 Thread ceo

File a bug report at

http://bugs.php.net



You have a pretty clear-cut case of a built-in function gone awry, and it will 
probably be fixed pretty fast.



I also rely on this function quite a bit, so it needs to work right when I end 
up at 5.2.8 some day :-)







From: Ben Stuyts [...@altesco.nl]

Sent: Sunday, December 21, 2008 7:12 AM

To: Manuel Lemos

Cc: php-general@lists.php.net

Subject: Re: [PHP] Re: imap_rfc822_parse_adrlist problem



Hi,



On 21 dec 2008, at 03:41, Manuel Lemos wrote:



 on 12/20/2008 09:34 PM Ben Stuyts said the following:

 Hi,



 Since upgrading to php 5.2.8 I have a problem with

 imap_rfc822_parse_adrlist. When I run the example given on the manual

 page at http://nl3.php.net/imap_rfc822_parse_adrlist:

 ...

 So the host part isn't filled in correctly. I have verified this on

 two

 FreeBSD 7 machines. On an older FreeBSD 5 machine with php4 this

 works

 fine. Before the update, I was running php 5.2.6 and there was no

 problem either. Any ideas?



 Sometime ago I decided to not use IMAP library functions to parse e-

 mail

 addresses because it was not handling all sorts of addresses as it

 should.



Well, yeah, ok, I read about the problems imap_rfc822_parse_adrlist()

has, but shouldn't it just work at least as advertized in the manual?

Plus, this is breaking an existing application (Twiggi).



 Nowadays I use an e-mail address parser class written in pure PHP that

 comes with this MIME parser class:



 http://www.phpclasses.org/mimeparser



Thanks, I'll have a look at that.



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