php-windows Digest 8 May 2005 15:34:17 -0000 Issue 2662

Topics (messages 25980 through 25983):

Re: Real path through aliases
        25980 by: Wu, Jin Yong

Re: changing querystring to fixed link
        25981 by: Wu, Jin Yong

Re: Print inside a variable
        25982 by: Wu, Jin Yong

Just a question, answer appreciated
        25983 by: S.F. Alim

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 ---
Through URL you can't determine the real path UNLESS your script returns
some URL information.
So that it can prevent hacker knowing some useful information about server
to guarantee the web
server's security. 
In PHP scripts, you can use __FILE__ to get real path or dirname(__FILE__)
to get real directory.
Hope it's helpful for you.

Regards,
Yong from Xerox, China
2005/5/8

-----Original Message-----
From: Liam [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 04, 2005 22:51 PM
To: [email protected]
Subject: [PHP-WIN] Real path through aliases


Hi,

I'm running PHP 4.3 and Apache 2, trying to figure something out.
Is there a way from PHP to determine the real (harddrive, not URL) path 
being accessed by a URL? For example, if I want to know where on my 
harddrive http://localhost/web/ is, it's going to be DOCUMENT_ROOT/web, and 
I can make that work using REQUEST_URI for anything under my document root
However, some of my folders are apache folder aliased to other parts of my 
harddrive. Example, http://localhost/music is actually f:/my 
documents/music/

Is there any way to let PHP figure this out automatically, without having to

hardcode my script to look there every time?

I really appreciate any answers you might have

Thanks,

Liam 

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

--- End Message ---
--- Begin Message ---
It's none of PHP's business. It's relative to the web server.The following
are the two solutions:

1) running PHP as CGI,just like Perl, so that you can handle the PATH_INFO
with parameters,
for example:  
change http://www.dictworld.com/search.php?q=hello&lang=en
to http://www.dictworld.com/search.php/q=hello/lang=en
or http://www.dictworld.com/search/hello/en 
(As a CGI program, you should specify the PHP.exe path like perl in every
script, such as: #!/usr/bin/php )

2) load module <mod_rewrite.c> in Apache.Then modify the httpd.conf and add
this rule(for example):

RewriteRule  path/to/([a-z]+)_([a-z]+).html search.php?q=$1&lang=$2

so that you can access your web via
http://www.dictworld.com/path/to/hello_en.html

May these help you,

Yong from Xerox, China
2005/5/8

-----Original Message-----
From: Muhammad Imran [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 05, 2005 12:14 PM
To: [email protected]
Subject: [PHP-WIN] changing querystring to fixed link


How I can make different querystring in to fix string, so search engines
can cache the pages. I'm using php+mysql+apace, any help much
appreciated. 

Regards,
Imran

--- End Message ---
--- Begin Message ---
I am not sure whether you want to get the executing result of such PHP
script into the variable $message or not ???

If so, you can use output buffer.
<?php
ob_start();

/* the following is the snippet you gave */
if (isset($rss_channel["ITEMS"])) {
 if (count($rss_channel["ITEMS"]) > 0) {
  ..........
  print ("<b>There are no articles in this feed.</b>");
 }
}

$message = ob_get_contents();
?>

Regards,
Yong from Xerox, China
2005/5/8

-----Original Message-----
From: Maxwell Brodie [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 03, 2005 11:35 AM
To: [email protected]
Subject: [PHP-WIN] Print inside a variable


Hello,

I believe my problem is that I have to use the print funtion inside a 
variable, and I have no clue how to do that. For example, I need to get 
this:

if (isset($rss_channel["ITEMS"])) {
 if (count($rss_channel["ITEMS"]) > 0) {
  for($i = 0;$i < count($rss_channel["ITEMS"]);$i++) {
   if (isset($rss_channel["ITEMS"][$i]["LINK"])) {
   print ("\n<div class=\"itemtitle\"><a href=\"" . 
$rss_channel["ITEMS"][$i]["LINK"] . "\">" . 
$rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>");
   } else {
   print ("\n<div class=\"itemtitle\">" . $rss_channel["ITEMS"][$i]["TITLE"]

. "</div>");
   }
    print ("<div class=\"itemdescription\">" . 
$rss_channel["ITEMS"][$i]["DESCRIPTION"] . "</div><br />");   }
 } else {
  print ("<b>There are no articles in this feed.</b>");
 }
}

Into variable "$message="

Any help would be appriciated MUCH!

Thank you! 

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

--- End Message ---
--- Begin Message ---
Hi list,
 
How do you increase to a counter without refreshing the whole page. For example 
if you check site www.gmail.com <http://www.gmail.com/>  under âDon't throw 
anything away.â heading there is counter which is increasing (could be 
javascript magic) but other example is www.neopets.com 
<http://www.neopets.com/>  where time (seconds) is changing without refreshing 
the whole page ( it is php script )
 
Any link or hint or code will be welcome ( even comments ) ;)
Thanks in advance.
salim

--- End Message ---

Reply via email to