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




Determine If User Came From Inner Link Or An Outside Link


any php method or function to determine if a user came from within the website or from an outside website. I have a page that I want to display in different manners depends on how did the user arrive at my site.

I know about the HTTP_REFERER function. but don't really know how to use it. I know this is the syntax:

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

but when i entered the code in the php page. for instance test.php, there is nothing coming up. So my questions:

1. is there any other method?
2. could any of you maybe specify a bit more details about this function and how to use it.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic Download Link - Not Direct File Link
I'm posting a podcast feed that makes reference to audio files for download. Instead of linking to the files directly (e.g. www.mywebsite.com/podcast.mp3), I want to link to the file as get variables so that I can track number of listeners (e.g. www.mywebsite.com/?audio=podcast.mp3). Where would I look to get something like this to work? How do I start sending audio data to the user using a link like this?

User Last Clicked A Link On My Page
What I want is to display how long ago it was since the user last clicked a link on my page? How would i go about doing this?

How To Send A Validation Link Email To The User.
how to send a validation link email to the user. which contains in most website now.
when user successful register then the system will send a validation email to the user.
when the user click the validation link in the email then will activate the user's account anyone know wat this method called, and how to write it?

Variable From Link In E-mail Is Cut Off Once User Logs In...
Every time I add an update to a user's account on my website, I have an auto e-mail sent out to the user. It is formatted with HTML and includes a hyperlink. This hyperlink will be in the form of http:/www.domainname.com/page.php?variable .

Once they click on it, they will be forced to login to the site since that page is restricted to clients only. Once they login in, I want them to be forwarded to that initial link that they clicked on. Instead, they are forwarded to http://www.domainname.com/page.php - The variable seems to get cut off. Can someone please assist me with keeping the url intact including the variable at the end?

Here is my code:

Creating Link To File Or Temp File For User Download
I am designing a document management system (DMS). The files are stored
in a directory on the webserver. The filenames for the documents are
stored in a MySQL database. The DMS will track revisions from the
initial version through the updates. We must have strict permissions
set so only authorized personnel can access some documents. All of the
documents when uploaded are given totally random names such as
"114723fb5422c6bd5ed18f6.doc". Is there a way, without the webserver
creating a new file name "document_specs_ver2.doc" to have the file
download named "document_specs_ver2.doc".

If I must physically create a new file, how do I know when the
webserver would be allowed to delete it? Notes: The files will be in
several different file formats, not just "doc".

How To Determine Logged In User In Oscommerce
Hi everyboy, I am working in oscommerce right now,Can anybody tell me how to
determine logged in user in oscommerce.I'll be very thankful if anybody assist
me.

Link?=ID#
I am wondering if there is a script/code somewhere to find that hides my actuall links from browsing users, no database related. For example. My links on a webpage


link 1 = http://mysite.com/hello.php
link2 = http://mysite.com/byebye.php

I want to hide theese links and for the outsidebrowsers to look like this:

link1 = http://mysite.com/redirect.php?ID=12
same for link 2 but with a different ID

hope ypu understand .Please note : NO MYSQL support.

Using An As A Link
Now I am able to practice php on my pc, thanks to previous replies to a
post in this forum, here the first of many questions.

I want to be able to use an image as a link. So in html I would use:

<a href="http://www.somepage.com">
<img src="someimage.jpg">
</a>

I have written the php code below (which I am proud of !!):

<?php

// Switch statement based off server time
switch (date('H i D'))
{
case &#3922; 33 Sat':
print '<img src="michelle.jpg" border="2" height="170"
width="227" />'
break;

case &#3922; 34 Sat':
print '<img src="sunset.jpg" border="2" height="170"
width="227" />'
break;

default:
print 'Cases not met'

}

?>

Now the code above does what I want it to do but if I add the line
below i get a parse error:

case &#3922; 35 Sat':
print '<a href="http://www.somepage.com"><img
src="someimage.jpg"></a>'
break;

So how do I create a link from the images in my code?

Getting 404 Link
Thanks to my apache .htaccess file, all the 404 errors are redirected to my
404.php file.

I'd like to get the following infos :
- the page address from which the 404 error come from (I get it with
$_SERVER["HTTP_REFERER"]),
- the exact link that provoqued a 404 error.

How can I get the 2 piece of info ?

Link In If
if i have the following how do i make the new chat message a link?

<? $numbernow=($chat[0])?>
<? if ($stat[chatnow] < $numbernow) {
       print "NEW CHAT MESSAGES";
}
?>

Link Regexp
I am try to get all the links out of a document with a regexp.

Link Redirection
Is there any way to redirect a link to another page after it has been first used? Or even kill the link after its first use?

GET Variables Through Link
Maybe this is all just going right by me and I should probably understand this well by now, but it didn't work the first time, and I have yet to find the right answer.

I'm looking to have a list of names, like James, Bill, Sam...etc on a page. With these names there will be a work function say Accountant, Billing, Janitor, and there will be another variable like office, 1, 102, closet...etc.

KW To Link Like Phpgiggle
I am looking for a php script like phpgiggle which coverts predetermined keywords into predetermined links each time the keyword appears in the page.

Tried to get phpgiggle up and running but with no success and with the author's site down and with no support at all, i am looking for an alternative.

Mailto: Link
My script is <? $MyLink='<a href="mailto:<? echo $Email;?>">'.$Email."</a>"; ?>
This is then saved to a file (txt) and the data inside the file is:
<a href="mailto:<? echo $Email; ?>">xyz@zbc.com</a>
So when I click on the mailto: link the status bar reads:- mailto:<? echo $Email ?> and
the mailer opens with no address.

Php Link Checker
I want to test if my swf files and jpg files are not broken.
I use the fuction fsockopen but this fuction does not work for a file+extension, just domain. Eg www.url.com is ok, but www.url.com/image.jpg is not! but image.jpg is exists!

There is something to that check the full url of files?

Link Problem
I am using the following PHP coding but I have got a error message coming up so what am I do wrong?

<a href="calender.php?action=$outputaction"><img src="$daycheck.jpg" border=0></a>

ODBC Link In Php
I need to use an MS Access DB on my php server. I'm having problems getting it to work though. PHP Code:

PHP Link List
On a page from Thredz (http://www.thredziii.com) I saw a script (it's not on anymore...cause he didn't want the script to be on his page) and I love it...

It's a script that makes it possible that on a page links are sorted ALPHABETICALLY with the first letter of the "URL name"... (take a look on Thredz' site to c what I mean,K?)

Then people got 2 have the abbility to fill in a small form, ON THE SAME PAGE WHERE THE LINKS ARE ON, where they fill in 2 fields;
#1 = Name of the Site ($sitename)
#2 = URL of the site ($url)

When they fill out it form I want the PHP-script to put the information away as a link (in a *.txt-file...if possible)
<A href="$url" target="_blank">"$sitename"</A><br>
(something like this??? I'm not sure......)
These links have to be sorted alphabetically (on the site's name,$sitename...

I don't know how this works or how I have to make something like this... Could somebody please help me and give me a bit of help with it? Some explaining would be gr8 but the script written for me is the best wish I have.

Printing Next Link!
Having trouble printing next / prev links. PHP Code:

Link Problem.....
I need some help for link redirect. I am currently working with a b2b
site. I had define some rules in htaccess but due to auto append of
PHPSessionID at the end of link I could not do it properly so can any
one help me how to avoid that auto appand on phpsessionid at the end of
link.

for example I have a link like:

http://www.xyz.com/test.html

But it will create:
http://www.xyz.com/test.html?PHPSES...8f97d004ddc 1a

So I need to remove tht PHPSESSID from above link I need link as i
supplied,.

Mail Link
I'm using the following php script to send an email.

mail($to, $subject, $message, $from)

I have a question though. How do I construct $message to include a web-link
so that the reader of the email can open the email and click the link in the
email to be forwarded to a linked website.

Assign Value To The Link
I am creating a order-online application. I create some links in my html file. And in my table that I created by mySQL, there are some fields including picture_id, picture_name. What I want is to assign the picture_id to the link so that the picture_name will be selected (using mySQL) when the link was clicked. Can someone tell me how to write PHP code to assign the picture_id to the link?

Link Checker
i need a script that checks urls and if they are okay then includes them....PHP Code:

Session And Link
I've to create link to a new page using session variables.

I've about 20 variables already set, so this is OK. But now I've 50 links to
various articles on my page. Those links are created dynamically using a
mysql table, so I take the ArticleID.

www.mysite.com/detail.php?ID=2
www.mysite.com/detail.php?ID=4
www.mysite.com/detail.php?ID=5
www.mysite.com/detail.php?ID=7
www.mysite.com/detail.php?ID=54
....

I'd like to avoid passing the ID in the URL. It's there any way to pass it
in the SESSION variable. Javascript isn't possible, so I'd like to know if
it's the only way to create the link. Or maybe must I use a FORM for every
artivle ? but with a link, I must use javascript....

Link Module
I created a little module for displaying multiple links associated with a PageID. Code:

MySQL Link,
I have a simple MySQL inventory db where the relevant fields are ID (pri,
auto-inc), image (med-blob), description and price. All I want to be able
to do is to store a link to the image in the image field, and have that
image be shown on the returning page. I just can't seem to get it to work
right. It is a 2000 row db, and each item has an image.

Relevant code on the inventory page (I'm sorry if it wraps funny):

$result = @mysql_query("SELECT ID, image, description, price FROM table");

echo ("<table border=&#390;' width=&#3990;%' align=center>");

while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) {

echo("<tr><td width=&#3910;%'><a
href="showPhoto.php?ID={$row[ID]}">Photo</a> </td>" .

"<td width=&#3970;%'>" . $row[description] . "</td>" .
"<td width=&#3920;%'align=right>" . $row[price] . "</td></tr> ");
}
echo "</table>"; }

---Everything displays correctly and when you hover over the photo link
you see the URL "showPhoto.php?ID=1"

In the returning (showPhoto) page, I have the following:

//connect stuff
$result = @mysql_query("SELECT image FROM table"); while ( $row =
mysql_fetch_array($result, MYSQL_ASSOC) ) {

echo $row["image"]; }

Back Link In Url
i have a page where the user needs to be logged in in order to use it, so if they are not logged in it sends them to the login page. once they login it should send them to the page they were trying to go to. the problem is that the url keeps the login page and just adds the new url at the end. here is the code any ideas? PHP Code:

Inserting A Link
I am having a problem inserting a hyperlink to a document into a php
function.

I have tried quite a few ways but can't seem to do it.

File With No Link
I have a link on my web page. When clicked, opens up a pdf file that is
stored on my server. Every file is specific to a user's user name and I
don't want users to see each other's files.
For example:
When User1 clicks on the link, it opens up
http://mydomain.com/files/user1.pdf
and when User2 clicks on the link, it opens up
http://mydomain.com/files/user2.pdf.

So, if User1 knows about User2, he can see User2's pdf file.

How can I make the file open up in a different window without the file
path in the address bar?

Using Checkboxes Instead Of A Link
On my site I give users to option to subscribe to certain articles. When
they choose to subscribe the necessary addition is made to the database.
When they go to the Unsubscribe section it lists the articles that they are
subscribed to and gives a link next to it letting them unsubscribe. However,
rather than having the text, I want to have a checkbox instead. Then I want
to have a button at the bottom that when clicked unsubscribes them from any
articles whose checkbox is ticked. This is similar to the way that My eBay
works, if you are still unclear.

Using An Image As A Link
Now I am able to practice php on my pc, thanks to previous replies to a

post in this forum, here the first of many questions.

I want to be able to use an image as a link. So in html I would use:

<a href="http://www.somepage.com">
<img src="someimage.jpg">
</a>

I have written the php code below (which I am proud of !!):

<?php

// Switch statement based off server time
switch (date('H i D'))
{
case &#3922; 33 Sat':
print '<img src="michelle.jpg" border="2" height="170"
width="227" />'
break;

case &#3922; 34 Sat':
print '<img src="sunset.jpg" border="2" height="170"
width="227" />'
break;

default:
print 'Cases not met'

}

?>

Action Link
Does anyone have a solution for this problem:

- I would like a PHP script to execute an action before a user clicks
on a link (updating the value of a variable, for instance).

Is there an easy way to do this?

Link-question
I have looked in php.net but I can't figure out how it's done.
I want to show a list of the three latest inserted posts in a mysql-table.
The list is meant to be an apertizer and the users have to click on it to
see the whole output from the DB.

How do I make the link to open that exact post?

Here is what is working for now:

Conditonal Link For Each Row?
I have a php page that displays some results, and contains a button with
each row (record) that links to a more detailed page. The typical usrl for
this button link is

/php/template1.php?searchid=497

I am looking at how I can include a conditional statement to allow me to go
to another template provided the user has a condition that I'm looking for
i.e.
everyone gets the a link to template1.php?searchid=whatever theirs' happens
to be, unless a condition is met, that would then say link to
template2.php?searchid=whatever their id is.

Link Conversions
I've been writing a small script that puts some data sent from a form into a webpage e.g title, header, nav. And in this I have to convert links from this:
home_home.html,about_about.html,links_links.html to this:

<a href="home.html" >home</a>&nbsp;&nbsp
<a href="about.html" >about</a>&nbsp;&nbsp
<a href="links.html" >links</a>&nbsp;&nbsp

That bit was not to hard to do, but now my problem is I can't convert them back from html into the original link format, does anybody have any ideas? This is how far I got, all it does is counts the amount of links that are in the page. Code:

Link Referencing Of Another URL
I have two sites, one is a PHP and MySQL driven CMS and the other is a PHP and MySQL wiki. Lets call them:

www.site.com
www.wiki.com

What I want to do is to be able to reference wiki pages from within my main site, using a shorthand reference like [[W]]WikiPageName that not only replaces the [[W]] with the wiki URL, but also converts the string to a URL. I have bought a PHP book and am working my way through it (slowly) and I have come up with the very basic code following:

$URL = [[W]]$Page;
$Wiki = "http://www.wiki.com/";
$URL_2 = "<a href='$Wiki$Page'>$Page[/url]";

I am hoping that something like this would change [[W]]WikiPage to a link with the text WikiPage. My first thought was that when I got the code right, the place to put it would be in the top of the page template, but then I thought that perhaps in the config file that is called by each page.

How Do I Grab This Link ID?
Ive managed to display my records in a table, with a link called 'Cancel' next to get row. When the user selects cancel I would like to open cancel.php and gather all the information regarding the ID for that row. I have the following code:

Link From Variable In Php ?
I have a mysql database and in that i have a users website and contact details..
when i display them on the page i use this code to make there details linkable..

<a href="<?php echo $website; ?>" target="_blank">website</a> | <a href="mailto:<?php echo $email; ?>?subject=Enquiry sent via my website" >contact</a>

Now the problem i have is if a user hasnt put in a email or website or both then these links will still be there but wont work.. So what i am after is a way of displaying n/a if i dont have these details. Code:

How To Execute A Link In PHP ?
I have the following piece of code:

If TRUE {do this;} else {go to this page;}

In the else clause, is there a function in PHP that I can pass in an URL and make it automatically go to that particular page ? The only PHP function I know for this purpose is the "header" function but it does not always work.

Get Refered Link.
im using Jquery to preform some AJAX calls. Now i know that not all people have javascript turned on. I need to know how to determine whether the page is being called directly (typing in the url), or indirectly (XMLHttpRequest).

How To Getting Link From Database
i am creating a dynamic site but i hav problem to fetch the value form database with link Code:

Mailing With A Link
I'm doing an web application,sort of a loaning equipment application, shopping cart in another word. Now, i'm stuck and figuring out an issue. My application flow is lyk dis.

user apply loan->onClick submit button, a mail will be send to administrator to inform and in the mail, there is to be a link which allows the administrator to go straight into a page of my application to audit the stock(this is the step which i'm trying to figure it out)

How am i suppose to do such that i can provide the link in the mail to go straight to 1 of the page in my application securely??

Link Popularity
How, do I display 4 links, for example:

www.google.co.uk
www.yahoo.co.uk
www.facebook.com
www.msn.com

Each time a link is clicked, how do I give each link a rating of popularity, then on a separate page, display a popularity list 1-10. 1 being the best, and 10 being the worst?

PHP Reading A Link...
Is there a way to use PHP to read a specific link and extract certain information from it. For example... To have the script read a website and to look for <table Id="somthing"> and get the <a tag and take the link and information under it? Does this make sense... is it possible.

Validating A Link
If I have a customer input in a string: $String = "oilers.com";

What I'm doing is storing the links but I want to vaildate it first..

How would I verify the $String is a valid link?

Upload From A Link?
I've been searching for a tutorial that shows me how to upload a file from a link instead of from your computer. Does anyone know a tutorial that tells me how to do this?

Create A Link?
If I have a field in my database table that is a link (for example - http://www.phpfreaks.com), is there a way to use PHP to turn that URL into a link when displayed on my php page? I'd prefer not to have to the a href tag and info around the link itself into the database table.

Put A Link In A String?
I'm attempting to insert a link into the body of an email that I'm creating using the mail() function. Since everything in the $message variable is inside quotations, the link keeps printing the html code instead of creating a link.


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