Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Posts posted by spiderwell

  1. if you have the 'blank' file saved already, use the file object to read the file into a variable, and use str_replace() to change it.

    $filetext = str_replace('change1','localhost',$filetext);

     

    assume i have read the file contents of the example you gave, into $filetext, I then ask it to look for 'change1' in that string and replace that with 'localhost', and pass it back to the $filetext. i would then write that variable to the file and save file .

  2. the code you have given doesn't add categories at all, only UPDATEs or SELECTs from the gallery table.

    to make it easier you should have 2 pages, one for adding categories and one for adding the photos.

    on the categories page have a simple for with one field for the name of category, have it post to itself, and insert the name into the gallery category table in the database.

    on the other page you have the form like the one you posted, only you don't appear to have an INSERT just UPDATE so you will only be editing existing records, unless you change that script to have an option to add new records also.

  3. mike without knowing exactly what code you have, there isn't much anyone can suggest.

     

    how are you accessing the emails in the first place, I would imagine that whatever method you are using would have a way to access email properties including attachments, sorry not a great reply but you haven't given more than a vague description to respond to.

  4. list can be used in conjunction with explode quite nicely to place results into seperate variables rather than arrays. or they also work well with recordsets as shown in the php.net page under list()

     

    <?php
    $mything = "12-06-2011";//english date as I'm from UK
    
    list($day,$month,$year) = explode("-",$mything);
    
    ?>
    

     

    way I see it, if you know what they do, and can't find a use for it, you probably don't need it, its not something I use.

  5. $id = "action";
    $string = $_GET["$id"];
    

    god know what you are trying to do there.

     

    use this

    $string = isset($_GET['action']) ? $_GET['action'] : 'index';
    

    that says if there is an 'action' variable, pass its value to $string, else $string = 'index'

  6. yeah this is what I thought was going to be the case, I think I'll advise him to get a bigger memory one though as hes not at all computer orientated, and doesn't even have a pc or mac!

    shame as plugging in a hard drive/memory stick would have been brilliant, but guess thats why they designed it with 3 memory sizes, maximise the product profit and all that

  7. hey peeps

     

    my mate has a ipod, and is looking to get an ipad, and i was telling him to get a 16gb one to save money and buy an external hard drive and link the two so he can get lots of downloads on the external drive.

    I just found out that ipads dont have usb ports! Does anyone here have experience with ipads and know if you can link them to a hard drive or has Steve  Jobs(worth) made them purely mac dependent ergo my idea is not going to work? Would you need a mac as a central device? I don't really have a clue on mac stuff.

     

    thanks

     

  8. i think the sql isnt quite right, perhaps you need it like this:

     

    "SELECT * FROM zxt_friends WHERE (user_id = '{$u['id']}' OR friend_id = '{$u['id']}' ) AND approved = '1'"

     

    putting brakets around the OR

  9. in the function getHotel, at this line:

    echo "<table>";

     

    before it put

    echo $sql . "<br />";

     

    and it will show you exactly what is passed into the sql. very good for working out why things dont work!

     

    do the same thing in the pagenation bit too, so you can see what is going on in that section and why the count works, but the hotels are wrong.

     

     

  10. $hotelObj -> getHotel($where);  this line of code, whatever it is you are passing, will never be used in the function getHotel due to this line in the function:

     

    $where = isset($_POST['where']) ? $_POST['where'] : "";

     

    so you have a function you pass a variable to it, that immediately get surpassed by the POST variable or set to ''. thats a very odd thing for starters. i believe also that name is a restricted word in mysql, so put `backticks` around it, just in case :)

     

    please re write this so i can understand it:

    but unfortunately it shows all the hotels in all cities and countries, although the pagination code for number of pages works just fine, it count the number of hotels in that city or country and show the number of pages correctly

     

  11. hehe fugux is the new pr manager for w3schools.

     

    you could also do it without jscript, and have it all handled by the PHP, but you would have to have a pre form, for want of a better phrase, which asked how many people, then when posted, it would spit back a form with the correct number of entries for the number of people selected, based on the number in the pre form

×
×
  • 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.