Boxerman
Members-
Posts
275 -
Joined
-
Last visited
Everything posted by Boxerman
-
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
I changed the whole code for that and when on story.php?id=90 it is still displaying all the news :S -
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
That is the full code! promise! it calls header.php which contains most of the coding... and i added that part in which still displaying all <?php include("include/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" href="style.css" type="text/css" /> <title></title> <script language='javascript' type='text/javascript'> <!-- var win=null; function NewWindow(mypage,myname,w,h,pos,infocus){ if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;} else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20} settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=yes,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings); win.focus();} // --> </script> </head> <body> <div id="header"></div> <div id="container"> <ul id="topmenu"> <li><a href="index.php">Home index</a></li> <li>-</li> <li><a href="contact.php">Contact Us</a></li> <li>-</li> <li><a href="report.php">Report A Error</a></li> </ul> <div id="menucontent"> <div id="links"> <div id="menu"> <h3>Menu</h3> <ul id="linksmenu"> <li><a href="index.php">Home</a></li> <li><a href="request.php">Request</a></li> <li><a href="chart.php">Chart</a></li> <li><a href="javascript:NewWindow('miniversie.php','miniversie','250','320','custom','front');"> mini versie </a></li> </ul> <div id="menulast"></div> </div> <div id="menu"> <h3>Media</h3> <ul id="linksmenu"> <li><a href="music.php">Music</a></li> <li><a href="videos.php">Videos</a></li> <li><a href="http://facebook.com/truvibefm" target="_blank">Facebook</a></li> <li><a href="javascript:NewWindow('miniversie.php','miniversie','250','320','custom','front');">Player</a></li> </ul> <div id="menulast"></div> </div> <div id="menu"> <h3>Link</h3> <ul id="linksmenu"> <li></li> <li></li> <li></li> </ul> <div id="menulast"></div> </div> </div> <div id="rechts"> <div id="rechtscontent"> <h2></h2> <ul> <p><?PHP /* function to return the first N words of a string */ function shorten_string($string, $wordsreturned) { $retval = $string; $array = explode(" ", $string); if (count($array)<=$wordsreturned) { $retval = $string; }else{ array_splice($array, $wordsreturned); $retval = implode(" ", $array)." ..."; } return $retval; } /* create query */ $query = "SELECT * FROM news ORDER BY id"; /* execute the query */ $result = mysql_query($query); /* check to see if an article has been selected */ if(!$_GET['id']) { $id = 0; }else{ $id = (int) $_GET['id']; } /* set the number of words for the brief */ $N = 15; /* loop thru the results */ while($row=mysql_fetch_array($result)) { $title = $row['title']; $posted_by = $row['postedby']; $brief = shorten_string($row['text'], $N) ?> Title: <?PHP echo $title; ?> <br> Posted By: <?PHP echo $posted_by; ?> <br> <a href="story.php?id=<?PHP echo $row['id']; ?>"><?PHP echo $brief; ?></a> <?PHP if($article_id == $row['id']) { echo "<br>" . $row['text'] . "<hr>"; }else{ echo "<br>"; } } ?> -
are you putting them in tags? <?php code ?>
-
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
Hi, when using this code: <?php include("include/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" href="style.css" type="text/css" /> <title></title> <script language='javascript' type='text/javascript'> <!-- var win=null; function NewWindow(mypage,myname,w,h,pos,infocus){ if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;} else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20} settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=yes,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings); win.focus();} // --> </script> </head> <body> <div id="header"></div> <div id="container"> <ul id="topmenu"> <li><a href="index.php">Home index</a></li> <li>-</li> <li><a href="contact.php">Contact Us</a></li> <li>-</li> <li><a href="report.php">Report A Error</a></li> </ul> <div id="menucontent"> <div id="links"> <div id="menu"> <h3>Menu</h3> <ul id="linksmenu"> <li><a href="index.php">Home</a></li> <li><a href="request.php">Request</a></li> <li><a href="chart.php">Chart</a></li> <li><a href="javascript:NewWindow('miniversie.php','miniversie','250','320','custom','front');"> mini versie </a></li> </ul> <div id="menulast"></div> </div> <div id="menu"> <h3>Media</h3> <ul id="linksmenu"> <li><a href="music.php">Music</a></li> <li><a href="videos.php">Videos</a></li> <li><a href="http://facebook.com/truvibefm" target="_blank">Facebook</a></li> <li><a href="javascript:NewWindow('miniversie.php','miniversie','250','320','custom','front');">Player</a></li> </ul> <div id="menulast"></div> </div> <div id="menu"> <h3>Link</h3> <ul id="linksmenu"> <li></li> <li></li> <li></li> </ul> <div id="menulast"></div> </div> </div> <div id="rechts"> <div id="rechtscontent"> <h2></h2> <ul> <p><?PHP /* function to return the first N words of a string */ function shorten_string($string, $wordsreturned) { $retval = $string; $array = explode(" ", $string); if (count($array)<=$wordsreturned) { $retval = $string; }else{ array_splice($array, $wordsreturned); $retval = implode(" ", $array)." ..."; } return $retval; } /* create query */ $query = "SELECT * FROM news ORDER BY id"; /* execute the query */ $result = mysql_query($query); /* check to see if an article has been selected */ if(!$_GET['id']) { $id = 0; }else{ $id = (int) $_GET['id']; } /* set the number of words for the brief */ $N = 15; /* loop thru the results */ while($row=mysql_fetch_array($result)) { $title = $row['title']; $posted_by = $row['postedby']; $brief = shorten_string($row['text'], $N) ?> Title: <?PHP echo $title; ?> <br> Posted By: <?PHP echo $posted_by; ?> <br> <a href="story.php?id=<?PHP echo $row['id']; ?>"><?PHP echo $brief; ?></a> <? } ?> When i click link to story.php?id=2 it is displaying all the news not just id=2? Have i done something wrong? -
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
Just looked at script and i needed to edit: <a href="index.php?id=<?PHP echo row['id']; ?>"><?PHP echo row['$text']; ?></a> so i fixed that.. now it displays and works. if i wanted to link all i would need is to add <?PHP echo row['id']; ?> ? -
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
what last bit of my script? thats the whole page. and its not displaying anything... its just a white page :S -
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
Still confused.. as it is not working :S This is my full site code: <?php include("include/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" href="style.css" type="text/css" /> <title></title> <script language='javascript' type='text/javascript'> <!-- var win=null; function NewWindow(mypage,myname,w,h,pos,infocus){ if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;} else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20} settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=yes,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings); win.focus();} // --> </script> </head> <body> <div id="header"></div> <div id="container"> <ul id="topmenu"> <li><a href="index.php">Home index</a></li> <li>-</li> <li><a href="contact.php">Contact Us</a></li> <li>-</li> <li><a href="report.php">Report A Error</a></li> </ul> <div id="menucontent"> <div id="links"> <div id="menu"> <h3>Menu</h3> <ul id="linksmenu"> <li><a href="index.php">Home</a></li> <li><a href="request.php">Request</a></li> <li><a href="chart.php">Chart</a></li> <li><a href="javascript:NewWindow('miniversie.php','miniversie','250','320','custom','front');"> mini versie </a></li> </ul> <div id="menulast"></div> </div> <div id="menu"> <h3>Media</h3> <ul id="linksmenu"> <li><a href="music.php">Music</a></li> <li><a href="videos.php">Videos</a></li> <li><a href="http://facebook.com/truvibefm" target="_blank">Facebook</a></li> <li><a href="javascript:NewWindow('miniversie.php','miniversie','250','320','custom','front');">Player</a></li> </ul> <div id="menulast"></div> </div> <div id="menu"> <h3>Link</h3> <ul id="linksmenu"> <li></li> <li></li> <li></li> </ul> <div id="menulast"></div> </div> </div> <div id="rechts"> <div id="rechtscontent"> <h2></h2> <ul> <p><?PHP /* function to return the first N words of a string */ function shorten_string($string, $wordsreturned) { $retval = $string; $array = explode(" ", $string); if (count($array)<=$wordsreturned) { $retval = $string; }else{ array_splice($array, $wordsreturned); $retval = implode(" ", $array)." ..."; } return $retval; } /* connect to db */ include ('include/config.inc.php'); /* create query */ $query = "SELECT * FROM news ORDER BY id"; /* execute the query */ $result = mysql_query($query); /* check to see if an article has been selected */ if(!$_GET['id']) { $id = 0; }else{ $id = (int) $_GET['id']; } /* set the number of words for the brief */ $N = 15; /* loop thru the results */ while($row=mysql_fetch_array($result)) { $title = $row['title']; $posted_by = $row['postedby']; $text = shorten_string($row['text'], $N) ?> Title: <?PHP echo $title; ?> <br> Posted By: <?PHP echo $posted_by; ?> <br> <a href="index.php?id=<?PHP echo row['id']; ?>"><?PHP echo row['$text']; ?></a> <?PHP if($id == $row['id']) { echo "<br>" . $row['text'] . "<hr>"; }else{ echo "<br>"; } } ?> -
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
Thats what i need help with.. At the moment my homepage is something a short version... I've made a page called story.php i want it to be like story.php?id=1 and that will grab all the news for id 1 and then story.php?id=2 will just grab all news for id number 2 etc.. -
Displaying part news one 1 page and full on another
Boxerman replied to Boxerman's topic in PHP Coding Help
Im just after a bog standard one pal... Im got a blank page... just confused on how to call the info onto that page etc.. -
Hi, Im a little confused on how to go about setting up a news section. i.e On my homepage i got it displaying Title: Postedby: brief: i would like a read more button... So it will go around index.php?news=$idfullstory (something like that) and on that page it will automatically show the full story etc.. Just a bit confused, so can someone break it down or even better point me in the right direction please? Thanks, J
-
Hi guys, How would i store the data of what has been searched? so say google search bar, you type phpfreaks and i want it to store on the database for say 30 days... how would i go about doing this?
-
JL5501 THANKS YOU SIR!!!
-
ok i changed it and when i go the url is index.php?route=MTCH-MTPP but on my php the REQUEST is only if (isset($_REQUEST['MTCH-MTPP'])){ what else could be causing no show?
-
Hi, theres a problem everytime i click it, it goes to this index.php?=MTCH-MTPP which is almost right.. i cant figure out where the = is coming from :S if that wasnt there it would work!
-
Hi guys, Im trying to get it so when a user selects something from the list it will update the URL and post the route.. heres my code <p>Preferred routes:</p> <form method="get" action="?"> <p>MTPP ARRIVALS</p> <p><select size="1" name=""> <option>MTCH-MTPP</option> <option>KJFK-MTPP</option> <option>KMIA-MTPP</option> <option>KFLL-MTPP</option> <option>TFFR-MTPP</option> <option>CYUL-MTPP</option> <option>TNCM-MTPP</option> <option>KBOS-MTPP</option> <option>CYYC-MTPP</option> <option>TNCC-MTPP</option> </select><input type="submit" value="Generate Route" name=""></p> <p><?php if (isset($_REQUEST['MTCH-MTPP'])){ echo "HCN G444 NOKEN PAP"; } ?> so it will be like index.php?MTCH-MTPP POSTS ROUTE HERE thanks
-
I have lots... still displays it...
-
how do i make it a module??? and FACEPALM?
-
its using this kinda stuff $page->AddModule("center","news","news");
-
could it be using smarty? or some other coding?
-
http://www.uksbestsite.com/movies/index.php?page=news this is the code now... <?php $con = mysql_connect("localhost","*****","*****"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("movies", $con); $result = mysql_query("SELECT * FROM news") or die(mysql_error()); $num = mysql_num_rows($result); echo "<p><h1>".$num."</h1></p>"; while($row = mysql_fetch_assoc($result)){ echo '<div style="width:400px; padding:3px; margin-bottom:8px; float:left; clear:both;">'; echo '<div style="width:90px; float:left;">'; echo '<img src = "'.$row['image'].'" style="border:2px #333333 solid;">'; echo '</a>'; echo '</div>'; echo '<div style="width:300px; float:right;">'; echo '<h3>'.$row['title'].'</h3>'; echo $row['story']; echo '</div>'; echo '</div>'; } ?>
-
http://www.uksbestsite.com/movies/info.php
-
ive tryed both... they both dont work... what now?
-
mysql_connect will work just fine
-
i was trying different stuff... check it now...