Jump to content

jayarsee

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jayarsee's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You can either do this by setting ActionScript variables inside the Flash which allows it to track whether or not the opening animation has played so that when the page refreshes it does not replay, /or/ you can leave the Flash as it is and simply prevent navigation actions from reloading the page by loading all of the site's content and managing all of the navigation via ajax. If you were going with the latter, I would recommend you implement this with the jQuery library since it makes this sort of heavy ajax use considerably less cumbersome than it is with XMLHttpRequest directly. Or the least sexy solution: iframes, flash in one, content in the other.
  2. Now I understand your request, it is possible to invoke a browse window using JavaScript. What I was saying, is that it is /not/ possible for a remote server to execute JavaScript, PHP, or any other function, outside of a browser extension, which automatically creates directories on a user's computer. You can prompt them to browse and they can /themselves/ create a directory, yes. As far as prompting the user with a Browse window without the use of <input type='file' />, if there is a way, I have never heard of it. You can call click() actions on a hidden input type=file in order to simulate this behavior, but without a file input at all, not as far as I know. I do know that since file type=input is a gateway into a user's filesystem browsers are /extremely/ strict about managing its behavior. For example, with few exceptions regarding visibility you can apply essentially no CSS to a file input. Some OSs treat directories like files when it comes to browse, so you could do it that way, but that's as far as anything I've ever seen goes. If that was a commonly available feature of JavaScript I feel like I would have seen it by now. The closest implementation I can think of would be to have them select a file, and for browsers which report both the path and the file selected (some major ones don't), you could parse this value and remove the file portion of the string.
  3. We must simply be talking about completely different things. A user's download folder is a preference set by the user. A remote website can no easier tell a user where their download is going to go as it could remotely browse their file system. If there's a way to use the <form> tag to create directories on a user's local file system, you've got me dead to rights, I had no idea. And I've built massive data warehouse applications for Fortune 500 companies from scratch using PHP's FTP functions, thank you very much.
  4. It looks like you already did it. Is it not working? I would do if(!empty($send)) and set $send according to a GET/POST variable coming from your form. I think by auto-responder you mean "confirmation email". To me at least, an auto-responder is an email that automatically replies when someone sends an email to a particular address. You can do that with PHP too, assuming you have qmail you just put this into the account's .qmail-default file: | true | /usr/bin/php /path/to/autoresponder/code/autoresponder.php Qmail will pass in the variables you need to see who sent the original message, etc. As long as you use mail() in it, whenever an email comes into that account PHP will generate a dynamic response. I get the feeling this isn't what you were asking but it's an awesome tool so you might want to take note of it anyway
  5. I meant I think Collection and Practices got mixed up Writing scary legal letters is a sick hobby of mine so I know the act intimately I might have a theory about what happened. When it was a VARCHAR originally, MySQL truncated the contents to fit into a varchar field. When you changed it back to text later, the content that got truncated doesn't reappear - it's gone forever. I bet if you browse that field in PHPMyAdmin it is gone/truncated there and you have to repaste in the original into PHPMyAdmin.
  6. It didn't "hit the nail on the head" I explicitly said: If you're not familiar with the Gang of Four patterns you're probably not a highly skilled OO developer. I specifically said the test was for OO skill. I of all people would not argue that OO is the only correct programming paradigm in PHP. But, if the person you're interviewing claims to be an expert OO developer, they should be able to answer that question. I also addressed this at the time of my original explanation: If you're on IM, as he said he was, they will not know whether you're a programmer or not. And that you would be asking that question would give them 0 reason to believe that they have any latitude to BS you. You'd certainly have to be much more of a programmer to deduce their knowledge by looking at their code, versus seeing how competently and quickly they can answer a high knowledge-level question. Completely ignored, I noticed, was my suggestion to also use questions from the Zend Certification practice tests, which tests for ALL PHP paradigms including OO and procedural. The recommendation to start with Zend Certified programmers if they're available is a no-brainer.
  7. It would be this echo preg_replace('/<.+>(.+)<\/.+>/', 'test', $raw_data); What I was asking you to try would be the entire regex.
  8. Sorry, I hope it's not annoying to sidestep your original question, but the design of this (perhaps for reasons I'm not aware of) doesn't seem correct. If you're trying to solve the problem of 1 option tag having to represent multiple values, why not just do this: <input type='hidden' name='start' value='0'> <option name='filter' value='25'>25 Per</option> Or if you really need to combine them: <option name='filter' value='0:25'>25 Per</option> And then just explode by : once it gets to PHP?
  9. Isn't it Fair Debt Collection Practices Act? Just to make sure no time has wasted and this isn't a styling/DOM issue, have you checked the actual source HTML output and do you see the text getting cut off in the source also? Everything from before <title> and after <style> should be in a set of <head> tags or the browser will get confused. Like this: <html> <head> <title>My Simple Search Form</title> <style type="text/css"> #error { color: red; } </style> </head> <body> <h1>Client Database Search Form</h1> <li>Enter your customer's name or the last six digits of his or her social security number to ascertain case status</li> and <li> tags should always be nested inside of a parent <ol> or <ul> tag set.
  10. Try placing print statements right before all of your exit() calls to see if one of them is getting executed accidentally.
  11. Here is a more legible version of that code so others might be able to study it: <?php mysql_select_db($dbDatabase) or trigger_error("Failed to connect to database {$dbDatabase}. Error: " . mysql_error()); // Set up our error check and result check array $error = array(); $results = array(); // First check if a form was submitted. // Since this is a search we will use $_GET if (isset($_GET['search'])) { $searchTerms = trim($_GET['search']); // remove any html/javascript $searchTerms = strip_tags($searchTerms); if (strlen($searchTerms) < 3) { $error[] = "Search terms must be longer than 3 characters."; } else { // prevent sql injection. $searchTermDB = mysql_real_escape_string($searchTerms); } // If there are no errors, lets get the search going. if (count($error) < 1) { $searchSQL = " SELECT sid, sbody, stitle, sdescription FROM simple_search WHERE "; // grab the search types $types = array(); $types[] = isset($_GET['body']) ? "`sbody` LIKE '%{$searchTermDB}%'" : ''; $types[] = isset($_GET['title'])? "`stitle` LIKE '%{$searchTermDB}%'" : ''; $types[] = isset($_GET['desc']) ? "`sdescription` LIKE '%{$searchTermDB}%'" : ''; // remove any item that was empty (not checked) $types = array_filter($types, "removeEmpty"); if (count($types) < 1) { // use the body as a default search if none are checked $types[] = "`sbody` LIKE '%{$searchTermDB}%'"; } $andOr = isset($_GET['matchall']) ? 'AND' : 'OR'; // order by title. $searchSQL .= implode(" {$andOr} ", $types) . " ORDER BY `stitle`"; $searchResult = mysql_query($searchSQL) or trigger_error("There was an error.<br/>" . mysql_error() . "<br />SQL Was: {$searchSQL}"); if (mysql_num_rows($searchResult) < 1) { $error[] = "The search term provided {$searchTerms} yielded no results."; } else { $results = array(); // the result array $i = 1; while ($row = mysql_fetch_assoc($searchResult)) { $results[] = "{$i}: {$row['stitle']} <br />{$row['sdescription']}<br /> {$row['sbody']}<br /><br />"; $i++; } } } } function removeEmpty($var) { return (!empty($var)); } ?> <html> <title>My Simple Search Form</title> <h1>Client Database Search Form</h1> <li>Enter your customer's name or the last six digits of his or her social security number to ascertain case status</li> <style type="text/css"> #error { color: red; } </style> <body> <?php echo (count($error) > 0)?"The following had errors:<br /><span id=\"error\">" . implode("<br />", $error) . "</span><br /><br />":""; ?> <form method="GET" action="<?php echo $_SERVER['PHP_SELF'];?>" name="searchForm"> Search For: <input type="text" name="search" value="<?php echo isset($searchTerms)?htmlspecialchars($searchTerms):''; ?>" /><br /> Search In:<br /> SSN: <input type="checkbox" name="body" value="on" <?php echo isset($_GET['body']) ? "checked" : ''; ?> /> | Name: <input type="checkbox" name="title" value="on" <?php echo isset($_GET['title'])? "checked" : ''; ?> /> | Case Status: <input type="checkbox" name="desc" value="on" <?php echo isset($_GET['desc']) ? "checked" : ''; ?> /><br /> Match All Selected Fields? <input type="checkbox" name="matchall" value="on" <?php echo isset($_GET['matchall'])?"checked":''; ?><br /><br /> <input type="submit" name="submit" value="Search!" /> </form> <?php echo (count($results) > 0)?"Your search term: {$searchTerms} returned:<br /><br />" . implode("", $results):""; ?> </body> </html>
  12. A girl that likes law and PHP?? IM HERE TO HELP!!! When you say "cuts off" you mean you're not getting the full result back from the database? Or you are and when you try to format it text gets lost? This conditional operation does not appear to have any curly braces: if (count($types) < 1) And its code is not on the same line
  13. That sounds really specific. But, if you haven't already, you could start by perusing the examples in the PHP Manual: http://php.net/manual/en/function.ssh2-sftp.php http://php.net/manual/en/function.ssh2-scp-send.php http://php.net/manual/en/book.ftp.php Google Code Search is also awesome for turning up these types of examples: http://www.google.com/codesearch?as_q=ssh2_scp_send&as_lang=php
  14. In that case the method would be identical except you'd use \n or \r in place of the <br />. The concept is exactly the same. If you want to surrender some control over this process (that's what PHP is all about!) you may also have an easier time using this: http://php.net/manual/en/function.wordwrap.php Both my solution and the built-in function would work perfectly in an HTML or non-HTML (gd, imagemagick) context. The first part of my solution for figuring out the pixel-to-character ratio would apply in either case.
  15. Unfortunately neither PHP nor JavaScript can exercise any control whatsoever over where a user saves their downloads locally. This is completely the domain of the browser. If this is crucial to your project and you have a captive user base you might consider writing a Firefox extension to do this for you and mandate your users use Firefox and install the extension. That's really the closest you can get, those limitations are designed into how the browser works for good reasons and there's not a way around them.
×
×
  • 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.