My friend is helping me make a database where you go to a certain webpage of my site and the page will use code to pull information from a database and display it on the page in a formatted way.
Code: [Select]<?
function parse($content){
$string = $content;
/* Use <b> to split the string */
$tok = strtok($string, "<b>");
while ($tok !== false) {
$get = "SELECT Name FROM * WHERE Name = '$tok'";
$getsql = mysql_query($get);
if (!$getsql)
{
$type ="";
}
else {
$table = mysql_field_table($getsql);
$type = $table;
}
if (!$type){
$link = $tok;
}
elseif ($type == "quest"){
$link = "<a href='viewlocation.php?location_name=$tok'>$tok</a>";
}
elseif ($type == "item"){
$link = "<a href='viewlocation.php?location_name=$tok'>$tok</a>";
}
else {
$link = $tok;
}
echo $link;
$tok = strtok("</b>");
}}
?>
My friend explains the issue as follows:
QuoteBasically the script uses the tok to split the string up, then im trying to get it to check the whole database name fields for the split.
Then if it finds it, its supposed to get the table name its in and passes it to the if statement.
It splits the string into sections then searches the database for the sections by looking in a specific field over all tables
Then when its found it takes the table it found it in and get the name of the table which gets passed to the if statement which decides which link it will give to the end of the code which gets returned.
But its not doing the search in the database properly and not getting the table name to pass to the if statement to work out the link to give it.
validating url
im trying to validate url's sent to me by a formthe url's im collecting are for placing banners on my site so the url's are the link to there site and url of where there banner isURL's ARE BROKEN INTO
How would I do "Users not logged in since *** delete them"
I know how I would set this up, and delete the user roughly.I'll create a table called "Users Status" with ID, Username, date registered, and last logged in collumns. Last Logged in will be
Simple MySQL script is not working
Hey guys, Just familiarizing myself with PHP and MySQL. I am following along in the O'Reilly book that addresses both topics and has the platypus on the cover. At any rate, I tried typing in chapter 6
Sequre login with cookies.
I want to build secure login with cookies. I just want your ideas about this, your suggestions. What fields should go to sql table, after username and password? How to keep data in cookies safely? And
login form can you find my error?
registrationform.php seems fine send data to registration.phpregistration.php seems fine checks all data then send it to function.phpconnection.php does its job and connects to database also calls
mysql select with $_get ?
Hi, i have this code:Code: // If char id is 0 and character dont exist do:if ($_GET["id"] == "0"){die "A character ID can never be 0. This character does not exists or have
Help with some dates
I have a list of dates in an array:$mondays = array( strtotime("October 12, 2009"), strtotime("October 19, 2009"), strtotime("October 26,
Cannot Display Array from Select Statement + Login question
Hi,I'm new to PHP but so far so goog. I was assigend a project and I'm very close to completion. I have a site that logs you in, sets a cookie, and then what I would like to do is depending on the
Select question
Hi,First I would like to say that php is pretty new for me.. so please don't shoot me if this should be a stupid question!But I'm a little surpized due to following..I have a search script (very large
Option box to change variable
Hello, i need help by making a script!I need to write a file with option box, so a dropdown menu with 10 or more options, and when i select one option a button to save this option to a php variable in