| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jun 2005 Location: Pennsylvania
Posts: 1,839
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | How would I intergrate Javascript with php how would i intergrate javascript into the php brackets, i cant get it to work right, even when i change the "'s to \". can some one please help me
__________________ Poker News, articles, discussion LIKE THIS Its an iPod, a phone, and an internet communications device. |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Jun 2005 Location: Pennsylvania
Posts: 1,839
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | [QUOTE] #connect to MySQL $conn = @mysql_connect("localhost","---","-----") or die("Could not connect to MySQL"); #select a database $db = @mysql_select_db("template_users",$conn) or die("Could not select database"); ????: NamePros.com http://www.namepros.com/programming/103014-how-would-i-intergrate-javascript-php.html #create the SQL query $sql = "insert into pm (whoto,whofrom,subject,message) values (\"$whoto\",\"$username\",\"$sub\",\"$msg\")"; $result = @mysql_query($sql,$conn) or die("Could not execute query"); if($result) { <script type="text/javascript"> <!-- function delayer(){ document.location = "members.php?page=messagebox" } --> </script> }else{ echo("failed"); ?>
__________________ Poker News, articles, discussion LIKE THIS Its an iPod, a phone, and an internet communications device.
Last edited by templaterave; 06-30-2005 at 07:13 AM.
|
| |
| | #4 (permalink) |
| A Wealth of Knowledge Join Date: Aug 2004
Posts: 3,809
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ok, you're problem is simple,you just forgot a couple lines of code - try this PHP Code: -Steve |
| |
| | THREAD STARTER #5 (permalink) | ||||
| Senior Member Join Date: Jun 2005 Location: Pennsylvania
Posts: 1,839
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ok, this is what i have now, but i get an error. Parse error: parse error, unexpected $ in /home/template/public_html/mb/compose.php on line 69 theres no line 69 in the code... in only goest down to 68
__________________ Poker News, articles, discussion LIKE THIS Its an iPod, a phone, and an internet communications device. | ||||
| |
| | THREAD STARTER #7 (permalink) |
| Senior Member Join Date: Jun 2005 Location: Pennsylvania
Posts: 1,839
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ok i fixed ther error, the problem was that i had put an else command in wrong. Anyway, did what you told me, except it does the same thing, I included a a screen shot. Also the javascript still dont work The code im using is below PHP Code: Screen Shot of problem
__________________ Poker News, articles, discussion LIKE THIS Its an iPod, a phone, and an internet communications device.
Last edited by templaterave; 06-30-2005 at 12:49 PM.
|
| |
| | #8 (permalink) |
| A Wealth of Knowledge Join Date: Aug 2004
Posts: 3,809
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | instead of the javascript, you should use: PHP Code: -Steve |
| |
| | THREAD STARTER #9 (permalink) |
| Senior Member Join Date: Jun 2005 Location: Pennsylvania
Posts: 1,839
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | well, the reason i use java for that is that i cant figure out how to have a timed redirection in php. Also my other reason for using java is googles adwords...
__________________ Poker News, articles, discussion LIKE THIS Its an iPod, a phone, and an internet communications device. |
| |
| | THREAD STARTER #12 (permalink) |
| Senior Member Join Date: Jun 2005 Location: Pennsylvania
Posts: 1,839
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | thats not always true. The ob_start() command will buffer the headers so headers can be sent. Im great with php, just havin issues on things i never did. more about output buffering http://us4.php.net/ob_start
__________________ Poker News, articles, discussion LIKE THIS Its an iPod, a phone, and an internet communications device. |
| |
| | #13 (permalink) |
| New Member Join Date: Jul 2005
Posts: 8
![]() | PHP Code: PHP Code: PHP Code: |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: Getting started with PHP (The Basics) | deadserious | Webmaster Tutorials | 60 | 11-17-2007 12:35 PM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 10:09 AM |
| How I fill javascript array with php variables? | wiedzim | CODE | 0 | 03-31-2004 03:45 AM |