Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO leave globals off.... why not just upgrade the php engine? If I were paying for hosting with php 4.0.1 on I'd be very upset! If I had control over teh box I'd install later version myself.
  2. http://www.alistapart.com/articles/succeed
  3. the go and replace dbConnect(); with something like require_once('path/to/dbconnect/file.php'); and put all the db connection stuff in that one file. (No functions mind!)
  4. http://uk2.php.net/manual/en/function.readdir.php look at example 499 and 500. all you need to do is break out of the loop once you hit your file.
  5. you seem to be making this more and more complicated....
  6. this is more an ajax job - as thw browser will close there is no need for the client to view another page so the above would fail to do its job of sending data AND closing the window.
  7. yep its variable scope... this is not reall the best use of a function your databse connection is something that should (in 99%) of cases only do once per page and as such does NOT need to be in a function. read up on variable scope - we could tell you but you won't learn it anywhere near as well... http://uk2.php.net/manual/en/language.variables.scope.php
  8. Logs are the kind of thing that many neglect. They are the kind of thing we only look at when something goes wrong. To that end flat files are the order of the day (pretty much why flat files are used for this kind of thing). Lots of writes and very few reads - and as btherl correctly states faster to write to than db. if you are logging with php then you could always break the files up a little by logging by date.
  9. thats a php error can you let us know what is on line 31 of the file that is named in the error... now - I just spotted an extraeneous bracket in your query... swap this: //is my statement wrong or this just cant work: $update=mysql_query("UPDATE admin SET timediff = ( UNIX_TIMESTAMP( timeout ) - UNIX_TIMESTAMP( timein ) ) WHERE id<3)"); for this: //is my statement wrong or this just cant work: $qry = "UPDATE admin SET timediff = ( UNIX_TIMESTAMP( timeout ) - UNIX_TIMESTAMP( timein ) ) WHERE id < 3"; $update=mysql_query($qry) or die(mysql_error());
  10. what errors does it produce? have you run it in phpmyadmin (or similar) to check any error reporst in there? i take it you want the time diff in seconds....
  11. jitesh got it - missing a closing brace after the snippet of code he posted. there is nothing wrong with that code Beboo002....
  12. ToonMariner

    php

    query database and get path of image then <img src="<?php echo $path; ?>" ....
  13. Sessions are 'cookies' but stored on the server. The values of sesion variables can only be changed by the server. 'Cookies' are client side cookies (a session normally stores a cookie as an ID of a session cookie otherwose the ID gets apssed in the url). These are files (or portion of files) stored on your onw machine with info in them that the site can use. both sessions and cookies cna be hijacked - but only cookies can have their vlues altered by the malicious litle bugger messin around.... In short both are a buffer if you like of info that you may need to use a lot...
  14. there is but its a dynamic list that changes.. there are a couple of headers you can detect X-Forwarded-For being one - cna't remember the others.... I was looking into something similar the other day and then university challenge came on so I broke - never got back... As always these headers don't always get sent so proxy detection is probably more of an art than I have spent time on to realize.
  15. why are you using session_register in PHP 5?
  16. asssuming what somebody knows is best for their site is dangerous - think about it 10 pics all 100px wide is not always going to display very well.... All we can do is instead of giving out any old crap is to impart our knowledge of the web and how dynamic it needs to be to help people produce better sites. It may well be that what we offer not only serves the purpose they need but also serves other situations too with no need for alteration to and code. The alternative is giving one set of code for each situation - which is not good at all. This is a forum to help peopl improve their skill as a web developer and as such we shoud offer the most robust solutions possible...
  17. NOT single quotes around the table name anf field name but the back tick (top left button on standard keyboard) ` - NOT - '
  18. 1. yes 2. $qry = "SELECT * FROM `tblcustomer` WHERE `client_dd` = " . $_POST['client_dd']; $qry = mysql_query($qry); $data = mysql_fetch_assoc($qry);
  19. if you want it on the fly then ajax is the only option - send an ajax request to a php script that queries the database and returns a delimited string of the results. The javascript function that handles the request repsonse should then split the string and set the values of the input elements to the correct val - you will of course need to know which value shoudl go where as you'll only have a numerically index array to play with. alternatively if you submit the form you can do it all with just php - same kind of method as what you currently have in place. query the database grab the results and put the relevant values in the corresponding input field with value="<?php echo $val; ?>" hope that helps....
  20. error_reporting should be able to be set in your code - if its not working try uploading a file called php.ini to the directory this script is in and have error_reporting set to something that will show the errors you need (table of values which can be version specific can be found here) alternatively have a look at error_reporting().
  21. did you see my point about swapping the ';' in teh query string for ',' ???? foreach ($_POST['try'] as $key => $val){ $qry .= "('" . $_SESSION['creatematch']['opposition'] . "', '" . $_SESSION['creatematch']['ottersteam'] . "', '" . $_SESSION['creatematch']['season'] . "', $val ),"; }
  22. thats absolutely great... we shall await such a time when you can actually EXPLAIN HOW you are changing the text size and WHY the hell you need an image resizing... Sorry buddy but as far as I am concerned (not the best decipher of english in the world mind!) your explanation gives me nothing.... NOW are you actually changing the SIZE of text (that is the font-size) or just the amount of text and hence the number of lines in the span??? either way the only detection tool you will have is javascript so this is ALL javascript for 'resizing' you image... Can I suggest that you adopt an approach that doesn't need all this hard work for very little benefit?
  23. ok that was more a squashed piece of very tiny carrot that had been regurgitated by a farm yard animal... how are you altering text size (is a url parameter? javascript? ctrl + in ff or View > Text Size in IE) I know giving out a full explanation is incredibly tiresome but if you don't no-one is going to know exactly what you need.
  24. $qry = substr($qry,0,-1); <-----------I don't understand what is happening here. - removes the last ;.......... which shoudl be ,!!!! my bad $qry = "INSERT into tries (tryOpponent, tryTeam, trySeason, tryPlayer) VALUES "; $counter =1; foreach ($_POST['try'] as $key => $val){ $qry .= "('" . $_SESSION['creatematch']['opposition'] . "', '" . $_SESSION['creatematch']['ottersteam'] . "', '" . $_SESSION['creatematch']['season'] . "', $val ),"; } $qry = substr($qry,0,-1); <-----------I don't understand what is happening here. echo $qry; // this will echo qry so you can copy and paste into phpmyadmin to check validity of query. $qry = mysql_query($qry);
×
×
  • 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.