| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| An American Soldier ![]() | 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
__________________ Completely Free cPanel Hosting -- Deployed to Afghanistan -- "There is no such thing as rich over-night unless you owned Google stock in 2006" |
| |
| | #3 (permalink) |
| An American Soldier ![]() | [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"); #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"); ?>
__________________ Completely Free cPanel Hosting -- Deployed to Afghanistan -- "There is no such thing as rich over-night unless you owned Google stock in 2006" Last edited by templaterave; 06-30-2005 at 06:13 AM. |
| |
| | #4 (permalink) |
| A Wealth of Knowledge | ok, you're problem is simple,you just forgot a couple lines of code - try this PHP Code: -Steve |
| |
| | #5 (permalink) | |
| An American Soldier ![]() | 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 Quote:
__________________ Completely Free cPanel Hosting -- Deployed to Afghanistan -- "There is no such thing as rich over-night unless you owned Google stock in 2006" | |
| |
| | #7 (permalink) |
| An American Soldier ![]() | 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
__________________ Completely Free cPanel Hosting -- Deployed to Afghanistan -- "There is no such thing as rich over-night unless you owned Google stock in 2006" Last edited by templaterave; 06-30-2005 at 11:49 AM. |
| |
| | #9 (permalink) |
| An American Soldier ![]() | 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...
__________________ Completely Free cPanel Hosting -- Deployed to Afghanistan -- "There is no such thing as rich over-night unless you owned Google stock in 2006" |
| |
| | #12 (permalink) |
| An American Soldier ![]() | 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
__________________ Completely Free cPanel Hosting -- Deployed to Afghanistan -- "There is no such thing as rich over-night unless you owned Google stock in 2006" |
| |
| | #13 (permalink) |
| New Member | 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 11:35 AM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 09:09 AM |
| How I fill javascript array with php variables? | wiedzim | CODE | 0 | 03-31-2004 02:45 AM |