orange Posted October 17, 2005 Share Posted October 17, 2005 (edited) hey im starting with a small linkdump for my friendsso the links they add are stored in link.txt nowi cant figure out how to let the link open in a new windows iframeto a new page wasnt such a big problemits all stored in the add.php and afterwards he shows the parsed txtcontent of add.php<?phpinclude "style.php";$filename = 'link.txt'; // edit thisfunction addlink($link_name,$link_url,$by,$email) {global $filename;$html = "<a href='$link_url' target='_blank'>$link_name</a>, posted by <a href='mailto:$email'>$by\n";$fp = fopen($filename, 'a+');fputs($fp, $html) or die("Could not open file!");echo 'The link was added successfully.<br><br>';}function showlinks() {global $filename;$html = implode('<br/>',array_reverse(file($filename)));echo $html;}If (!$link_url){ print "You must enter a Link Address";} elseif (!$link_name){ print "You must enter a Link Name";} elseif (!$by){ print "You must enter your Name";} elseif (!$email){ print "You must enter a Email Address";} else { addlink($link_name,$link_url,$by,$email); print "<b>Existing Links</b>:<br>"; // adds new link showlinks(); // display's list of links}?>how can i load the page that he gets out of a txt to load in a page with an iframe the content of the link.txt<a href='http://www.msfn.org' target='_blank'>Microsoft Software Forum Network </a>, posted by <a href='mailto:the_orangeman@hotmail.com'>orangemaybe another solution is that i can add the nfo to the mysql db that i got but i dont know how to get data out of the dbthe script is located @ hxxp://orange.djhost.nl/linkdumpif anyone can help me it would be nice it can be done i know i website that has it but the webmaster dont give out the script (i understand it) so im looking for my self how to get out of this problem that website that has this feature is hxxp://www.linkdump.benote im a newbie with making websites i get alot of help from my friends also one here from the board but i cant keep asking the same people over and over again but if anyone is willing to help me im gratefull Edited October 17, 2005 by orange Link to comment Share on other sites More sharing options...
TomcaT Posted October 21, 2005 Share Posted October 21, 2005 I am not sure if this will do what you want, but here goes:In your HTML/PHP code:<iframe id="NAMEYOURFRAME" src="whateverfile.htm"></iframe>In your PHP, change the fragment marked in bold:$html = "<a href='$link_url' target='_blank'>$link_name</a>Change it to target='NAMEYOURFRAME'Hope it helps? Link to comment Share on other sites More sharing options...
orange Posted October 22, 2005 Author Share Posted October 22, 2005 Thanx tomcat but the problem is that the url's that i want to use are stored in a text file and a php script gets it out of the textfile Link to comment Share on other sites More sharing options...
Stalkie Posted January 8, 2006 Share Posted January 8, 2006 That can be done in a number of ways, and the old text-based "database" isn't the best solution, but it's not impossible.I would probarly use a regular expression:$s = '<a href="http://www.msfn.org" target="_blank">Microsoft Software Forum Network </a>, posted by <a href="mailto:the_orangeman@hotmail.com">orange';preg_match('^<a href="([^"]+)', $s, $matches);$link_addr = $matches[1];Now, I haven't tested the above code, but it should help you on the right path :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now