Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,409 members, 7,808,458 topics. Date: Thursday, 25 April 2024 at 12:14 PM |
Nairaland Forum / Science/Technology / Programming / Pls Help With This Php Program (704 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)
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" 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)
IT Contractors/Consultants - Meet Here / Bubble Level Silver Light V1.0 / What Social Gaming Technology Development?
(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 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7 |