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




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:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Changing A Download Link Every 5 Minutes?
I am hosting files that can be downloadable, but I don't want sites leached off of them so can the URL to the download expire after 5 minutes?

Changing Variable String Value On A Link Click
Hi... I'm trying to change the value of my $cat variable when someone clicks on a link that consists of an image and some next

I'm not sure how to do this... but I think I need some javascript as well so if $cat="Main" and a certain link is clicked I want $cat="Something else"

Changing Variables By Clicking Text Link?
I have a page that I need to change variabels with, based on what link you click on the page.

Auto Changing Link Depending On Date
I want to have a special link on my site.
The link is to a text file located on a distributor's website and is named with a specific filename in the same format every week. In other words it's guaranteed predictable.

Here is what the file would look like,
shipping_032107.txt
which means,
shipping_(month)(day)(year).txt

How could I use something to make the link the right name without modifying my page weekly? The one tricky part is that it's updated once a week and it would be Wednesdays date each time. So it actually has to predict the next date. Perhaps if the script couldn't do that it could figure out todays date, check it to the days of the week and add a number to equal the proper day, I have no idea what to start with for this.

Changing Db Within Page
I have a php page that flips between dbs and sometimes it works and sometimes it doesn't... e.g. the first query runs from this db, the second query runs from a different db and then the third query runs from the first db again... the first query will run, the second query will run, but then the third query will not.

Each time that I switch to a query that calls a different db, I used include_once "db_whatever"; before the query, thinking that, that would work, but it doesn't... Is there something I need to do to kill the previous db connection prior to moving onto another one?

Creating Page Numbers
This is what i'm essentially trying to do.

I'm reading a load of rows from a DB (lets say 97). I want to show 10 rows in 1 page. so that would be 10 pages with 9 having 10 entries and 1 with 7 pages.

I start off with reading all the entries at once. so i get 97 rows and store it in $result.

The first problem i have is how to get the number of pages. 97/10 returns 9.7 - is there any way i can get 9? I've found that the only way to do this in PHP is with


$pages = (( $numberOfEntries - ($numberOfEntries % $numEntryPerPage)) / $numEntryPerPage);

Secondly, how would i go about making the links to the page number on top? like say 1,2,..9,10

and Third, how would i read those from the $result? Like when i click on 2 how would i go about reading rows 11 to 20?

Loops / Page Numbers
What I'm trying to do, is look through a directory, grab all the files, store it into a variable, then divide the total number of files by 25 (the amount I want on each page) then echo it onto each page. I have everything set up thus far, however, I seem to be only able to get the 1st page to show the 1-25 and each page thereafter shows up blank. 

I think the problem is where I call if ($_GET["page"]==$single_page). I've tried changing that to WHILE but it ends up looping till I get a 30 second timeout. Any ideas or suggestions?

Changing Password From Web Page
I have a need to allow a 'email only' user to change their password on the system from my home page. Normally the user does not log in.

1) need them to login to confirm user/pass
2) enable them to change pass using the _passwd_ file.
Since Apache runs as nobody I need a funtion or two to do the above.
NOT using a sql database but just the usual _passwd_ file. using Linix - RH6.0 - Apache with php3_mod I don't mind doing the reading if I know what to read!

Changing Title Of Page
does anyone know how to use PHP to change the title of a page?

Let's say my title is currently "GOGOGO" , but I want to add a string "$x" to it

so it says "GOGOGO $x", using PHP does anyone know how to do that?

Changing Text On Page Via Dropdown Box.
I have a webpage that draws various text decriptions from a mySql database. The description displayed on the page is controlled via a dropdown box. Currently I am using Javascript with a dropdown box (onChange handler) to change the value of a textbox.

Can anybody think of a way that I don't have to use a textbox(with its' scrollbars and background)? How can I change the value of a php variable by changing the selected index of a dropdown box?

Changing The Variable As You Pass It Through To The 2nd Page
I am using a form to push variables through to another page. In the form, (a drop down), the code is:

<select name="1"><option>L</option><option>P</option></select>

Now on the second page I could display the P or the L by saying <?php echo $1 ?> which is fine. What I want is, if someone selects P then it prints 1 on the next page and if they select L then it prints 2. Is this possible?

Access A Secure Page By Changing The Url
how can i stop people getting into a secure logged in page by just typing
www.somesite.co.uk/admin/index.php.

theres a login set up, but i can bypass it by just entering the url location, this is a major security issue that i need to solve relatively quickly before i publish the pages.

what i need/want is if someone isn't logged in it just goes to a page saying "you must be logged in to access this page" then prompts them to login.php.

Changing Titles Per Page With Inc Files.
The way my script is set up now, I have an index.php which calls on inc files.  The problem is that each page (inc file) is using the title set in the php.index.

My goal is to have a title for each page.  I've looked and looked but can't find anything. 

Changing An If Statement To Html Page
How do I change the following code from my process page to a new page with the detials on it. I made a html page cut and pasted it into this spot but it did not work. What do I need to change in order for it to be a html page is shows. Code:

Limiting Results, And Display Page Numbers
How do I make it so only 50 items display per page. And if there's more than 50, it displays a link "page 2", "page 3" and so on? I know how to limit results with MySQL but how do I generate pages for the next 50 within the PHP code?

Create A No-scroll List With Page Numbers ?
I have a site that lets users select a list of music based on genre etc. so each list could be made up of different tracks every time (www.makin-trax.co.uk), especially as I'm adding new tracks each month.

I'd really like a way to stop all lists from scrolling, if they are longer than the visible page. I know everyone has a different amount of viewable space on their monitors, so I need a way of restricting the list to a max of about 15 tracks per page, and a way for the user to select which page from that list they'd like to view (eg prev next first last particular page number etc.)

This is a fairly new music site, so at the moment the only list that goes past the bottom of the page is the dance genre but, as I mentioned earlier, I'm adding new tracks so all genres will become too long for a single page at some point.

Changing Pictures On Index-page When Reloading
I am a beginner but quite curious anyway.

My problem: I have seen websites that show different pictures whenever you enter the site. By doing this, the sites look always fresh and attractive and I like the idea a lot. Now I like to have the same function on my site but I do not know how that works...

Is there anybody who can give a good "explanation for dummies" on how to do that?

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>

Put Block Of Html Page Lookup Numbers Into Search Script Input
My web pages have alpha numeric lookup codes. Currently, the user has to copy the numbers and paste the numbers into a search box and click on the query button. Is there any way, other than turning the block into html hyperlinks, of getting the lookup codes into a php form input box or text box and initiating the search without copying and pasting?

Example:
pen 124:22 ; joyce 3:1 ; twice 888888:1233 ; rip 999:777

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.

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:

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.

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?

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.

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.

Change Straight Numbers Into Phone Numbers?
How can I change these two numbers into phone numbers?

5551231234
9009876789

echo INTO:

(555) 123-1234
(900) 987-6789

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?

Removing Numbers From A Set Of Numbers
Say theres a limit of number choices from 1 to 10. (not including 0)

Now these numbers are buyable so say some one buys number 7.

With a query or what ever is needed i need to find a way for the screen to then display:

1 2 3 4 5 6 8 9 10.

As you notice 7 is not missing.. but it could be any number and more than one number that has already been taken... How can this be done in PHP and MYSQL or will it require some other script?

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.

SQL And Numbers
In my database I have a field with numbers, when I arrange them DESC, it says 5819 is greater than 500355. Why is this?

My numbers show in this order:

903669
5819
500355
319
-50002

I tried clearing them and re-entering the numbers but no luck.

Php Numbers
the maximum number of $stat['cash'] i can hold in my database is 2147483647. how can i increase that?

Changing Php.ini
is there a way to change values in php.ini (like adding support for certain things) if you are not hosting your site yourself, like using a pay host?

Format Numbers With PHP
Hi!!
I want to display a number with a monetary number.
Ex. US$12,345.87 is there a function a something way to do this?
Yes , I know that I can do but if it ready why invent the wheel again!!!

Random Numbers In Php
I am trying to develop a banner ad rotator on my site. I DO NOT need to know the precise number of ads served per banner.
Therefore, I do not want phpAds as it would be overkill and slow down my site.

I have 3 banner spaces per page. Currently, I have 4 different sponsors. I just wanted to run a random number mechanism so that every tme the page is requested, 3 out of the available 4 banners are chosen automatically. So my current doe (pusedo) is something like this:

seed...
rand...
if($x=1){
banner1
banner2
banner3
}
if($x=2){
banner2
banner3
banner4
}
if($x=3){
banner3
banner4
banner1
}
if($x=4){
banner4
banner1
banner2
}

Is this the best way? I do not see his method as being very scalable as it requires me to manually input the possible combinations. I only need a simple solution that is scalable to many sponsors but since I do NOT need to know exact impression levels (all sponsors divide up the impressions equally), I do not want to use MYSQL to "kill a fly with hammer."

Format Numbers
How do you format a number into the format of (0.00)

Sorting Numbers
I'm trying to sorting a file in a directory.
It works well but it sorts me the number in this way:

1
10
11
2
20
21
....

is there a way to sort in this way?
1
2
3
...
10
11
12

this is my code:

<?php
if ($handle = opendir('/home/davide/')) {
$files = array();
while (false !== ($file = readdir($handle))) {
if (($file != "." && $file != "..") AND (eregi($select,$file)))
$files[] = $file;
}
closedir($handle);
sort($files);
foreach($files as $file) {
$ext = substr(strrchr($file, "."), 1);
if ($ext == 'txt') {
$idx = str_replace('.txt', '', $file);
echo "$idx";
}
}
}
}
?>

Formating Numbers?
I'm wanting to format numbers with ','

e.g.
100 => 100
1000 => 1,000
10000 => 10,000

and so on...


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