ahmed17 Posted October 11, 2006 Share Posted October 11, 2006 hello..,i create news script to display news but i want to display the subject of news into javascript page and there's problem ,if user select the title of news how i can make select title tie to its subjecthere's script 1st:database[code]CREATE TABLE `news` (`id` TINYINT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,`title` VARCHAR( 50 ) NOT NULL ,`subject` VARCHAR( 51 ) NOT NULL) ENGINE = innodb;[/code]php code:========[code]<!doctype html public "-//W3C//DTD HTML 4.0 //EN"><html><head> <title>Title here!</title></head><body><?php$host="localhost";$user="root";$pass="";$database="news";$table="news";$link = mysql_connect('localhost', "$user", "$pass")or print"failed connection"; mysql_select_db($database,$link)or print "not exists"; $_sql="INSERT INTO $table(title,subject)VALUES('my test script...news','this is my topic')";$result=mysql_query($_sql,$link);/*if($result){ echo"sucess entery data";}else{ echo"failed entery data";} */$query=("select * from $table");$result= mysql_db_query($database,$query,$link);?><table width=100% height=100><tr><td bgcolor=iceyellow><marquee direction="right" onmouseover="this.scrollAmount=0" onmouseout="this.scrollAmount=4"> <? while ($row = mysql_fetch_assoc($result) ) { $title =$row['title']; $subject =$row['subject']; echo "<a href='inselect.php?title=$title'>.::::.$title</a>"; } ?></marquee></td></tr></table></body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/ Share on other sites More sharing options...
JasonLewis Posted October 12, 2006 Share Posted October 12, 2006 what do you actually mean? the code is fine from my looking. i really don't no why your actually trying to do... Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-107745 Share on other sites More sharing options...
ahmed17 Posted October 12, 2006 Author Share Posted October 12, 2006 thanks, i want to display the subject of news into javascript page Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108091 Share on other sites More sharing options...
ahmed17 Posted October 12, 2006 Author Share Posted October 12, 2006 :) ? Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108133 Share on other sites More sharing options...
ahmed17 Posted October 13, 2006 Author Share Posted October 13, 2006 help me ? Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108355 Share on other sites More sharing options...
HuggieBear Posted October 13, 2006 Share Posted October 13, 2006 What do you mean by 'into javascript page' do you have a working example on a site somewhere? Where did the idea come from?RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108385 Share on other sites More sharing options...
ahmed17 Posted October 13, 2006 Author Share Posted October 13, 2006 when i uer selct the titlt then he will move to page where the subject of news display so i want the subject display in javascript page not in normal page and the way to do that ? Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108518 Share on other sites More sharing options...
ahmed17 Posted October 13, 2006 Author Share Posted October 13, 2006 important help ??? Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108544 Share on other sites More sharing options...
ahmed17 Posted October 14, 2006 Author Share Posted October 14, 2006 display news in page like this[img]http://www.mo3afa.com/dros/mo3afaup/upload.php?aa=11608365104069[/img] Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108791 Share on other sites More sharing options...
HuggieBear Posted October 14, 2006 Share Posted October 14, 2006 Oh, so you want it to open in a new window...That's not a php issue, it's HTML/JavascriptTry googling for [url=http://www.google.co.uk/search?hl=en&q=javascript+%2B%22open+new+window%22&meta=&btnG=Google+Search]javascript +"open new window"[/url]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108851 Share on other sites More sharing options...
ahmed17 Posted October 14, 2006 Author Share Posted October 14, 2006 but how i can use it to display news ? Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-108882 Share on other sites More sharing options...
ahmed17 Posted October 15, 2006 Author Share Posted October 15, 2006 plz help me ? Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-109160 Share on other sites More sharing options...
JasonLewis Posted October 22, 2006 Share Posted October 22, 2006 well you could just do a javascript popup with the id in it. example:[code]<a href="javascript: openpopup('1');">Open News</a>[/code]then in your openpopup() javascript function have it open a php page like http://www.site.com/news/java_popup.php?newsid=1 then just get the news info from the database by using the newsid.but i am still not sure on what your asking. Quote Link to comment https://forums.phpfreaks.com/topic/23709-display-news/#findComment-112580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.