Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




How Can You Make A Page Find Its Own Url?


How can you make a page find its own url? anyone know? i want the page to know its url... like this post new page would know its url is http://forums.devshed.com/newthread...d&forumid=5....




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Make Error - Upon Php Compile: Cannot Find -lltdl
Have entered make comand and get the following error:

/usr/libexec/elf/ld: cannot find -lltdl

which has me baffled - any ideas please?

Make PHP Find Windows Directory. I Need The Php Equivelant To "%WINDIR%"
I've written a small gui for PHP.ini but I don't know how to make PHP find the windows directory itself. You'll probably understand better when you see the code below.

I'm currently using the line:
Code: $PHP = new Config ("c:windowsphp.ini",";"); And that works fine but only if PHP.ini is in c:windows.
I tried
Code: $PHP = new Config ("%WINDIR%php.ini",";"); but that dowsn't work, I need something that finds windows dir. itself, Any ideas?

You can see an example of it at http://213.152.46.100/gui/php-config.php (Uses a temp PHP.ini so you can't mess nothing up, feel free to play about with it)

Find Page Location
How do you find the page location in PHP? I have yet to find a good tutorial site with a decent search engine.

Find Previous Page
I am trying to make a system where other web sites can link to my home page, and my home page can redirect them based on the site they came from. However I really don't want to have to use get values in the url.

In short I need to know if there is a variable or function which allows me to find the web page that the user has just come from, and if there is, what it is.

Is There A Function That Can Find Out What Page A POST/GET Request Came From?...
Is there a function that can stop people from posting from a form that is off the server? So it will ONLY allow people to post from a certain page?

How Do I Make The Results Appear On The Same Page?
Presently i am calling a new file to accept my dropdownlist values. Is it possible to make it such that the results will just appear on the same page? Code:

Help In Trying To Make A Web Page Counter
I'm trying to build a counter that will keep trach how many hits I got
and where they came from. In my html pages I have a script of code
that loads in an image. This image is a php file. When this file
executes it adds one to the stack counter,

The problem is that for the referring server, I alawyas get the server
that is hosting the web page that is calling my web page counter. I'm
assuming its because this is the server that calls the php code on my
server.

I have seen other companies do this, how do they do it????

This is what I have so far.

On the client I insert the following code onto my web pages

<img src="http://216.120.252.101/~multist/ws/add.php?
customer=fred&phrase=google&server=tedserve&filename=fred.html"
alt="boston kitchen design" width="267" height="90">

Where
http://216.120.252.101/~multist/ws/add.php is my php script to update
the stat counter

On my stat counter server,

$from=$_SERVER['HTTP_REFERER'];
// $from='ted'
$sql_string="INSERT INTO `tedpott_webstat`.`web_stat` (";
$sql_string=
$sql_string."`customer`,`path_name`,`from_server`,`key_word_phr ase`,`PageID`,`server_name`,`file_name`)";
$sql_string=$sql_string." VALUES (";
$sql_string=$sql_string."'".$customer."','".$path."','".$from."','".
$phrase."','".$pg."','".$server."','".$filename."'";
$sql_string=$sql_string.")";

print("<br>");
print("<br>");
print("second string b<br>");
print($sql_string);
print("<br>");
if (!$results=mysql_query($sql_string,$dblink))
die("could not add new record");
print("updateds database ok");


// close databse connection
mysql_close($dblink);.

Make A New Page In A Module?
I would like to hake a new page in a module.

Often times at the bottom of a module or page you will see an option to go to next the next page, or you will see a row of number which will link you to the next page. This is what I would like to do. The main issue is that I would like it to keep the same style of the block that is in the first page, on the second page and etc.

I'm not great at php so I downloaded an module called Module_maker. It's easy to use and an happy with the out come so far. The Module Maker has an html.text in it which I add html code to and it will show the code on the block inside the module. So.. I would like to have a second page and more which would be navigated to with a link somewhere on the page. keeping the same style. What would be very cool is if the only thing that changed when clicking "next page" would be the block its self.. That maybe going to far. Code:

How Do I Make My Page Stop Caching?
I have a PHP page that holds info that comes from a MySQL database. I have another page that modifies the info to the users liking, and then sends them back to th first ppage with all the info. Problem is it shows up the same as before. For example, if I delete one of the entries, it's still there when I get sent back.

How To Make Page Variable In Height
I want to programatically make my page of varying height based on the
content. if you go to trinadoula.com you will see what i am talking
about. you'll see the mid section of the page is a bar that could be
stacked on top of itself over and over in a loop to make a variable
height page. how can i use php to analyze how tall the content is
(i.e. the text, or images) and then loop a image bar on top of itself
to make the page different heights?

How To Make A Proper Logout Page?
Make a logout page such as "logout.php". This page will be used anytime when the uses wishes to logout. Therefore for all my other pages, I just send the user to my logout.php when he/she clicks to logout. Most of it is easy but I'm having problems with a logout.php that can deal with frames. This is my problem:

in my bottomFrame, I have a click that sends the topFrame to logout.php. But you can imagine what will happen right? It will make the topFrame logout and bottomFRAME will stay and do nothing. How can I kill the bottomFrame when the topFRAMe goes to logout.php?
There must be a code that I can put in the logout.php that will kill any frames if they exist.

Make It Link To Another Html Page
How to retrive feild from table and make it clickable and link to another html page.

How To Make Image Of Web Page (thumbshots)
How to make image of web page, like this:

How To Make Tabbed (overlayed) Zones Of A Page.
I'd like to use PHP and JavaScript to make a zone (say the lower right quarter) of the page to display one bit of content when the user clicks a tab button above the zone, and a different bit of content when the user clicks a new tab, etc., all without updating the whole page.

I know this can be done with JavaScript by swapping images, but I'd like the content to be HTML with the option of embedded links - rather than pure graphics content.

For those of you who use IE, go to www.msdn.microsoft.com to see the tabbed content zone and see it in action. However they did it, it isn't functional when viewing it with Netscape.

Make Sure User Is Referred By Specific Page.
I know this is possible because I have seen it in a few scripts before, but I forgot exactly how the language was put.

I have a link on a page inside a password protected folder, lets call it domain.com/protected/hide.php.

When the user clicks on the hyperlink, they will be redirected to domain.com/folder/page.php

I want to write somewhere on page.php to be sure the visitor came from hide.php, otherwise display an error message. How can I do this?

Need To Make A PHP Script Forward To An Html Page When Processed!
When a php script is processed, how can I then get the script to automatically forward to a confirmation page? The script in question is a mail script, and I need to get this to forward to an html page to basically say, 'mail is sent'.

Complete Newby Who Is Keen To Make A Search Page
I am keen to make a search page on a website, but I have absolutely zero
experience with PHP. I am going to hire an expert, but I thought that it
may pay to try it a bit first myself (I do want to learn how to do it).

What I have is a search page (HTML) and an access database. Now, can
someone give me some clues or links on where to start.

I prefer not to install the whole PHP thing on my own computer, but just to
try it straight on the server (if this is possible).

No Libphp4.so File Created In Make Intstall Or Make.
I have done a make, and a make install on the 4.3.6 version, using
/usr/local/etc/php as the directory I make from. However, no matter what
I do, I do not see a php4lib.so that has been created. The documentation
I recieved (an IBM source) says that the following has to be added to the
httpd.conf file :

LoadModule php4_modulelib/apache/libphp4.so
..
..
..
AddModule mod_php4.c

here is the output from my make install :

[root@mail php]# make install
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR - already installed: 1.3.1
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] DB - already installed: 1.6.2
[PEAR] HTTP - already installed: 1.2.2
[PEAR] Mail - already installed: 1.1.3
[PEAR] Net_SMTP - already installed: 1.2.3
[PEAR] Net_Socket - already installed: 1.0.1
[PEAR] XML_Parser - already installed: 1.0.1
[PEAR] XML_RPC - already installed: 1.1.0
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
program: phpextdist

How Do I Find Even #'s In Php
ur prob. all laughing at this easy *** question ... but for some reason i cant fig. it out.

i know how to find even (and odd) numbers in c++ (using the %).

how the hell do u do it in php tho...

im trying to alternate the bgcolor of a row in a table (from #CCCCCC to #FFFFFF)

here is my code..

if ($row = mysql_fetch_array($result)) {
$x=0;
echo "<table width=200 border=1 cellspacing=0 cellpadding=4>";
do {

if (($x%2)==0){$color="#FFFFFF";}
else {$color="#CCCCCC";}
echo "<tr bgcolor=$color><td>";
print $row["name"];
print ("</td><td>");
print $row["email"];
print ("</td></tr>");
$x=$x+1;
} while($row = mysql_fetch_array($result));
print ("</table>");
} else {print "Sorry, no records were found!";

How To Find IP?
Mostly when u visit shopping carts n u checkout n go futher for
payment in the list box your desired country is selected automatically
this is bcoz of they are tracking us by our IP Address.
So which function in PHP is used for find the IP Address of a person
who is visiting my site?

Find An Url?
I'm trying to read url's off of a website page by reading it's source code and locating http://www..com/? etc.

<embed src="http://www.somewebsite.com/someflash.swf" width="somewidth height="someheight">

Is it possible to locate a code in the source of a web page, except the exact link "http://www.somewebsite.com/someflash.swf" can be replaced with like %%%%%%%%%% so it simply finds it's similiar match? Otherwise I need to put in the exact url, and I want to search for all http urls instead.

Possible To Find Domain ?
hi I have two domains that I want to point to the same site, however I want each site to be customised for each domain, site title, header, email address's etc

todo this I need to figure out howto find which domain the client used to access the website. I tried using $_SERVER['SCRIPT_URI'] but with no success.

Find A Max Value In Mysql With Php ?
How do I a max value in mysql with php?

I can find a max in mysql with:
SELECT MAX(num) FROM codes WHERE num LIKE 'A%'

I try to do it in php and it doesn't work -

$result = mysql_query("SELECT MAX(num) FROM codes WHERE num LIKE 'A%'" , $link);
$row = mysql_fetch_array($result);
$num=$row["num"];

this returns $row as Array?

How To Find The END Of LINE?
When I open a text file to read, we can use feof() at the END of FILE. But, how to find the END of LINE?

How Do I Find Out A New INSERT's Row ID?
sorry, I saw a post on this last summer but "id" is too short for the search engine [img]images/smilies/frown.gif[/img]

in a table, i have an autoincrement unique 'id' as the first column. if I do this:

Code:

"INSERT INTO table SET
submitter_group='$groupname',
ip='$ipaddy',
datetime='$stamp'
";

how do I find out the id of this new row?

I'd like to be able to UPDATE more data to this row as the user enters it...

or should I not use the ID, but rather a new column that's a hash of the ip and date? (but same thing, how would I grab that value?)

sorry, no 'unique' identifier per-user, this is for an anonymous survey tool. I AM using sessions (group-based authentication: u/n & p/w given to a group of people, etc) so is there a session value I should key off-of?

Strpos Can't Find What I Specify
$title = 'The Webmaster World'
$findme = 'c' //c doesn't exist
$pos = strpos($title, $findme);
print $pos; //this doesn't print anything to the screen
$newtitle = substr("$title", 0 , $pos);
print $newtitle; //this doesn't print anything to the screen either

So if I put the above code in a webpage and run it, I would get an empty screen.

I know if strpos() can't find what I specify, it returns a boolean FALSE. So the substr() will be trying to execute a FALSE variable and thus makes itself FALSE as well and not return anything? Is that how substr() above will interpret this?

Not Able To Find The Mysqli.dll
trying to figure out how to use a mysql database with PHP. I ran the
following code:

Is There A Way To Find Out What A Url Redirects To In PHP?
Every day on my blog, I have a list of about 30 other blogs that I link to. Lately, more and more of then have been using feedburner, which means that the links to their posts show up like this:

http://example.com/~r/Jordanisyourhomeboy/~3/144521539/

Is there a function in php (I'm using PHP 4) that will find out what that URL redirects to, and return the actual URL of the post instead of the feedburner URL?

How To Find Out Veriosn Of PHP
This is probably something easy to do but how do I find out which version of PHP I am using?

How To Find Out If Its A Valid XML Doc
I open an xml document using fopen create result string uisng an implode function. then pass that string to domxml_open_mem function now here is the question, take a look at the code below,for some reasons when a document is not valid doc(that is it has some invalid caharacters) it would still return $dom variable (only this time it will have a string in it)

if(!$dom = domxml_open_mem($rssFile)){
foreach($this->feedsArr as $value){
$rssFile = $this->OpenURL($value);
if($dom = domxml_open_mem($rssFile)){
return $dom;}}

open url function just opens the file using fopen and returns a string created with implode. If did not make any sense at all.

Find And Replace
Hey there i have an input box but want to know the best way of doing this i want to allow people to enter in website <a href="skdfj"> safasd</a> but would prefer if they could just enter http://bla.com

Find The Value Of The Next Record
I have a database with 3 columns.

my_id
my_page_number
other_page_data

I'm creating a written page that has a link to the next page for each record in the above table. Is there a way to get the value of my_page_number for the next record so I can direct users to the next page?

Find And Cut String
I'm new to PHP, so please bear with me! =)

Is there a nice little function to find a string between to html-tags?
I.e. let's say I have a string with the following text:
"Hello world, <b>this is a test</b>"
I would like to cut out the text between the <b> and </b> ("this is a test").

File Which Tries To Find Itself And Can't...
<?
//file test.php
phpinfo();

$filename = "test.php";//it does not work

$filename =
$_SERVER['DOCUMENT_ROOT']."/home/ke000067/public_html/test.php"; //it
does not work

$filename =
$_SERVER['DOCUMENT_ROOT']."/~ke000067/public_html/test.php"; //it
does not work

$filename = "home/ke000067/public_html/test.php"; //it does not
work

echo 'fila buscada: '.$filename.'<br>'

if (file_exists($filename)) {
echo 'Of course it is.<br>'
}else{
echo 'What?? How can it be???.<br>'
}

?>

these are some values retieved from phpinfo
_ENV["REMOTE_PORT"]2010
_ENV["SCRIPT_FILENAME"]/home/ke000067/public_html/test.php
_ENV["SCRIPT_URI"]http://200.50.110.233/~ke000067/test.php
_ENV["SCRIPT_URL"]/~ke000067/test.php
_ENV["SERVER_ADDR"]200.50.110.233
_ENV["SERVER_NAME"]200.50.110.233
_ENV["SERVER_PORT"]80
_ENV["SERVER_SIGNATURE"]<ADDRESS>Apache/1.3.33 Server at
200.58.112.233 Port 80</ADDRESS>
_ENV["SERVER_SOFTWARE"]Apache/1.3.33 (Unix) mod_auth_passthrough/1.8
mod_bwlimited/1.4 mod_log_bytes/1.2 mod_ssl/2.8.22 OpenSSL/0.9.7e
FrontPage/5.0.2.2635
_ENV["GATEWAY_INTERFACE"]CGI/1.1
_ENV["SERVER_PROTOCOL"]HTTP/1.1
_ENV["REQUEST_METHOD"]GET
_ENV["REQUEST_URI"]/~ke000067/test.php
_ENV["SCRIPT_NAME"]/~ke000067/test.php
_ENV["PATH_TRANSLATED"]/home/ke000067/public_html/test.php

I'm really confused about paths. Now I think that it is not a good idea
to learn on local server, beacause whenever one changes to a shared
one, all seems to fail....



How To Find Request URL?
How to find the request URL in PHP?

Find Highest Value
Im trying to find the highest value of a value in my database called LeagueWoodenSpoon. On the highest value, i want to set $image="spoon.gif"

i tryed the following code, but it adds a spoon.gif to everything over 0 and not only the highest value can anyone point me in the right direction? the following code is inwith a loop which goes through every value in my database.

$SpoonFlag = 0;

if($row_SelectAllLeague['LeagueWoodenSpoon'] > $SpoonFlag){
  $SpoonFlag = $row_SelectAllLeague['LeagueWoodenSpoon'];
  $image='spoon.gif';
}

Find A Value In An Array
I want to find the smallest value in my array and then write it on the screen wit echo. I thnik that i got the 'founding part' but the number does'nt been writet out on the screen. Code:

Find IP Address ?
When i try to run this code i get my loopback address. Though i am connected to internet and have an ip why do i get this ?

<?php
echo $_SERVER['REMOTE_ADDR'];
?>

Find All Folders
I've been looking around and I can't seem to find a function that will allow me to open a folder and read all the folders inside it.

How To Find Id In Database
i have a user system, and i am currently working on a update page for the user
i have the whole system down its just that for it too work i have to put in the id in $sql

and i can't set it as a variable because it doesn't get a number

is there somekind of way that i can get id through a session? because thats the only way it would work

Find Ip From Domain Name
How do look up an ip address from a domian name with php?

Eregi_replace To Find Id & Url?
I've got this little function I wrote which converts links in my custom-built CMS. By using the Id of the page to link to, I can easily make an internal link to my own website, such as:

A link:

<link=1>this is a link</link>
My function:
function convert_Links($content) {
        $pattern='(<link=)([0-9]{0,5})(>)';
        $replacement='<a href="/index.php?id=2">';
        $pattern2='</link>';
        $replacement2='</a>';
        $content=eregi_replace($pattern2, $replacement2,eregi_replace($pattern, $replacement, $content));     
        return $content;
    }


which creates a nice link to: index.php?id=1 or whatever.

However, I've recently changed to showing my urls using Mod-rewrite, so it would now show as:

/products/product-number-5/1
(where the '1' on the end is the page Id)

Is there any way to get this url using my function, rather than just the Id?
To do this I'd need to extract the id, call another function to look up this page's url, then pass that back to the function.

How Do I Find Certain Files In A Directory?
I need to find all the files in a directory that have a particular extension (like .txt), and then load the contents of those files into MySQL. I understand how to find a specific file, but I'm not sure how to read an entire directory, then grab only those files that have the extension. Also, should I be concerned about the server timing out, or anything of that nature, since there might be as many as a few hundred files that I'll be loading into the database.

Where Can I Find Beginner PHP Tutorials.
I want to learn PHP, and I need to find the best & greatest online PHP tutorial for beginners to learn to code PHP.

Find Visitor Location From IP
How can i find a visiters location by there ip addy.. i know this is possiable in perl.. but is it possible in php?

Find Domain Name Dynamically
I have 2 registered domains, which point to the same web root folder.
I would like to display a different logo image depending on which domain the user requested. Is it possible to find the domain name with PHP?

Find Last Occurrence Of A String In Php 4
Can any body tell how i can trap last occurance of a string in a string. I use strripos()function to do this. But it is available in php 5 ont in 4. And there is php4 installed on my web server. So my scriptting is not running properly. Can any body tell substitute of this function in php4.

Find PHP Install Directory
Is it possible to dynamically find where PHP is installed on a Win 2k3
machine running IIS? I am setting up a configuration page and I want to show
where the install is - not change, just show. I have looked at phpinfo and
$_SERVER information, but none of the information seems to jump straight out...

Need To Find-out Improper Sign-out
Is there any way to run a function or a code-block whenever the client-
server communication breaks off. (ie power-off, browser-crash...)

Why I need this is, I want to update a login-table to trace user's
leave the portal without proper log-off or sign-out.

Every time a user at proper sign-in, a flag is set & account is locked
until he sign-out by updating in the login-table.At sign-out the flag
is released & his account is ready to log-in again.
Is my logic right?


Copyright © 2005-08 www.BigResource.com, All rights reserved