GJSNeptune
[H]F Junkie
- Joined
- Mar 31, 2004
- Messages
- 12,372
Old thread was deleted, but this time I get to be more specific and create it from home with my files. I only remember maw's suggestion of using the substr() command, which seems like a pretty good way to do this.
In addition, I wanted someone's help regarding passing variables through the URL and webcrawlers not going past the question marks. Someone posted a link about working around that or changing them in the code but still rendering a URL-variable. Please post that again if you come across this.
Since the PHP tag displays variables in an eye-straining blue, I'll just use the CODE tag.
The above pulls the titles from the database table of writing pieces and displays them as links like this: Title | Title | Title | Title |, only I don't want the last link to have the "|" after it.
Also, would it be better to "title" each piece by an ID number? I'm a little uneasy about having %20 filler in URLs.
The titles will be displayed in a separate div from the content. The content div should be empty until a title is clicked, but I want the content div to display the title with an underline. I can pass the variable through and display the title in the content div when clicked, but the underline is always in there. How can I keep that div empty until a title is clicked, or maybe have "Please choose a piece" displayed.
In addition, I wanted someone's help regarding passing variables through the URL and webcrawlers not going past the question marks. Someone posted a link about working around that or changing them in the code but still rendering a URL-variable. Please post that again if you come across this.
Since the PHP tag displays variables in an eye-straining blue, I'll just use the CODE tag.
Code:
$query = "SELECT title FROM pieces";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
echo "<a href=\"poetry.php?piece={$row['title']}\">{$row['title']}</a> | ";
}
The above pulls the titles from the database table of writing pieces and displays them as links like this: Title | Title | Title | Title |, only I don't want the last link to have the "|" after it.
Also, would it be better to "title" each piece by an ID number? I'm a little uneasy about having %20 filler in URLs.
The titles will be displayed in a separate div from the content. The content div should be empty until a title is clicked, but I want the content div to display the title with an underline. I can pass the variable through and display the title in the content div when clicked, but the underline is always in there. How can I keep that div empty until a title is clicked, or maybe have "Please choose a piece" displayed.