illuz1on Posted March 14, 2007 Share Posted March 14, 2007 hey, this is how my code looks at the moment for viewing MORE INFO on the NAME of a beach.. echo "<b>$name</b>" . "-" . "<a href=viewdetails.php?id=".$id."> More Info</a><br>"; I want to make that open up in a new window without scrollbars and etc, can anyone help me do this? Thanks Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/ Share on other sites More sharing options...
papaface Posted March 14, 2007 Share Posted March 14, 2007 How exactly is this a php issue... Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207012 Share on other sites More sharing options...
mfindlay Posted March 14, 2007 Share Posted March 14, 2007 heres some javascript to do the trick <script type="text/javascript"> <!--Hide script from old browsers function newWindow(newContent) { winContent = window.open(newContent, 'nextWin', 'right=0, top=20,width=792,height=570, toolbar=no,scrollbars=no, resizable=no') } //Stop hiding script from old browsers --> </script> use this for url: <a href="javascript:newWindow('page.html')">View page</a> Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207015 Share on other sites More sharing options...
illuz1on Posted March 14, 2007 Author Share Posted March 14, 2007 Thanks mfindlay.. Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/capetown/public_html/view.php on line 33 Trying to do this now: // Echo beaches name + More Info link echo "<b>$name</b>" . "-" . "<a href=viewdetails.php?id=".$id."> More Info</a><br>"; echo "<a href="javascript:newWindow('viewdetails.php?id=\".$id.\"')">$name</a>"; and ideas? Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207019 Share on other sites More sharing options...
aebstract Posted March 14, 2007 Share Posted March 14, 2007 You didn't \ out all of your "s echo "<a href=\"javascript:newWindow('viewdetails.php?id=\".$id.\"')\">$name[/url]"; Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207021 Share on other sites More sharing options...
mfindlay Posted March 14, 2007 Share Posted March 14, 2007 see below... echo "(<a href=\"javascript:newWindow('viewdetails.php?id=\"'.$id.'\"')\">'.$name.'</a>)"; Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207026 Share on other sites More sharing options...
illuz1on Posted March 14, 2007 Author Share Posted March 14, 2007 Thanks for the quick responses guys, much appreciated.. I tried that and it doesnt seem to create the link properly.. http://www.capetownalive.co.za/view.php Below is the code of view.php <script type="text/javascript"> <!--Hide script from old browsers function newWindow(newContent) { winContent = window.open(newContent, 'nextWin', 'right=0, top=20,width=792,height=570, toolbar=no,scrollbars=no, resizable=no') } //Stop hiding script from old browsers --> </script> <?php require_once("db.php"); //select statement example ok all book entry's lol. $sql = "SELECT * FROM beaches"; $data = mysql_query($sql); while($record = mysql_fetch_assoc($data)) { // Short vars $id = $record['id']; $name = $record['name']; $picture = $record['picture']; $rating = $record['rating']; $sdesc = $record['sdesc']; // Echo beaches name + More Info link echo "(<a href=\"javascript:newWindow('viewdetails.php?id=\"'.$id.'\"')\">'.$name.'</a>)"; } ?> Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207032 Share on other sites More sharing options...
mfindlay Posted March 14, 2007 Share Posted March 14, 2007 do an echo $id just to see what value is there, then you should be able to work out whats happening Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207036 Share on other sites More sharing options...
illuz1on Posted March 14, 2007 Author Share Posted March 14, 2007 figured it out thanks, echo "(<a href=\"javascript:newWindow('viewdetails.php?id=$id')\">'.$name.'</a>)"; much appreciated everyone thanks Link to comment https://forums.phpfreaks.com/topic/42669-having-a-problem-making-this-work/#findComment-207041 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.