₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,073 members, 8,420,171 topics. Date: Thursday, 04 June 2026 at 12:47 PM

Toggle theme

Pls Help With This Php Program - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingPls Help With This Php Program (769 Views)

1 Reply (Go Down)

Pls Help With This Php Program by shokergb(op): 9:08am On Jan 25, 2011
problem1.
I am trying to display some contents inserted into a database with php with hyper links and a little sentence using substrings just like google search,after I have used a wild card search to search and display the page,the result is a one page display but what I want is several hyperlinks with some text like google.
problem 2.
when the hyper link is clicked I want a whole page or chapter to be displayed.
Re: Pls Help With This Php Program by joefazee(m): 11:01am On Jan 25, 2011
try something like this

1. search.php
$result = array(, )
foreach($result as $links) {
// Your links goes here
// truncate some part of the text,
echo "<a href='full_search.php?content_it="{$links['id']}">. $links['title'] . "</a>";
}

2. full_search.php
# Remember to escape incoming data
$content_id = (isset($_GET['content_id']) ? intval($_GET['content_id']) : 0;

if($content_id > 0) {
// Here query or method to fetch single row
// SELECT * FROM table WHERE content_id = $content_id
//
}else{
// You can display error message here
}

The above code may not work, i`m just trying to show you steps to take
Learn how to use Framework instead of hardcore coding.
Re: Pls Help With This Php Program by shokergb(op): 12:25pm On Jan 25, 2011
can I do this,is the syntax correct.

$result = array("select * from database"wink;
foreach($result as $links) {
echo $links
echo "<a href='full_search.php?content_it="{$links['id']}">. $links['title'] . "</a>";
}
would it display several rows??
Re: Pls Help With This Php Program by shokergb(op): 1:24pm On Jan 25, 2011
can I also use the for each loop in place of this while loop

while($row = mysql_fetch_array($result)){
}
Re: Pls Help With This Php Program by sweetpawn1: 6:16pm On Jan 27, 2011
HELLO SHOK,
THE SOLUTION TO YOUR PROBLEM IS HERE: https://www.nairaland.com/nigeria/topic-592012.0.html !
1 Reply

Pls Help Me With This Php CodeHelp With This Php Code.I Need Help With This Php Code For Email And Sms Autoresponse234

I Want To Be A Pro- Web Designer, Which Languages Should I Learn?Microsoft 9japps ChallengePls Help...