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




Check For Link In Web Page.


I am putting a form on my site that will allow someone to submit a link to me. If they have a return link back to me it will effect the way I display thier link. Closer to the top of the page.

What do I have to do in order to see if my link is up on the page they submit.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Check Date And Time And Display A Link Between Certain Hours
I need to write a PHP script that can check the date and time, and if it falls in between certain hours to display a link, and if not display another link.

The application is for a realaudio broadcast which goes live 7-9pm every wednesday. If it's not "live" then the link would be to the archive from the previous show.

Extremely High Cpu Clock Usage For A Fairly Simple Back-link Check
I use the following code on a classifieds site. It checks for a backlinkevery 5 days up and gives up after 3 tries if it doesn't find a link back to my site.

I run this code in the background using require 'adlinkcheck.php'; to load this script when someone is viewing an ad on the site. Code:

Php Page Will Not Process Link To Different Page
I have just installed RH Linux ES 3.0 (basic) kernel 2.4.21-9.EL, i686,
Apache 2.0.X, and php 4.2.X. I have made no changes to the php.ini.

I am trying to use the following page (code listed here) to click on
link, and display 1 of three pages. The code does not seem to work, it
only shows the "else" condition of the php code, which is page:
"stuff.php". What do I need to do to my apache/php config to get this
to work? Of course I copied this code from a php site tutorial somewhere.

Page code below:
<?
if ($link == page2){
$page="files/page2.html";
}
elseif($link == page3){
$page="files/page3.html";
}
else{
$page="files/stuff.php";
}
?>
<html>
<head>
<title> index.php </title>
</head>
<body bgcolor="#999999">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="3"><h1>The Template (index.html)</h1></td>
</tr>
<tr>
<td align="center" valign="top"><a href="index.php?link=index">
Page 1 </a></td>
<td align="center" valign="top"><a href="index.php?link=page2">
Page 2 </a></td>
<td align="center" valign="top"><a href="index.php?link=page3">
Page 3 </a></td>
</tr>
</table>
<? include($page); ?>
</body>
</html>

Redirect At Other Link Page
by php which the fast solution for make redirection at homepage ?
Time ago read some solutions, but one most fast because not load
or not make a reload of itself page, not remember
exactly but was a solution more fast...

Link Display On Same Page?
I want to list the titles of all my articles from my database onto my webpage at articles.php. Then when the users click on each title, the individual articles will load on the same page.

I'm new to PHP/MySQL, so here is what i've done so far. row[0] as my unique id numbers for each article, and i've included it so that i can somehow tell the page to load the article related to the unique id number. Is this all making sense? Code:

Changing A More Link Into Page Numbers
I have the following code which I've tried to edit to fit some examples others have posted on here, with no luck. I have a page that displays More and Prev links but not the page numbers. How can I change this code to have page numbers instead of the More Prev? PHP Code:

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

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?

Home Link From Navigation Page
I got a code which helps me to create navigational links and only show 4 results per page. Now I want to add a link on each page such that if anyone clicks on that link it takes it to HOME page. I have added

<a href="Home.htm"><b><font size="4">Home!!</font></b></a>

inside the loop that generates NEXT and PREVIOUS page link but whenever I click on HOME it does nothing at all.

Using A Link To Change Page Content
Basically I have a page to enter data into a mysql db via a form. After the data has been input, this form disappears and instead (on the same page) the data is shown in the same format, just not editable anymore.

What I need to do is have a link that will be able to switch between the two states, being 'edit' and 'view'.

Open Link In Included Page
How to include Link that could open in same page rather than going to another page


for example, if i include a file in home.php

 <? include("/index.php") ?> and I want to open up the LINKS in  "index.php"

in same home.php.

example   - open    "/index.php?p=Hits"  on same home.php page

I know i could have FRAMES but i dont want to frames in my site

Multiple Page Link Exchange
I am in need of a PHP Link Exchange script (preferably free) that is not for single pages.  The use of this script will be for having 4 pages on the website - the home page with paid links for $1, and then 3 other pages for free link exchange (Free Links Page 1, ...2... and so on)

If you know of a script out there then please post a link to it here. It would be a huge help to me and I greatly appreciate it. I saw one almost a year ago on the HotScripts Most Poplar page, but cannot remmeber it nor find it in HotScripts now.

Check If The Page Is Not 404
How can I check if some url or address works ? If I had in my database about 1000 links, how can I check if they work ?

Check What Page Someone Came From?
I need to find out how to see what page someone came from. I need this because I need to check if they came from a downloads.php page in order to download a file. This will stop hot linking.

How it works right now is you click a link on the downloads.php page, that sends the file id to a page called files.php. The files.php figures out which file url to get from the database. Before figures out which file url to get, I need it to see if the link on downloads.php was clicked.

Link To Form Results Page Dynamically
I have a dropdown box that pulls information from a database. What I want to achieve is that when a caller selects an option, the option determines that page that comes up.

I tried setting the form action to the name of the option, but this down not bring up anything; actually the resulting page is .php. I also tried moving the form action statement after ther selection, but that does not work either - the Submit button does not work. PHP Code:

Link To Local Files Through A Dynamic Page
I decided to flesh out my php skills by building a web application
which could scan through local files on my intranet (specifically
mapped drives on my server) and generate a list of Movies or pictures
or music, etc. Which worked fine, I created the code to do that and to
store the results in a mysql database. I can even print it out to a
..php page and sort it however I like.

What I can't seem to do is to create links to the data I've indexed in
a way that will let me open them from the generated php page. I've
searched and searched and there just doesn't seem a way to do this.
I'm pretty sure I've exhausted the obvious options.

The following trials did not work when the document was served from an
apache web server.

<?php
echo "<h1><a href=file:///c:/temp.txt> HEY </a></h1>";
echo "<h1><a href=file:///c: emp.txt> HEY </a></h1>";
?>
<a href=file:///c: emp.txt target="_top"> temp.txt </a>
<a href=file:///c:/temp.txt target="_top"> temp.txt </a>

When the same page was loaded directly from the file instead of served
through apache the bottom two links worked. This doesn't really help
me however. I need to be able to dynamicly generate pages that link to
the files.

I've read that browser security is the restricting factor in this but
changing all of my security settings in IE to low didn't seem to affect
it (not sure what the equivalent of security settings is in Firefox).
Does anyone know of a way to link to local files directly in a way that
lets you open them directly from the source instead of by downloading
them to a temp file or saving the file to somewhere locally? Is it
even possible in PHP?

Form Input Page To Sort With Link
I'm looking to create a page that a user can input data into a form and submit it to a mysql database.  From there I want another page to display the data sorted by a certain field of the data that was entered (i.e. Year) and then be able to click on the field that is sorted by (Year) and go to another page that displays all of the information that was originally entered.

Transfering Me To A Page When I Follow A Wrong Link..
in many sites, when i try to go to a page that doesn't exits, it transferes me to a page saying so instead of showing the annoying page cannot be found, how to do this?

Check Whether A Page Has Changed
I am building a system which is checking remote web pages to see if they have lost the content that is related to me. Does anybody have any suggestions how this is best done?

Presuming many pages have dynamic content on them not related to the content I am interested in, would it be best to just do a substr() of the content looking for the bit I am interested in?

Check What Previous Page Was?
I would use this code to check what the current page is.

$realname = basename($_SERVER[SCRIPT_FILENAME], ".php");

if ($realname == 'index.php?cmd=index')
{
   do stuff
}

But, instead of the current page, any ideas how I would use that (it can be different if neccessary) to check if the PREVIOUS page was index.php?cmd=index'?

Making A 'Go Back' Link From An Errorous Feedback Page
I am working on a 'contact' page on my website. All the code is in contact.php When $name, $email and $message are uninitialised, the page loads with all the input fields.

If they are initialised, the page checks for errors. If there are no errors, a "success" message is displayed. If there are errors, the errors are displayed. In addition to displaying the errors, I'd like to have a link which goes back to the input fields (i.e. contact.php without $name, $email and $message initialised).

Making a link to contact.php does not work, as the variables are still initialised, I think, and therefore all the error messages are just displayed again. Hitting 'Back' in the browser works well - how do I make a link 'go back' though? (I think I saw some javascript 'go back' commands a few times before...)

Hitting 'Back' in the browser unfortunately resets/clears all the fields, if something was typed in. I'd like it if the fields would not be reset/cleared. Could I please get some advice on how I can solve this problem please? If I need to use cookies, sessions or something like that, then just let me know how I can make a 'go back' link - I don't know how to use cookies / sessions atm, and right now I don't feel like learning to use them.

Encrypting Variable Values Passed Thru A Link In A Web Page
I am working on a project in PHP / Mysql on linux platform. The project has a login page where any registered user is supposed to login before he/she can have access to some major functionalities in the project.

Since I need to check the authenticity of the user in other secured pages, I have to carry forward the username with which he/she has logged. As I am doing so, the username is appearing in the url. This of course is a major security lapse.

PEAR Auth - Check On Each Page
I have a framework working where I have multiple pages each checking the
authentication status.

Unauthorised users are redirected to a login page - otherwise the requested
page is shown.


Now my question is just to get a little clarification.

On the login page I create and object of type Auth

$a = new Auth("MDB2", $options, "loginFunction");

and then run

$a->start();

Fine so far.

Now at the top of the each authorised-only page I create a new Auth object
and then check the auth status.

$a = new Auth("MDB2");

if (!$a->checkAuth()) {

HTTP::redirect("login.php");
}

My question is that the new Auth object - $a - can be created with *any*
parameters. It could even be:

$a = new Auth("DB");

And the check works fine.

Do I take it that the Auth object only needs the correct container and
options set up when it runs the start() method? If the name/password come
back in as POSTED correctly then start() will create session variables.

And I take it that these session variables can then be checked by any old
invocation of Auth?

PHP To Grab Page TITLE And Check For 404 Help
I am looking for a way to pull the <TITLE> from a web page. Does anyone know
a PHP routine or method that can help?

Also, I am looking for a way to test if a page is active. The ping returns
the website is there (But also returns true on a 404 error), But I want to
know if a page is "dead" (404 or other error) or active.

Check If The Page Exists On A Server
i have a set of links and that will be scrolled monthly, and i want to check if any of the links are broken and want to mail the broken links to the admin. now how do i check if the links are broken ?

Html Page Link Prints Path 3 Times In Header
I have a website with html pages and a php page (a form). I just put in links on the html pages to the php page. When I click them I go to the php page and as bonus the path of the html page is printed at the top three times. (The text in the php page changes depending on which page I have hit the link from.) For example:

Quote: http://mysite.com/sitefolder/previouspage.htmlhttp://mysite.com/sitefolder/previouspage.htmlhttp://mysite.com/sitefolder/previouspage.htmlhttp

If I highlight and then delete this text in Navigator or Explore both browsers return me to the page written out three times at the top of the page. Here is the code that is giving me this result. Code:

A Web Development QUICK LINK PAGE (QLP) - HTML, Perl, PHP, JavaScript, AJAX, CGI, Etc.
I've recently organized and even color-coded many of my favorite
bookmarks on WEB DEVELOPMENT (and a few other favorite subjects too)
into what I call QUICK LINK PAGES. These are very condensed, compact
(no graphics), fast-loading pages with a 100+ links to some of my
favorite web sites on a particular subject. I hope you'll give them a
try...

Here's the link...

The easy-to-remember link above gets you to one of the Quick Link Pages
(QLP). The current categories (DIVERSIONS, INVESTING, JAZZ, MACINTOSH,
OPERA, PHYSICS (with ASTRONOMY and MATHEMATICS), SPORTS, WEB
DEVELOPMENT, and WINDOWS) are color-coded on the top of every page.
Just click your favorite category. I hope you'll find a lot to enjoy.
If you find any errors, or have suggestions for additional links or
categories,

How To Change Template Menu Link Text Color For Page Currently Viewed ??
Say you have a left menu that stays the same on every page within in your site. Obviously you would make this menu a template or library item, so that when you edit one version, all the others are updated.

Let's say the left menu is the following:

Page_1
Page_2
Page_3

Now, when I am viewing Page_1, I want the "Page_1" text in the left menu to be red, so that the viewer knows what page they are on. When I click on the left menu link for "Page_2", then I want the "Page_1" text to go back to black and the "Page_2" text to be red.

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?

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.

Page Expired After Going Back From Del. Pageto Form Page Where Comment Is Submitted..
i've made a submit comment form with php and mysql, the form has an action to itself with a hidden var like this: input type=hidden action=add

When i delete a comment on the page i go to a page called delete.php3 and there is a link with a javaline which goes -1 back in my history..

When ive added a comment, the comments page contains action=add and when i delete a comment, i want to click on the link to go back to the comment page, but then, it doesnt work and it says:

Page has expired.

I wondered how to deal with this kind of problems........

Page Has Expired Message In Between The Php Page When I Click Back In Explorer Menu
I have a php script page, which is basically quiz. Visitors (after login in
with their email address) are supposed to answer each question, and when
they click the button at the bottom, the next page will show which problems
they got right or wrong.

Now my visitors, after seeing some problems they got wrong, click Back
button at the Explorer menu, and if they do, they get the below message:
=========================
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available. As a
security precaution, Internet Explorer does not automatically resubmit your
information for you.

To resubmit your information and view this Web page, click the Refresh
button.
========================
Below are the script that I am using. This scripts are after initial login
page, which asks for visitor's email address. I have authorized visitors
already in my MySQL table, and only the visitors whose email address is in
my MySQL table are allowed to login......

Session Var Is Setting ONLY AFTER I Reload Page, Form Var Displays First Page Load
Page1 has a form that calls Page2. The beginning of Page2:
<? php session_start();
$s=$_POST['sSelected'];
session_register("s"); ?>

in the middle of Page2 I have a form varaible:
<?php echo $_POST['stateSelected']; ?>
<?php echo $_SESSION['s']; ?>

The form var displays the first time the page loads. The session var
displays only after reloading the page2.

Transfer Session_id() Between A Secure Page To An Unsecure Page - SSL
I am having problems understanding how to transfer session_id() between a
secure page to an unsecure page. When I move from the secure page to the unsecure page the session_id changes.

Here is the script:

Secure page:
<?php
session_name('thename');
session_start();
echo session_id();
..
..

[refreshing A Php Page Resulting Page Cannot Be Found Error]
i have a php page that will refresh by itself by using a meta tag and meta timer. however, without a clear indication, my page will just go "Page cannot be found". bizzarre but when i press refresh, the page can be found!. i am not sure whether this is an IE problem or issit my script problem. i don't encounter this problem if it's just a plain file.html.

perhaps is my session string? i am passing my session thru the URL and i constantly refreshing it. is that the problem? my url looks like this: domain.com/myfile.php?authorize=mike&token=f5c0f7edd785a6a9448c50249bad18ed

Page Control - Next/previous Or Select Page Number
I'm looking for php script examples that will help me control page layout. Using a table with 12,000 records, would like to be able to display only 5 records per page with page controls at the bottom of the page. The bottom edge would have next/previous or an optional insert desired page number.

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";
}
?>

Launch New Page And Refresh Exisiting Page
I know about not being able to change header info after output to the browser but what are the workarounds if any?

I have a basic form where a user logs in - the details they submit are verified in supportlogin.php and then if successful I launch another browser window with Javascript but the window in that they logged in at remains on supportlogin.php and is blank... How can I launch the new window and send the first window back to the login page? PHP Code:

If Value =1 Direct To Page Otherwise Show Data On Page
In the member account area there is a button saying (list) when the member clicks this they are redirected to add.php here i am wanting to check if a members account is limited, if it is direct them to a page saying you must pay your bill. if its not display the info on the page.

in the database there is a field called limited which is tiny in if its not limited the value of the field would be 0 if it is limited the value would be 1.

Keeping Lots Of Values From Page To Page
I am doing an online questionnaire which is going to have 5 questions per page and upto 100 questions.

If somebody hasn't completed the entire questionaire I do not want their data stored in the DB. I was wondering if anybody can tell me the best way to either use sessions to store the data and do a final update at the end, or use a temporary db table to hold the data.

Page Rotator Without Leaving The Actual Page...
I'm trying to write a homepage page rotator. The home page is default.php and I want 3 pages to rotate in that file without leaving default.php or directing to the actual pages I'm rotating... Basically, a content rotator but I want the content to be individual pages.

Here is what I have but it seems I have a bug somewhere:

<?
$pages = array(
include(page1.php),
include(page2.php),
include(page3.php)
);

shuffle($pages);
$i=0;
$number=2; while(list(, $page) = each($pages)) {
if ($i>=$number) { break; }
echo "$page";
echo '<br>'
$i++;
}
?>

For some reason the pages aren't coming up right in the default.php page.

Passing A Parameter From An HTML Page To A PHP Page
I want to pass a language value (EN/FR/DE etc.) from an Index HTML page to a PHP page with a language code in the call, so that the PHP page can select texts in that language. I would like to to it from an unordered list item if possible by extending the link ... <li><a href="scripts/pricelist.php???>Pricelist[/url]</li>

Login Page Produces Blank Page
What I get when I enter username/password and hit submit is a blank page and the URL never changes. In other words, the login page is 'index.php' and when submitted it should redirect to 'admin.php'. Instead the url/address stays at 'index.php' and the page turns completely blank.

In the previous thread, the problem turned out to be some missing indicator to the md5 encrypted password. Well, in this version, that's there! In fact, I used the ending scripts for that project in creating this project. So, why it won't work is a real mystery. Code:

Displaying Parts Of A Page While The Page Is Not Complete Yet
A script I'm writing outputs a HTML table with many rows. Each row is the result of a query which takes about one minute to perform. When I run the script in a browser, the page takes several minutes to load and then displays the entire table. Is it possible (using PHP) to display the table as it gets constructed, one row at a time?

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?


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