Current location: Hot Scripts Forums » Programming Languages » PHP » problem adding js with php


problem adding js with php

Reply
  #1 (permalink)  
Old 10-27-04, 01:48 PM
darkcarnival's Avatar
darkcarnival darkcarnival is offline
PHP/MySQL coder
 
Join Date: Jun 2003
Location: Michigan
Posts: 939
Thanks: 0
Thanked 0 Times in 0 Posts
problem adding js with php

hope that doesnt sound dumb but i want to add a javascript pop-up that would say like new message from someone using some php viables. but it always pop-up parse error. is that not possible am i screwing up in some place. thx
__________________
Elite Bulletin Board
http://elite-board.us
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-27-04, 02:12 PM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
it would be alot easyer with some code to correct
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-27-04, 03:27 PM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,551
Thanks: 2
Thanked 16 Times in 15 Posts
This code actually worked for me.

I think the problem might be that you have to define a variable before trying to use it in javascript. I put some PHP between the head and body tags, then called the alert from within the body.

Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?
$text = "This is a string!";
?>
<body>
<script language="Javascript">
alert ("<? echo $text; ?>")
</script>
</body>
</html>
__________________
Yep, it's a signature...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-27-04, 04:14 PM
darkcarnival's Avatar
darkcarnival darkcarnival is offline
PHP/MySQL coder
 
Join Date: Jun 2003
Location: Michigan
Posts: 939
Thanks: 0
Thanked 0 Times in 0 Posts
hmm ok thx dude
__________________
Elite Bulletin Board
http://elite-board.us
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can someone help with htaccess and php problem tigherrdk PHP 6 03-09-09 03:28 AM
PHP Sessions problem dannyallen PHP 1 06-26-04 11:43 AM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 12:19 PM
php in linux problem usman PHP 6 05-15-04 12:57 PM
Problem with adding content to mysql from php HasansWeb PHP 3 01-10-04 06:26 PM


All times are GMT -5. The time now is 12:23 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.