Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,158,158 members, 7,835,876 topics. Date: Tuesday, 21 May 2024 at 04:45 PM |
Nairaland Forum / Science/Technology / Programming / why the unexpected $end (906 Views)
Parse Error: Syntax Error, Unexpected T_else In C:\ / Unexpected $end / Dreamweaver (an Unexpected Error Has Occured) (2) (3) (4)
why the unexpected $end by ckdoublene: 10:51pm On Dec 28, 2010 |
why do I get this message at the last line of code - can someone help me with this, please ? <?php |
Re: why the unexpected $end by Nobody: 2:12am On Dec 29, 2010 |
Can you attach the whole HTML file plus the JavaScript? And what exactly are you trying to accomplish? |
Re: why the unexpected $end by ckdoublene: 2:43am On Dec 29, 2010 |
I'm accessing a database & changing fields in the input before I update the record when I enter the amtpaid. it correctly inserts the date, tentpay, paidsum & the L when the date is greater than 5 but not the prevbal, secdep, damage, latechg, courtcost or nsf. The trouble is that I don't know where/when to use parseInt & .value . |
Re: why the unexpected $end by Nobody: 9:34pm On Dec 30, 2010 |
let me help u out in javascript variables are declared with var however a value can have 12 but as a string so if u add that with lets say 14 it will convert the whole values to string giving u 1214 which is concatenating however to convert a string value var value="12" to an actual number u use parseInt it will parse the string and convert it to 12,here's a trick var trick="12bombs" if u parse that it will be converted to 12 and the others will be ignored, so u use parseint if u have a number in a string that u will need to retrieve imgaine i created an app how many wifes do u want to marry, if he inputs 5 wifes there are all strings but since i need only the number i parse the input and retrieve the value hope i helped out, if u still don't grab only me at my mail, could send a pdf file to you. |
Re: why the unexpected $end by ckdoublene: 4:19pm On Dec 31, 2010 |
I have it working now with the below except that if the amtpaid is > totOwed nothing happens? <script> |
Re: why the unexpected $end by joefazee(m): 10:00am On Jan 02, 2011 |
Put } before the last PHP closing tag but your code is not well escaped at $apt = $_POST['apt']; this is injectable, and why are you using the old mysql lib instead of a more faster one like mysqli, or go with a framework like CakePHP/CodeIgniter. learn how to separate presentable layer from logical routines by using template engine like smarty or learn about MVC. good luck |
Re: why the unexpected $end by ckdoublene: 4:40pm On Jan 02, 2011 |
the below is my new code. I've checked that my database has the rows but nothing happens? <?php |
Re: why the unexpected $end by ckdoublene: 8:56pm On Jan 02, 2011 |
I'm sure that the problem is that I don't know how to state the variables in the javascript so that it works in the php? |
Re: why the unexpected $end by wassolldas: 4:39am On Jan 05, 2011 |
first thing: Don't ever write code like this! Even when learning, it breeds bad habits. Separate your business logic, user interface and data access codes. Put the JavaScript code in a different file. Okay, You have to recognize two things in the following order. 1. PHP code is parsed server side and then , 2. JavaScript is executed on the client side (in the browser). Put you JavaScript in a function and use DOM events handler to specify the event that triggers or calls the function. Document.getElementByID(name) allows you to use the object in the JavaScript code. Use PHP _POST['HTMLelementName'] or _GET to get the form values, |
Re: why the unexpected $end by ugdaniels(m): 2:54pm On Jan 06, 2011 |
You see that error message because you did not close an "if" statement well. Check your if statement and other loops especially the if (condition here) { execute } If you dont close the curly brackets well, it will give the $end error Have Phun Nwachukwu Ugochukwu Daniel www.buyselltraders.com |
(1) (Reply)
Help With PHP Array, Result Is Skipping A Row / Problems With Programmers / Life And Times Of Tech Billionaire Jason Li (no. 3)
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 32 |