PHP POPUPS? hehe
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
PHP POPUPS? hehe
I know this is the stupidest thing to ask but how can I create popups with php... don't ask why.... it just will make my life a whole lot easier. I know you propably can't :S but I thought I'd ask.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
K let's take a different course of action then.
and then my link was
K so thats the javascript way.... but I have a loop which is for different news headlines there is a read more function which brings up all the news articles in the news database (news.php) and it brought to the specific article..... I'm mentally stuck on this :S
Code: Select all
<script language="JavaScript" type="text/javascript">
flyer = "";
function pop_news(psjs_url){
if(flyer){
if(flyer.closed){
flyer = window.open("news.php", "flyer", "top=" + ((screen.availHeight/2) - (500 / 2)) + ",left=" + ((screen.availWidth/2) - (700 / 2)) + ",width=500,height=500,resizable=0,toolbar=0,scrollbars=1,location=0,status=0,menubar=0")
} else {
flyer.focus();
}
} else {
flyer = window.open("news.php", "flyer", "top=" + ((screen.availHeight/2) - (500 / 2)) + ",left=" + ((screen.availWidth/2) - (700 / 2)) + ",width=500,height=500,resizable=0,toolbar=0,scrollbars=01,location=0,status=0,menubar=0")
}
}
</script>Code: Select all
ї<a href="javascript:pop_news();">read
more</a>]- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
grr I'm trying it out but its not working very well.. getting a lot of errors
How do I format this properly
I know #$id will give an invalid char error... but I'm getting other errors such as 'news' undefined.
I'm not sure what to do, I tried putting all the variables in window.open in quotes... and then just their numbers... but still nothng
How do I format this properly
Code: Select all
<?php
."<td width="73" class="readmore">[<a href="javascript:window.open(news.php, width=500, length=500, location=0);">read more</a>]</td>\n"
?>I'm not sure what to do, I tried putting all the variables in window.open in quotes... and then just their numbers... but still nothng
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
This is still not working
Heres a bigger snipplet.
Heres a bigger snipplet.
Code: Select all
<?php
$result = @mysql_query("SELECT * FROM news ORDER BY `id` DESC LIMIT 10");
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
while ( $row = mysql_fetch_array($result) ) {
$title = $row["title"];
$newsid = $row["id"];
echo "<tr>\n"
."<td height="19">$title</td>\n"; ?>
<td width="73" class="readmore">[<a href="javascript:window.open(news.php?id=<?php echo $id ?>, width=500, length=500, location=0);">read more</a>]</td>
<?
echo "</tr>\n";
}
?>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
There is a syntax error...
Line 1 Char 25 Code=0
That's all it sais... The error is that javascript line...
Line 1 Char 25 Code=0
That's all it sais... The error is that javascript line...
Last edited by John Cartwright on Fri Jan 30, 2004 2:12 pm, edited 1 time in total.