php-general Digest 6 Sep 2003 14:36:28 -0000 Issue 2281

Topics (messages 161839 through 161857):

Re: Notices - Variable not defined
        161839 by: John W. Holmes
        161841 by: Leonie

Planning a project with PHP.
        161840 by: Info.Best-IT
        161845 by: Raditha Dissanayake
        161852 by: Leonie

Re: Too Advanced? Re: Cookies & Hidden Image
        161842 by: Nicole
        161843 by: John W. Holmes
        161844 by: Mark Charette

simple Apache question I'm sure
        161846 by: Paul O'Neil
        161855 by: David Otton

Re: Opening Zip Files in Linux
        161847 by: Raditha Dissanayake

Database updation
        161848 by: Uma Shankari T.
        161849 by: Raditha Dissanayake

client certs (how to)
        161850 by: Scott

[Newbie Guide] For the benefit of new members
        161851 by: tech.leatherlink.net

module.so and php-directory!!!
        161853 by: m n

Get particular section structure of message
        161854 by: myhan

Re: Maximum amount of variables in a session?
        161856 by: David Otton

Re: PHP code generation
        161857 by: Marek Kilimajer

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Leonie wrote:

I have this code:

 if (!$path) {
  $path = getPath();
 }

Sometimes $path is set (there are forms on the page that can change it).
When the page is first displayed:

Notice: Undefined variable: path in e:\program/  etc...
It then gives a reference to the line:   if (!$path) {

Is there a way to get rid of this annoying notice?

if(!isset($path)) { $path = getPath(); }

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Wow!  That's service!  Thank you.

Leonie

--- End Message ---
--- Begin Message ---
I am building a project where I plan to build a site with PHP.  Right now I
have organized it with the following:

Page objects ­ format and layout of the pages
Functional Objects ­ Database querys
Data objects ­ objects that hold data specific to the object type.
Scripts ­ scripts called to instantiate objects, and run the site.

That is my high level plan.  Is this a decent approach?  Or should I
structure it differently at this level.  I need to make sure this site is
secure, so certain pages cannot be directly accessed (not sure how to do
that).  I am looking to make the structure simple to manage the complexity
of the data flow.  

Any ideas how to best manage projects in PHP?  Išve seen object oriented PHP
sites and totally scripted (procedural) sites.  But I am confused which
would be better.

/T


--- End Message ---
--- Begin Message --- Hi,

Just a personal opinion only: If you are a die hard OO fan. you are better of with J2EE. If you were brought up on C, think linux is the best thing that ever happened to computers, welcome to the world of PHP.

best regards
raditha

[EMAIL PROTECTED] wrote:

I am building a project where I plan to build a site with PHP.  Right now I
have organized it with the following:

Page objects ­ format and layout of the pages
Functional Objects ­ Database querys
Data objects ­ objects that hold data specific to the object type.
Scripts ­ scripts called to instantiate objects, and run the site.

That is my high level plan. Is this a decent approach? Or should I
structure it differently at this level. I need to make sure this site is
secure, so certain pages cannot be directly accessed (not sure how to do
that). I am looking to make the structure simple to manage the complexity
of the data flow.


Any ideas how to best manage projects in PHP?  Išve seen object oriented PHP
sites and totally scripted (procedural) sites.  But I am confused which
would be better.

/T






--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
Have you checked out the code libraries at PEAR?

It is all OO and includes templates for separating code from presentation.
I think its pretty cool.

http://www.pear.php.net/

You might also like to check this out with the folks at another forum on
news.php.net:
        php.pear.general

I think you will find what you are looking for there.

Regards
Leonie

--- End Message ---
--- Begin Message ---
Thanks. The cookie sets fine using the redirect. The problem is accessing
the cookie when the script is called via the image tag. If the script is
called directly, the cookie is accessible.

http://trackerurl/blahblah/script.php    --- called directly can see the
Cookie

<img src=http://trackerurl/blahblah/script.php height=1 width=1>    --- does
not see the Cookie

Not sure what else to do other than try something different. Using Cookie
seems to be the only way to store the value on the client side for later
retrieval.

Thanks,

Nicole

"Diego Fulgueira" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nothing is too advanced for this newgroup and there is not other better. I
> did not read your problem very carefully, but I think you are trying to
set
> a cookie on a page that does a redirect, that is just impossible unless
you
> do the redirect with a meta tag on the client.
>
> Anyway, if that suggestion doesn't do it for you, I once used the
following
> function to set cookies and it worked for me:
>
> function MySetCookie
> ($CkyName, $CkyVal, $exp, $pth, $Domain)
> {
>  $exp = strftime("%A, %d-%b-%Y %H:%M:%S", $exp);
>  $cookiestr = sprintf ("%s=%s; domain=%s; path=%s; expires=%s",
>  $CkyName, $CkyVal, $Domain, $pth, $exp);
>  $mycky = (isset($mycky) ? "$mycky\n" : "")."Set-Cookie: $cookiestr";
>  header($mycky);
> }
>
>
> Cheers,
> Diego
>
> ----- Original Message -----
> From: "Nicole" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 03, 2003 3:57 PM
> Subject: [PHP] Too Advanced? Re: Cookies & Hidden Image
>
>
> > Is this question too advanced for this newsgroup? Is there a better
> > newsgroup to post this one too?
> >
> > Thanks,
> >
> > --
> > Nicole
> >
> >
> > "Nicole" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi,
> > >
> > > I am working on a script that uses cookie to store some info on the
> client
> > > side.  The user will click a link that contains info about where the
> link
> > > was placed. The script will then store that info so that when the user
> > > returns later and makes a purchase, I can see where they came from.
> > >
> > > The problem I am having is this:
> > >
> > > The link is a redirect url that first goes to one domain where the
> cookie
> > is
> > > created by. Then they are taken to the site where products are sold.
> > >
> > > Then, after they make a purchase, they are taken to a thank you page
> that
> > > has a hidden tracker to track that sale.
> > >
> > > <img src=http://trackerurl.com/?var=1&var=2&blahbla height=0 width=>
> > >
> > > The image loads the script from a different domain (where the cookie
was
> > > initialy created by).  The problem now is that the script gets a blank
> > > cookie when using the hidden image to load the script.
> > >
> > > So does anyone know why this is happening?
> > >
> > > I have   setCookie('CookieName', $value, $expires);
> > >
> > > Then I try to retrieve that cookie again later with
> > $_COOKIE['CookieName']
> > > ... but the value stored is not there when the script is called from
the
> > > hidden image.  HOWEVER, the value is there when the script is called
> > > directly.
> > >
> > > Any ideas?
> > >
> > > Thanks!!
> > >
> > > Nicole
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

--- End Message ---
--- Begin Message --- Nicole wrote:

Not sure what else to do other than try something different. Using Cookie
seems to be the only way to store the value on the client side for later
retrieval.

How about using a session and passing the session ID in the URL for the cookie?


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
> From: Nicole [mailto:[EMAIL PROTECTED]
>
> Thanks. The cookie sets fine using the redirect. The problem is accessing
> the cookie when the script is called via the image tag. If the script is
> called directly, the cookie is accessible.

Images have their own connection (which is why you can see a page before an
image is downloaded, and why pages resize if width & height are not set on
the image). Cookie values via images are not "passed to parent", though
judicious use of javascript _may_ be able to retrieve the value - I've not
seen it done, but it _might_ be possible, though I doubt it.

It's not a "PHP" thing, it's an HTML protocol thing ...

--- End Message ---
--- Begin Message ---
This is more Apache related but I have a php/apache config'd box at home I
want to test stuff out on before uploading to a public server. Every
directory except wwwroot dir I must place a '/' after the dir name to get a
listing such as http:://192.168.1.1/mydirectory will not load the index.php
file until I type in the '/' like so http://192.168.1.1/mydirectory/ what
gives?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003

--- End Message ---
--- Begin Message ---
On Fri, 5 Sep 2003 20:30:22 -0700, you wrote:

>This is more Apache related but I have a php/apache config'd box at home I
>want to test stuff out on before uploading to a public server. Every
>directory except wwwroot dir I must place a '/' after the dir name to get a
>listing such as http:://192.168.1.1/mydirectory will not load the index.php
>file until I type in the '/' like so http://192.168.1.1/mydirectory/ what
>gives?

[Assuming that "::" is a typo]

"http://192.168.1.1/mydirectory"; is an invalid URL - that resource doesn't
exist on that server.

When a server receives a request for "http://example.com/some/dir";, instead
of throwing a 404 error it politely issues a 301 (Moved Permanently),
telling the browser to go to "http://example.com/some/dir/"; instead.

The "example.com" bit is taken from httpd.conf. Look for the line:

ServerName example.com

to modify.

Your request for "http://192.168.1.1/mydirectory"; is being 301'd into
"http://example.com/mydirectory/";

This is why leaving training a '/' off a URL is a bad idea, even though it
appears to work - it causes a second HTTP roundtrip before you get your
file.

--- End Message ---
--- Begin Message --- make sure it's (unzip) patched there was a recent security issue with unzip. You can get the latest RPM from redhat. Otherwise someone might upload a zip file and get control of your server :-)



Richard D. Marriner II wrote:

Umm, I believe somebody already answered...
unzip is what you need...


----- Original Message ----- From: "John Ryan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 05, 2003 4:00 PM
Subject: [PHP] Re: Opening Zip Files in Linux





ive spent the last 2 hours looking for a solution. i was going to


recompile


php with zip support for one file. THANK YOU!
"John Herren" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


John Ryan wrote:


This is kinda off topic, well.. depending on the answer.

I downloaded a ZIP file to my server, and want to open it. My version


of


PHP


wasnt compiled with the Zip uncompressing functions, otherwise Id do


it


with


php, so I was wondering if there was a linux-x86 binary that just


opens


zip


files????!


Try unzip :)


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







--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---

Hello,

  I am running mysql from my hard disk..i am trying to write some contents 
while during running in to the database the values are not getting 
updated..it is not giving any error message also..i am running apache and 
php from the CD itself..is it necessary that the php and apache should 
also run from the hard disk then only mysql database will get updated ?? 
can any one please suggest me..

Regards,
Uma

--- End Message ---
--- Begin Message --- Hi,

What do you mean running from the cd? are you using something like knoppix? The log directory for both apache and mysql definitely needs to be writable not to mention the data dir for mysql.
Have you tried running your query from the mysql command line client?




Uma Shankari T. wrote:

Hello,

I am running mysql from my hard disk..i am trying to write some contents while during running in to the database the values are not getting updated..it is not giving any error message also..i am running apache and php from the CD itself..is it necessary that the php and apache should also run from the hard disk then only mysql database will get updated ?? can any one please suggest me..

Regards,
Uma





--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
Hello,

I am trying to post to a site that requires me to use a client cert.  I can
get it to work for both windows and unix, but only on the command line.  I
have tried without success to use the PHP built-in methods for doing this.
Here is the command line that works:

curl -d "<myxml>" -k -E myCert.pem:myPassword
https://www.mysite.com/Listener.exe

Any ideas of how to make this work with the curl_setopt methods?  I tried
variations of this:

        $ch = curl_init();
        curl_setopt ($ch, CURLOPT_URL, $url);
        curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 2);
        curl_setopt ($ch, CURLOPT_SSLKEY, 'myCert.pem');
        curl_setopt ($ch, CURLOPT_SSLKEYPASSWD, 'myPassword');

        $result = curl_exec ($ch);
Plus where does the data go?  I know there is the POST_FIELDS option but I
have XML.  Any thoughts?

Thanks,
Scott

--- End Message ---
--- Begin Message ---
=========================================================
This message is for the benefit of new subscribers and those new to PHP.  
Those who  do not want to be bothered just filter out the [Newbie Guide] 
mails. Please feel free to add more points and send to the list.
==========================================================
1. If you have any queries/problems about PHP try http://www.php.net/manual/en 
first. You can download a copy and use it offline also.

2. If you can not get answer here try http://www.google.com next. Try 
searching for "php YOUR QUERY" and you may be lucky to get an answer within 
the first 10 results.

3. Glancing through the list archive at 
http://marc.theaimsgroup.com/?l=php-general , you can find many of the 
common topics discussed repeatedly and can get your answer from those 
discussions. 

4. If you are stuck with a script and do not understand what is wrong, instead 
of posting the whole script, try doing some research yourself. One useful 
trick is to print the variable/sql query using print or echo command and 
check whether you get what you expected. 

After diagnosing the problem, send the details of your efforts (following 
steps 1, 2 & 3) and ask for help.

5. Provide a clear descriptive subject line. Avoid general subjects like 
"Help!!", "A Question" etc.  Especially avoid blank subjects. 

6. When you want to start a new topic, open a new mail and enter the mailing 
list address [EMAIL PROTECTED] instead of replying to an existing 
thread and replacing the subject and body with your message.

7. PHP is a server side scripting language. Whatever processing PHP does takes 
place BEFORE the output reaches the client. Therefore, it is not possible to 
access the users'  computer related information (OS, screen size etc) using 
PHP. You need to go for JavaScript and ask the question in a JavaScript 
list.

8. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. [contribued by Chris W Parker]

9. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with PHP.

Best regards,

-- 
Ma Siva Kumar,
================================================
INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY
BSG LeatherLink,
Chennai.
Ph: +91 44 55191757
URL : http://www.leatherlink.net

--- End Message ---
--- Begin Message ---
Hi!!
 
I have writen a php_module.so but i havent access right to move my
module to the php-directory!!
Is the any other way to load php_module!!!
 
BR
 

--- End Message ---
--- Begin Message ---
I make a function to fetch the structure of a particulat section of a
message,
and I test it with some special mails and it works well.
But for I am not so familiar with mime-types, I need more suggest and help.

    function getCurrentStruct($pi_msgid, $ps_part=1)
    {
        //$o_struct = $this->getStructure($pi_msgid);
        $o_struct = imap_fetchstructure($mbox, $pi_msgid);
        //$ps_part is a string like "4.3.3"
        if (!array_key_exists("parts", get_object_vars($o_struct))) {
            //$this->pushError("No such part");
            //call imap_errors() and return the last error
            return new PEAR_Error($this->getError());
        }
        foreach (explode(".", $ps_part) as $i) {
            if (!array_key_exists("parts", get_object_vars($o_struct)) ||
!is_array($o_struct->parts)) {
                return new PEAR_Error("No such part");
            }
            $a_tmp = $o_struct->parts;
            if ($a_tmp[0]->type == 1) { // &&
(strtoupper($a_tmp[0]->subtype)=="MIXED") {
                $a_tmp = $a_tmp[0]->parts;
            }
            $o_struct = $a_tmp[$i-1];
        }
        return $o_struct;
    }

--- End Message ---
--- Begin Message ---
On Fri, 5 Sep 2003 14:40:39 -0700, you wrote:

> I am creating a project for a web hosting control panel and just wondering
>if there is a limit to the amount of variables I can store in a session?  If
>I have too many variables will it create an uneccassary strain on my server?
>What is an average amount of variables that a session should have.
>
>I have a good knowledge of basic PHP but have never worked with sessions
>before.  This project is a learning project and a project because I have yet
>to find what I'm looking for in hosting control panels.

AFAIK, PHP places no constraint on the amount of data stored in a session.

However as with any program, if you use lots of system resources you will
run into OS constraints, or reduce overall system performance.

--- End Message ---
--- Begin Message --- I think http://www.meta-language.net/ might be something similar.

Chris Hubbard wrote:

No, not random character generation.

Currently the application I'm working does the following:
1.  from an array that defines HTML components (like a table row, input
field, file upload, etc), and,
2.  from an array that defines PHP components (like sql queries, file
upload, assigning values to variables, etc), and,
3.  a library of HTML components (like the HTML to display; a table row, a
search box, a text area, etc),
4.  take all three of the above and do a (fairly) complex suite of
str_replaces and then file writes, output .php and .tpl files, resulting in
a (hopefully) functional application.

Primary advantage:
as the application developer (as distinct from the code generation
developer), you only have to build arrays.  The arrays can be built from
HTML forms, or XML, or ...?

Secondary advantage:
if you need to build multiple instances of the application with minor
changes, it's trivial to build and maintain.

Tertiary advantage:
you have a common "framework" (though not technically a framework) for all
deployed applications.  It's relatively easy to "upgrade" the applications,
or swap out sections of the code with improved code.

chris



-----Original Message-----
From: Scott Fletcher [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 9:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: PHP code generation


What are the example of code generation project? Are you referring to the generation of the random characters?

"Chris Hubbard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

I'm working on a code generation project.  Is there anyone on the list who
has experience building these things, and, would like to discuss
architecture/patterns/structure of code generation off-list?


Chris Hubbard [EMAIL PROTECTED] www.wildcharacters.com 425 481 2020

php based web application development

Y! [EMAIL PROTECTED]
MSN [EMAIL PROTECTED]
AIM ganeshacph


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


--- End Message ---

Reply via email to