Jump to content

141n

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

141n's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. nope, I cleared everything out of firefox's cache, relaunched but same thing =/ I wonder if it may be the actual server? It's (the site) hosted by godaddy.com anybody else had simillair issues with them regarding this sort of thing? Is it worth while sending them an email to see if it is something they can solve?
  2. hey ridiculous - I have put session_start(); at the top of the page, there isn't anything that preceedes it which is what is confusing me. Even on a file that has only <?php session_start(); ?> I still get this error, where to my understanding it should just show a blank page, right?
  3. Hey folks, OK, I hope I am doing something stupid here and it's easily solved, because I don't really know where I'm going wrong with this one: I'm using PHP5 and whenever I use session start(); - even if it is the only thing in the .php file - I get the following errors: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /path/to/my/file/index.php:1) in /path/to/my/file/index.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /path/to/my/file/index.php:1) in /path/to/my/file/index.php on line 2 As I say, I even tried just this: <?php session_start(); ?> And have the same problem, which I don't understand, because it is being called before anything else, particularly in the last case as it is the only thing being called. Am I doing something dumb with PHP5? I'm used to PHP4 and haven't done anything PHP orientated for about a while now. Thanks for taking the time to read this...
  4. Fair enough, sounds like it could give me more headaches than I could do with just now =P
  5. ^^ Thanks for clearing up the air folks. Well, that answers my question. It is MySQL5 I'm using so I guess VARCHAR would be OK with the 65,000 character limit - I doubt I will go over that, or BLOB, I guess I can research the nitty-gritty details on my own. Oh, another thing - I am going to be the sole user of this, so security shouldn't be *much* of an issue (I'm not naive enough to rule out the risk of someone else gaining access to the posting form) but what is, generally, a better method of styling my input. Should I code some kind of BB style app, or, as I am going to be the sole user, should I just go ahead and stick in the normal HTML tags? I know allowing unformatted HTML input isn't always a great idea, but I just wondered what your opinions were? And, fenway, can you clear up on why TEXT is evil =P Thanks again!
  6. Hey guys, just a quick question. I'm setting up a site thats going to contain a blog section of sorts. It's the first time I've attempted this and was wondering, when setting up the MySQL Database which field type to use to store the main content as. I.e, VARCHAR, LONGTEXT, LONGBLOB? I'd appreciate the reply or even a clarifcation of the difference and which is best suited ^^ Many Thanks, Iain
  7. Most of it I can understand, I'm just trying to break away from my bad habit of coding everything using "If()" statements Is there any particularly good literature I could read up on? I started of learning from Larry Ullman's PHP & MySQL but it wasn't too OOP geared. EDIT: Everything up to the class for ReportFault I haev a fair idea of whats going on - after that it is pretty sketchy. Bearing in mind I have only started looking at OOP the last few days
  8. mate, I took one look at your app and thought "....wtf ???" lol - I didn't think it would be so complicated as this. I'm very n00b15H with OOP. I'm gonna start gearing my code towards it though - it seems the sensible thing to do for stuff like this Been scouring around this site and others on the net. I'm sure once I get my heard around the logic of it, it'll be easy enough, thanks - I can now pick away at your example as my first proper OOP application
  9. Hey guys, I'm curently developing a site that is gonna use the php mail function for different stuff, like report faults, repot abuse, general queries. What I was wondering is, would it be possible to have the one email page (say mail.php) that would use a php require() to include whatever file is needed depending on what the user selected? i.e, if the user clicks "Report A Fault" then it would got to mail.php and this page would then require('../src/report_fault.php'); likewise for the other possibilities. Problem is, I'm not too sure how to do this. I was wondering if I could set a variable like $form = '#whatever user selected' when they click the hyperlink and depending on what this variable was set to, then it would open the relevant file? I thought about if I could use $_GET[''] and set the url to something like mail.php?action=report_fault - I've seen stuff like that done before, but have no idea how to do this... can someone please help ??? ???
  10. Hey again folks - is there some different kind of way of adding together two mathematic values in JavaScript? Just wondered - I'm tryng to add two variables together as a number (i.e, like 2 + 2 = 4) but JS keeps spitting back two concatenated strings. So, if somebody was to enter 20 as $num1 and 40 as $num2 then they would get 2040 back, as opposed to 60 Any help for a floundering little n00b?
  11. hehe the second method you listed that uses the (id) method works fine for me - it was that which I was going for to start with. Thanks for your help mate; I'm needing to study up some more on the ol' JS, at least learn more advanced stuff, and how to do this kind of stuff aswell Thanks again, the final thing I'm using is this:- <script type="text/javascript"> function calcCharge(id, Rate, Connection) { var Length = document.getElementById(id).value; var num = (Length*Rate) + Connection; var totalCharge = num.toFixed(2); document.getElementById("showCharge").innerHTML+='£' + totalCharge + ''; } function clearCharge() { document.getElementById("showCharge").innerHTML=' '; } </script> <input type="text" id="user_num" /> <input type="button" value="Calculate Charge" onclick="calcCharge('user_num', 0.25, 0.10)" /> <input type="button" value="Refresh" onclick="clearCharge()" /> <div id="showCharge"> Amount Of Charge: </div>
  12. hmmm, comes back sayin £NaN - Not A Number? I'll try it again, I may have screwed up some of your code =S
  13. Sorry, I feel a bit silly for not explaining myself too well. what I wanted was for the user to enter a figure into a text box ($user_num) and then for the data to be passed to the function like so: function calcCharge (Length, Rate, Connection) { // do math } <input type="text" id="<b>user_num</b>" onclick(calcCharge(<b>user_num</b>, 0.20, 0.10)" /> Here's what I've got so far: <script type="text/javascript"> function calcCharge(Length,Rate,Connection) { var num = (Length*Rate) + Connection; var totalCharge = num.toFixed(2); document.getElementById("showCharge").innerHTML+='£' + totalCharge + ''; } </script> <input type="text" id="<b>user_num</b>" />
  14. Hey guys, firstly, hi - I'm a new member, and like all new members, I have a problem lol (easy on the jokes) I'm trying to use JavaScript to do a simple calculation taken from data a user enters in a normal textbox. the Calculation is this: ($userdata * 0.25) + 0.10; So I wrote a function to work it out and return the answer. The function works fine, but the problem is I just don't know how to get it to read the data that has been input by the user? Here's what I've got so far: <script type="text/javascript"> function calcCharge(Length,Rate,Connection) { document.write("£",(Length*Rate) + Connection); } </script> <input type="button" id="calcButton" value="Calculate Charge" onclick="calcCharge(20,0.25,0.10)"> how could I change the first argument passed to the calcCharge function to something like the ID of a text field? When I do that, it just doesn't work?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.