Jump to content

Having a problem making this work ??


illuz1on

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.