Jump to content

micah1701

Members
  • Posts

    613
  • Joined

  • Last visited

Posts posted by micah1701

  1. if you don't have access to your .ini config files, you can sometimes set directives at the .htaccess level if your provider allows.

     

    php_value  upload_max_filesize  200M

    php_value  post_max_size  200M

    php_value  memory_limit 200M

     

    in the end though, if you host has a max file size upload you may just be out of luck

  2. glad to see you got it worked out, even if the work around is using a different browser.

     

    I googled the issue and it seems lots of people have had problems with Android's interpretation of various header types, here's an interesting blog post which a related issue (although, they're not talking about images specifically I don't think) http://digiblog.de/2011/04/19/android-and-the-download-file-headers/

     

     

  3. in your first block of code you posted that you have "$_SESSION['booking'];" 

     

    is that at the top of any pages AFTER you give it a value of $data?  if so, the above code would overwrite any value you previously assigned to that session variable.

     

    als, it's not neccessary to declare the session variables so you can take this line out anyway.

  4. add $bmi=""; AFTER as the second condition of your IF statement...

     

    <?php
    <?php
    if ((isset($_POST["done"])) && ($_POST["done"] =="y")){
    
    $height = ((12 * $_POST["feet"]));
    if ((isset($_POST["inches"])) && ($_POST["inches"] > 0)){
    $height = $height + $_POST["inches"];
    }
    
    $bmi = ($_POST["lbs"]) / ($height * $height) * 703;
    
    }else{
    $bmi = "";
    }
    ?>

  5. what happens (for testing purposes) when you completly remove that last ELSE block (lines ~104-125) which send the header info of the png file?  If you take that out and its still shows up on the phone then its not the code.  If it doesn't show up on the phone, then you gotta wonder why that block of code is executing.

  6. I didn't have a chance to look at the code again,  but again, thinking out side of the programming aspect, since it works from a PC and PHP is run serverside (meaning it should matter if your accessing it from a PC or a phone or a mac or whatever) then I would starting thinking about what exactly does the phones browser do that your computer doesnt'.

     

    maybe it's cacheing that image file? and displaying it regardless of what the PHP is returning.

     

    have you tried this from more than one phone yet?

  7. you could simply put the toggle_container <div> above the <h2> tag that triggers its display in your code.  That would keep in on the page but it still might not have the desired effect your going for as it would then push the <h2> content down.  Try it and see.  You may need to get into some css positioning.

  8. if you hit the back button, thats the browser re-displaying the cache.  there's nothing you can do about that.  if you're not using sessions, cookies or a database, you shouldn't need to worry about data being secretly stored on your server somewhere.

     

    if you're transmititng credit cards though, you should be usings SSL ( https:// mode ) to encrypt the info entered in the browser before it gets sent accross the net to your server.

     

     

    as for clearing out "sticky" values...

    it looks like you're using global variables.  ordinarily a variable, like "$firstname" only contains its value in the script inwhich its being called.  By posting your data through a form, the value of $firstname is carried along.  Best practice is to have globals turned off. Instead of:

    <?php echo $firstName; ?>

    with globals off, $firstName will no longer have a value when the page loads... instead you have to use

    <?php echo $_POST['firstName']; ?>

     

    in your case, if you really want to "clear" out your global variable, just give it a new value.

     

    for example

    <?php
    $firstName = null;
    ?>

  9. nope.  javascript is the only way to detect the browser size.

     

    default to the smaller 800x600 and, if javascript detects a larger screen swap to the larger css.

     

    also, i include this snippet of code at the bottom of my sites:

    <noscript> 
    <style>
    #js_is_not_evil {  text-align: center; background-color: #990000; color: #FFFFFF; width: 100%; opacity: 0.70; filter: alpha(opacity=70); position: fixed; bottom: 0; left: 0 }
    #js_message_txt {  background-color: black; opacity: 1 !important; filter: alpha(opacity=100) !important; padding: 0px 10px 0 10px; }
    </style>
    
    <div id="js_is_not_evil">
    <span id="js_message_txt">Javascript is not evil.  You should turn it on and see how much more fun the web can  be!</span>
    </div>
    </noscript> 

  10. The row ID's in my table are sequencial but the values of the column I want to sort by are not alphabetical.

    it other words, my table looks like:

    ID   NAME
    1    Bob
    2    Andy
    3    Cletus
    4    Audrey
    5    Dustin
    6    Elma
    

     

    To query them in order is simple enough: 

    SELECT `name` FROM `table` ORDER BY `name` 

    will return:  Andy, Audrey, Bob, Cletus, Dustin, Elma

     

    my problem is that I need to list the previous and next name with a given ID.

     

    So, if I am talking about "Cletus" (SELECT name FROM table WHERE id = 3) I want to find the names of the persons listed alphabetically before and after him.  (eg, "Bob" and "Dustin")

     

    I know I could do this programmatically with PHP, spitting out an array of all the names in order then finding the one I want and grabbing the names that come before and after it in the array but my list of names may be pretty big and it seems like it should be possible to do this in the query.

     

    Any thoughts?

  11. what you're describing isn't an anchor, it is actually part of the url and can be grabbed. for instance, twitter picks up stuff after /#!/ in

     

    http://twitter.com/#!/SalonsOnline

     

    you can use mod_rewrite and/or PHP to redirect or passthrough based on whatever is after #!

     

    well perfect. thats my question, how can php (or htaccess) get that value?

     

    i did a print_r($_SERVER) and don't see #! anywhere in there.  Where can I get the value of the URL to parse server-side?

     

    EDIT:  turn off javascript and try that link to twitter again. It doesn't redirect. They're using javascript to detect the hashbang in the URL and redirect the browser.  Seems to indicate that this is still impossible  :(

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