Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,887,056 members, 6,938,707 topics. Date: Wednesday, 29 June 2022 at 05:17 PM

Pls Help With This Php Program - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Pls Help With This Php Program (626 Views)

Pls Help Me With This Php Code / Help With This Php Code. / I Need Help With This Php Code For Email And Sms Autoresponse (2) (3) (4)

(1) (Reply) (Go Down)

Pls Help With This Php Program by shokergb: 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: 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: 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)

Does Anybody Know Alpha 5 / Advise Me On My Decision Plz / Any Knowledge In Mathematica

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2022 Oluwaseun Osewa. All rights reserved. See How To Advertise. 28
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.