Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. getElementById is a method of the document object. Should be: var content = myIFrame.contentWindow.document; Edit: although you might want to consider changing the name of the variable, as it's a little misleading now.
  2. Modify the class so that you only escape the string as you output it to the web-page:
  3. exec allows you to supply an "output" array as the second argument. You also need to have imagemagick write to stdout (standard output) in order to actually return the data in the first place. We'll need to see the command you're using to help with that though...
  4. This is not an issue with PHP. If you look at the source of the web page you'll see the browser is simply reading the <text> as a HTML tag, and it's actually there but with no visible output on the web page. Why can't you use htmlspecialchars() exactly? Don't apply it to the string before you run the command, but as you output it to the web-page: $hello ='<vvvvv>'; echo htmlspecialchars($hello);
  5. Can you be a little more specific with the issue? Perhaps directions to recreate the issue at that website too? You've thrown a vague problem at us with a chunk of code and expected a solution. I can't speak for everyone, but I don't want to waste time trying to find out what the issue actually is, before I can even offer any help trying to find the cause of it.
  6. Sorry, that's still not a very clear description of what relationship the two tables have. There's matching affiliate ID's I can see in your screen-shots. Are these actually the same affiliate, or is one table a different type of affiliate? Does the bonus table extend the sales table or is it an alternate? In the report should they show combined into the same row, or over two, or over two+ rows?
  7. When I first suggested a join I thought that the tables were relative, in that the bonus table provided more details for the sales table, linked by the affiliate_id. Now after looking closer at the data I'm not so sure, and a union might the better option. What is the relationship between the two tables? How do you want the data to be merged into the report?
  8. A join would be more fitting here, fugix. Greystoke I'm guessing the "bonus" table isn't always going to have a matching row for each affiliate? (Thinking logically about a bonus anyway...) If that's the case you should use a LEFT JOIN, in which the query will return entries from the first/left table, even if there's not a matching row in the second/right table: select sales.*, bonus.* from sales left join bonus on (sales.affiliate_id = bonus.affiliate_id) To avoid any ambiguity errors, you'll need to reference the table name (or create an alias to each table) for each column you use in the query. Also it's worth noting that you should avoid using "select *" - here's why.
  9. I don't know if AS supports it, but could you use JSON to pass the whole data structure through as a string?
  10. The event in your code is only bound to the form named "form1". The event shouldn't be getting triggered for other forms. Going back to the original example I provided, add the the following form on to the end. You'll see that when you run it the submission works fine. <form method="get" name="other_form" action=""> Other form value: <input type="text" name="value" /> <input type="submit" value="Submit" /> </form> If you are having troubles I would probably guess that the problem is either with multiple forms named the same ("form1"), or the mark-up isn't correctly closing each form. That in effect would make it all part of form1 (assuming it came first). Can you post the HTML?
  11. Using the SCRIPT_NAME as your title is certainly not the way to do it. Plus your code is very static/restricted, despite pulling in the title dynamically. It will only ever work for "Home > thispage" - and the page name as mentioned, if based off of the script name, wouldn't look very good (and possibly not even make sense to the user). It's hard to say how this should be done really, as we know nothing about the navigation structure of your site. When using content from a database it's generally the case to dynamically generate them, but in other cases you may need to set them up yourself. Either way you should only set the breadcrumbs at the highest level within each controller/page's PHP code, and have centralized logic that would handle everything else. If you post more information we can help you further.
  12. I think they want a Java applet to run on the user's screen when someone interacts with a PHP-driven web page. Ah, that would actually make more sense. I was thinking along the lines of a servlet
  13. Err.. I'm not entirely sure what you mean by that. The commands on the server will be executed at the same time as the rest of the PHP code..?
  14. Provided the Apache user has the correct permissions to do what you want to do, you can execute shell commands on the server like you would through a terminal. Take a look at shell_exec. There's actually a variety of functions you can use to execute the commands, all differing slightly; system, exec, passthru. Plus other methods I'll not get into right now.
  15. Would you care to share your solution? Might help someone else out.
  16. This isn't really what I'd qualify as session data. You just need to, as you said yourself, pass the invoice ID through the URL. Obviously you need to perform the necessary security checks, but it should just be as simple as that. What are you struggling with exactly?
  17. When you say "without having to have them submit and then be told" - I assume you mean on the next request? Not actually as they click the submit button? A really easy solution is to just display an alert() when they submit the form having entered less than 3 characters: <script type="text/javascript"> window.onload = function() { document.search_form.onsubmit = function() { var query = document.search_form.query.value; if (query.length < 3) { alert('Please enter a search query more than 3 characters.'); return false; } } } </script> <form method="get" name="search_form" action=""> Search for: <input type="text" name="query" /> <input type="submit" value="Search" /> </form> If you use this code, remember to modify the form and input names within the JS to match your form's mark-up. Edit: Also you should add the window.onload block to within your <head>, and obviously the form in <body>. If you already have an event assigned to the onload of the window, you need to merge the two as you can't have more than one.
  18. The first item in the array is empty because there's a leading slash in your string: "/co/pastel/albino/piedball" The delimiter is what delimits two strings from each other, so the left-side of the first slash is treated as a string (even though it's empty). Remove the leading slash to remove the empty 0 index. A cleaner solution for conditionally setting the variables here would be a switch statement: switch ($key) { case 0: $gb = $ats; break; case 1: $base = $ats; break; default: $hets[] = $ats; } The reason your code wasn't storing the remaining values in the array before, is because you were redefining it as an empty array in each iteration: $hets = array(); $hets[] = $ats; That would mean only the last item in the array is stored. Move the array declaration to outside (before) the for-each loop and you'll have better success.
  19. Oh.. and SQL server & Oracle (PL/SQL) for almost 3 years.
  20. Started with HTML/CSS about 6, maybe 7 years ago. Started with PHP & MySQL about a year after, and then JS about another year after that. Been working with Java (for Android development) for around 6 months - although I'm struggling to find the time to do anything of note with it.
  21. It depends by your definition of animate here. JS is obviously not right for creating a small cartoon-type animation, but effects and transitions are no problem for modern web browsers. Take a look at this site: http://www.worldofmerix.com/
  22. Have a read up on PHP sessions. They'll provide a way for you to preserve the login state between requests. Currently you're just querying a database and printing the results out; on the next request that data is lost.
  23. Did you read what you posted? With a salt (as you actually go onto suggest anyway), md5 and sha1 are not easily "broken". Could you elaborate on how you'd break them exactly? There's numerous threads on PHPFreaks that suggest prove the exact opposite to what you're saying.
  24. 'do' is a reserved name in JavaScript - look into 'do .. while' loops.
  25. Adam

    Tattoo's

    My mate that I live with is a tattoo artist. He's looking to get into it professionally I think, but at the moment he just has all the gear in his room and tattoos my friends (which I'm not sure is actually legal). He does most of the designs for people, and he's pretty dam good at it. He let me have a go with the tattoo gun on some pig skin a few months back, and it is so hard to even draw a straight line! I have a natural shake too so I was completely useless at it. He's offered to do me one soon, which I plan to take him up on, but not sure what to get yet!
×
×
  • 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.