Jump to content

micah1701

Members
  • Posts

    613
  • Joined

  • Last visited

Everything 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. 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. are you calling session_start() on the "process booking page" you have to add session_start(); at the top of every page that uses sessions.
  6. 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.
  7. 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?
  8. the code looks like it should only trigger the "in use" PNG when the "beingEdited" column returns "yes" perhaps your problem isn't in the download script but in whatever script should have set the column back to "no" before you ran the download script?
  9. I'd say look in to using the strip_tags() functions: http://php.net/manual/en/function.strip-tags.php on its own, it removes ALL html, but you can also specify which tags you want to allow, such as <p>,<strong>,<em>,<a> ect... then yes, use mysql_real_escape_string() when you insert it into the database
  10. 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.
  11. drisate's explode() option is how I probably would have done it since regex is annoying. the only downside is if your text string may have more than one "." in it. inwhich case your array will have more than just 2 levels. also, wildteen88 is much better at regex then me
  12. you don't want to use substr, you want to use a regular expression. look into preg_replace something like: <?php $value = "12345. some some string"; $match = "/^[0-9]. /"; $replace = ""; $value = preg_replace($match,$replace,$value); ?> //this probably won't work 'cause i suck at regex, but someone can come along and fix it
  13. 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; ?>
  14. 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>
  15. you don't need to serialize it. the function converts your array automagically. change: http_build_query(serialize($error)); to: http_build_query($error); see if that helps!
  16. dumb question, but are you sure you're running a PHP server? if you create a page called "test.php" and put this code in it: <?php phpinfo(); ?> what happens?
  17. try using http_build_query instead of encoding the serialized array.
  18. when you say "i have most of these accomplished" I assumed that would be in the attached file. Your file had no PHP code what-so-ever; making me feel like I might have just been tricked into downloading a devious file. hmmm. anyway, post whatever code you DO have (using the form's [ #] CODE button) then ask a specific question and I'm sure someone will be able to help you out.
  19. if you're sending it in the URL you need to use $_GET and not $_POST also... <?php $username = array("1", 2, 3, 4, 5); $match = false; foreach($_GET as $key1 => $value1){ if(in_array($value1,$username)){ $match = true; break; } } if($match){ echo "true"; }else{ echo "false"; } ?>
  20. i'm confused what you're trying to do. if you have the query string in your url: ?name1=value1&name2=value2 then in your php: <?php echo $_GET['name1']; // will output "value1" echo $_GET['name2']; // will output "value2" ?>
  21. confirmed that yahoo! has disabbled fsockopen() http://help.yahoo.com/l/us/yahoo/smallbusiness/webhosting/php/php-33.html maybe you could try to fopen() a file on the given server or use cURL?
  22. 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?
  23. 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.