php-general Digest 17 Oct 2004 16:31:34 -0000 Issue 3058

Topics (messages 199652 through 199666):

Re: Best way to figure out whether a query returns RESULT or NON-RESULT
        199652 by: Karam Chand

Re: guessing timezone based on country/state/city
        199653 by: Curt Zirzow

Re: Is there a way to...
        199654 by: raditha dissanayake
        199658 by: M Saleh EG
        199662 by: S. Daurer

mod-rewrite
        199655 by: Pete
        199656 by: Pete
        199659 by: John Nichel
        199664 by: M Saleh EG
        199665 by: John Nichel

PHP5 and Multi Inheritance?
        199657 by: M Saleh EG
        199661 by: Matthew Weier O'Phinney
        199663 by: M Saleh EG

php installation
        199660 by: alagu raj

Tempnam not working??
        199666 by: Brent Clements

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 ---
Thanks.

Never knew there existed (===). Silly me :)

Regards,
Karam

--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:

> Karam Chand wrote:
> > Hello,
> > 
> > mysql_query() returns non-false even if there was
> an
> > UPDATE statement and the query was successful.
> > 
> > But if I put the $result variable in
> mysql_num_rows()
> > it returns an error, $result in invalid handle. 
> > 
> > I was asking how to know that where its an UPDATE
> > statement so I dont call mysql_num_rows() at all.
> 
> I Chris said, if($result === true || $result ===
> false), no rows were 
> returned.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

--- End Message ---
--- Begin Message ---
* Thus wrote Justin French:
> I have an event CMS where really, I should know the TZ of the events, 
> which can happen world wide.  However the user base is not computer 
> heads, so I can't just "ask them".
> 
> So, I'm faced with the prospect of making an educated guess based on 
> the Country, State and Capital City information provided by the user... 
> possibly I could interface with the files in /usr/share/zoneinfo/, or 
> perhaps there's a database I can download to hook into.

It could be possible to figure out what zone one is in via the
zone.tab file.  It probably will be a lot of work just to figure
that out, not to mention you need to be able to find the
coordinates of the persons Country/State.


Curt
-- 
Quoth the Raven, "Nevermore."

--- End Message ---
--- Begin Message ---
GH wrote:

Is there a way to make sure that a page is only loaded via a

require or include statement? or other type of SSI?

I would like to make sure that a 'parent document'  (namely
admin_template.php) only calls the php file?

Thanks



leave if outside htdocs


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
secure it with apache .ht* files for directory and file settings or
the main config file.


On Sun, 17 Oct 2004 15:35:58 +0600, raditha dissanayake
<[EMAIL PROTECTED]> wrote:
> GH wrote:
> 
> >Is there a way to make sure that a page is only loaded via a
> >
> >require or include statement? or other type of SSI?
> >
> >I would like to make sure that a 'parent document'  (namely
> >admin_template.php) only calls the php file?
> >
> >Thanks
> >
> >
> >
> leave if outside htdocs
> 
> --
> Raditha Dissanayake.
> ------------------------------------------------------------------------
> http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
On Sat, 16 Oct 2004 22:04:33 -0400, Gh <[EMAIL PROTECTED]> wrote:

Your right, this is not what I was expecting, I was thinking there was
another way...  Sounds good.. but any other suggestions?




On Sat, 16 Oct 2004 21:40:56 -0400, Minuk Choi <[EMAIL PROTECTED]> wrote:
well, this is probably not what you were expecting... but you can try this

admin_template.php
--
$parent = true;
include('important.php');
--

important.php
--
if (!isset($parent) || !$parent)
exit();

//important stuff here.
--

Of course, this only works assuming that the would-be hacker doesn't know
HOW you are authenticating the file. If you are going to try this method,
mix it up, use a rather unique variable name and or use a value that is hard
to guess.


-Minuk




----- Original Message ----- From: "GH" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Saturday, October 16, 2004 9:15 PM Subject: [PHP] Is there a way to...

> Is there a way to make sure that a page is only loaded via a
>
> require or include statement? or other type of SSI?
>
> I would like to make sure that a 'parent document'  (namely
> admin_template.php) only calls the php file?
>
> Thanks
>


I often do it this way:

main.php:

<?
        define('MyScript', '1.0');
        include('file.php');
?>

file.php:
<?
        if (!defined('MyScript')) die("Access denite");
?>

To hack this, the attacker needs filesystem access to your script - an if this happens, that should be your smallest problem...
--- End Message ---
--- Begin Message ---
I have just started using mod-rewrite, and have two questions...

I see everywhere on the net that I can change file names to lower case -
at present they are an ex-Windows based mess of upper and lower.  But I
can't see anywhere how to actually do it, just that it is possible. 

Also, I use
RewriteRule ^comm/(.*).php /comm.php?C=$1
to change comm.php?C=abc to a more search engine friendly comm/abc.php.
But this leaves gives the effect of being in a different folder, and
relative URLS within that page no longer work correctly.  Is there a
Clever Fix?  Or do I have to change to absolute URLS?  And if absolute
is absolutely necessary, should I include the domain name?

-- 
Pete Clark

--- End Message ---
--- Begin Message ---
Wow - this is *really* spooky!

When I wrote that, with RewriteRule "relative URLS within that page no
longer work correctly", I had not realised that those within PHP worked
ok, whereas those in  raw HTML didn't...  

-- 
Pete Clark

--- End Message ---
--- Begin Message --- Pete wrote:
I have just started using mod-rewrite, and have two questions...
<snip>

And neither one of them have anything to do with PHP.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Yes it does! It aint off topic. 
Pate is trying to figure out how to integrate mod_rewrite
functionality with his PHP scripts.

If you're new to mod_rewrite then you can use this alternative PHP
script that does the work for u.  Here you go:
http://www.zend.com/codex.php?id=674&single=1



On Sun, 17 Oct 2004 09:16:37 -0400, John Nichel <[EMAIL PROTECTED]> wrote:
> Pete wrote:
> > I have just started using mod-rewrite, and have two questions...
> <snip>
> 
> And neither one of them have anything to do with PHP.
> 
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
M Saleh EG wrote:

Yes it does! It aint off topic. Pate is trying to figure out how to integrate mod_rewrite
functionality with his PHP scripts.

Ah well, I should just ask a question or two about how to integrate mod_perl functionality then, eh? It's as offtopic as MySQL, JavaScript, etc questions are on this list. There _are_ places out there were mod_rewrite would be on topic, but this isn't one of them.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Is direct multi inhertance supported in PHP5? 

I'm on PHP4, didnt find this on the docs nor at zend's. It might be
the reason of migrating to PHP5 for me. Any Idea? anyone who tested
it? by this I dont mean the chaining method of inheriting. I mean
direct multi inheritance!

Thanx in advance.

-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
* M Saleh Eg <[EMAIL PROTECTED]>:
> Is direct multi inhertance supported in PHP5? 

I believe so -- this was one of the new features of the object model
introduced in PHP5. My understanding is that you have to create
interface classes that a class can then implement. Unfortunately,
interface classes are abstract -- no code allowed other than
declarations.

> I'm on PHP4, didnt find this on the docs nor at zend's. It might be
> the reason of migrating to PHP5 for me. Any Idea? anyone who tested
> it? by this I dont mean the chaining method of inheriting. I mean
> direct multi inheritance!

I saw a number of mentions of it when PHP5 was first released, but the
only reference I can dig up now is at:

    http://www.zend.com/php5/andi-book-excerpt.php#Heading3

and, unfortunately, when it talks about interfaces being how multiple
inheritance is achieved, fails to give an example.

Surely somebody has a more definitive answer, but I thought I'd give it
a shot.

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

--- End Message ---
--- Begin Message ---
Thanx Mathew
I guess I found it, it's disapointing though.

Here was the answer: http://www.zend.com/php5/andi-book-excerpt.php#Heading3

<Copied from the link above>
4. Interfaces
Gives the ability for a class to fulfill more than one is-a
relationships. A class can inherit from one class only but may
implement as many interfaces as it wants.
<Copied from the link above>


On 17 Oct 2004 13:30:36 -0000, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> * M Saleh Eg <[EMAIL PROTECTED]>:
> > Is direct multi inhertance supported in PHP5?
> 
> I believe so -- this was one of the new features of the object model
> introduced in PHP5. My understanding is that you have to create
> interface classes that a class can then implement. Unfortunately,
> interface classes are abstract -- no code allowed other than
> declarations.
> 
> > I'm on PHP4, didnt find this on the docs nor at zend's. It might be
> > the reason of migrating to PHP5 for me. Any Idea? anyone who tested
> > it? by this I dont mean the chaining method of inheriting. I mean
> > direct multi inheritance!
> 
> I saw a number of mentions of it when PHP5 was first released, but the
> only reference I can dig up now is at:
> 
>    http://www.zend.com/php5/andi-book-excerpt.php#Heading3
> 
> and, unfortunately, when it talks about interfaces being how multiple
> inheritance is achieved, fails to give an example.
> 
> Surely somebody has a more definitive answer, but I thought I'd give it
> a shot.
> 
> --
> Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
> Webmaster and IT Specialist       | http://www.garden.org
> National Gardening Association    | http://www.kidsgardening.com
> 802-863-5251 x156                 | http://nationalgardenmonth.org
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
hello all,
i need to install php, postgresql and apache. i had redhat 7.3 running. i like to 
know, the comaptible versions of the above three. i couldn't install the current 
version of the above three as it is asking for GLIBC-2.3. but i had GLIBC-2.2.5 
running. it is not possible to update GLIBC. 
thanks in advance

                
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

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

I'm running php 4.3.2

When I run the following

$fname = tempnam('mytmp/', 'PREFIX_');

and then echo $fname, it returns

/tmp/FILENAME rather than mytmp/FILENAME

I'm running under RHEL 3 U3

Anybody know what's going on?

thanks,
Brent

--- End Message ---

Reply via email to