Title: Page hyperlinking using custom php files
Last modified: August 20, 2016

---

# Page hyperlinking using custom php files

 *  Resolved [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/)
 * I been trying to figure this out for the past week and about to go crazy lol.
   I have two custom php files I created using custom templates. The first file 
   called player_stats.php selects a simple table from mysql with hyperlinks to 
   the name column in a table.
 * echo “<table border=’1′>
    while($row = mysql_fetch_array($results)){ $strName
   = $row[‘name’]; echo “<tr>”; $strLink = “” . $strName . ““; echo “<td>” . $row[‘
   team’] . “</td>”; echo “<td>” . $strLink . “</td>”; ….. When a name of the player
   is clicked it will open up the file player_details.php since the hyperlink above
   is set to player_details.php?name=” . $row[‘name’]
 * but in this case wordpress doesn’t know player_details.php file because wordpress
   doesn’t show or use .php extensions when it saves a file name.
 * How can I get the first file to look at the second file?
    I appreciate the help
   in advance!

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [luckdragon](https://wordpress.org/support/users/luckdragon/)
 * (@luckdragon)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783269)
 * why can’t you just hard link it?
 *     ```
       echo "<td><a href='player_details.php?name=".$row['name']."'>".$strName."</a></td>";
       ```
   
 *  Thread Starter [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783276)
 * I get a 404. It looks like it hyperlinks it to this:
    [http://localhost/familybowlingnyc/stats5/player_details.php?name=Billy](http://localhost/familybowlingnyc/stats5/player_details.php?name=Billy)
 * “stats5′ is the menu I created to get to player_stats.php
 *  Thread Starter [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783280)
 * when I set the hyperlink to:
    $strLink = “” . $strName . “
   “;
 * echo “<td>” . $strLink . “</td>”;
 * The page is found but nothing is query from the database. It shows a blank table.
 * The query is fine if I use it outside of wordpress.
 *  [luckdragon](https://wordpress.org/support/users/luckdragon/)
 * (@luckdragon)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783290)
 * if you are just saying `<a>` it’s not linking to anything, it could just be an
   anchor, or something similar.
 * is your player_details script in /familybowlingnyc/ or is it in a sub folder,
   if it’s in the “base” folder you just have to tweak the link
 *     ```
       echo "<td><a href='".get_option("siteurl")."/player_details.php?name=".$row['name']."'>".$strName."</a></td>";
       ```
   
 *  Thread Starter [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783296)
 * Yes its in /familybowlingnyc/ now I am getting the following:
 * Fatal error: Call to undefined function get_header()
 *  [luckdragon](https://wordpress.org/support/users/luckdragon/)
 * (@luckdragon)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783298)
 * what’s the full error, what file?
 *  Thread Starter [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783300)
 * Fatal error: Call to undefined function get_header() in C:\wamp\www\familybowlingnyc\
   stats_pagess.php on line 8
 *  Thread Starter [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783305)
 * it works if I create a new menu tab that’s custom link to the file.
 * But the player_stats.php file’s css styles sheets, header, logo, footer is missing
   obviously. I tried to include the functions and headers directories. But I keep
   getting errors.
 * What’s the best way of doing this?
 *  Thread Starter [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783311)
 * I got it to work!!!!! I used this and now all the wordpress functions became 
   available:
 * require_once(“/path/to/wordpress/wp-load.php”);
 *  [luckdragon](https://wordpress.org/support/users/luckdragon/)
 * (@luckdragon)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783313)
 * yep, that’d do it 🙂
 *  Thread Starter [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * (@as_spartans)
 * [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783321)
 * luckdragon Thanks for your help 🙂

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Page hyperlinking using custom php files’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 11 replies
 * 2 participants
 * Last reply from: [as_spartans](https://wordpress.org/support/users/as_spartans/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/page-hyperlinking-using-custom-php-files/#post-2783321)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
