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 Quote Link to comment Share on other sites More sharing options...
papaface Posted March 14, 2007 Share Posted March 14, 2007 How exactly is this a php issue... Quote Link to comment 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> Quote Link to comment 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? Quote Link to comment 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]"; Quote Link to comment 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>)"; Quote Link to comment 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>)"; } ?> Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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.