Jump to content

beta0x64

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Everything posted by beta0x64

  1. Umm, well, assuming that you made a field for every single thing they could add to their cart (product1, product2, productn . . .), I would recommend that you grab everything with MySQL then manually compare them in PHP. This is the only way to iterate like that. I actually recommend that you make the user's shopping cart something like... id | userid | cart where cart is filled with ids separated by a |, so... cart = 1|5|3290|44|7 and so on this way you can get "cart" and explode() it into a list of ids, which you can link up with an inventory. Do you understand what I mean?
  2. Try passing it directly without trim and stripslashes... This will show if that is the problem.
  3. Certainly, liamloveslearning! First of all, do you know how to update a value in MySQL? update TABLE set field="blah", field2="blahblah"; http://dev.mysql.com/doc/refman/5.5/en/update.html To delete a value, you can set it to NULL, but to delete a row or even table, you can use: http://dev.mysql.com/doc/refman/5.5/en/delete.html Second of all, I would personally use jQuery to add the buttons, then jQuery's AJAX functionality to call a PHP script where you can validate what the user is suggesting to put into the database. Once it's validated, react appropriately. Remember, you have to make sure "l33t h4x0rz" don't send any naughty code into your database... I recommend htmlentities or htmlspecialchars... There are a lot of well-documented ways to do this. Using jQuery also allows you to dynamically update the page instead of relying on redirects, which causes a jumpy and unpleasant user experience. It also reduces the load on the server itself (you don't have to call the script to list the database's contents again and again, only one record). This is not a purely PHP way to do it, as Stuie_b suggests, but it is certainly a good one, I think. Good luck!
  4. I could make this for you...for a price. I would use two libraries, FPDF and PHPMailer. http://lmgtfy.com/?q=fpdf . . . I think you get the point.
  5. You are selecting the file by creating a link, right? Well, then you have to make your input suitable for a link. Try this function: http://www.php.net/manual/en/function.urlencode.php
  6. I am not sure how the Gen4 script works, but I would like to point out the following function: http://www.php.net/manual/en/function.mb-convert-encoding.php Also, http://www.php.net/manual/en/function.mb-http-output.php You need to find where the text is output in order to convert the encoding. This might be a great undertaking, and the necessary script probably should have been a serious consideration before making a purchase!
  7. What exactly is the error that is occuring? It is difficult to tell what is wrong from just your code...
  8. Hey guys I understand FF uses Javascript in their extensions, right? What's stopping me from using jQuery in my firefox extensions? How does that work out? If anyone has done this, please tell me some results, or else I'll have to try it myself! Thanks
  9. I would give this a shot: http://www.php.net/manual/en/book.sockets.php I'm not sure how CGI-mode changes things... but if you must send it as a POST, you can use sockets to form how your browser would send it, then send it to your new PHP script at the other side of the cloud. Not that difficult, look for some tutorials. If you were an intrepid explorer, you could always make a proxy and catch your own POSTs, but if you could do that, you might be able to do this!!!
  10. This site is pretty damn sweet, but I was thinking of something more like... Innovator has an idea, sends it to a pool of Designers. A designer breaks it up into functions/classes/etc., then the most cost effective/solid/logical design is picked by the innovator and is submitted to a pool of developers. Each developer is paid per function/per class, etc.. It's not neat and tidy, but I like the idea.
  11. Well, not really... PHP stands for Post Hypertext Processor, meaning that it already figures out all the results of your code before being fully loaded, so you're right in saying that it can not do it without reloading the page. It basically is just HTML by the time it gets to your browser. But, there's good news! With AJAX, we can do this by using Javascript to load the contents of a page and add it to the currently existing DOM. For super duper ease, I recommend using jquery. http://api.jquery.com/load/
  12. You could try to set a custom header with some kind of encryption. I have no idea how you could manage this, because AJAX is essentially the same as accessing a page with the browser, except the application performs it and adds the information to the current DOM.
  13. WP is a bit of a complicated application, but you possibly could do this. I would check out this page for help: http://mattread.com/archives/2005/04/wordpress-is-not-php/
  14. Whenever you link a person to part of your webpage, you are telling them to access a file on that page. The browser interprets what to do based on what kind of ending it is (php/html: display content, filetypes (zip, rar, bin, exe, etc.): show download, images: show image). So, you can apparently set the header content-disposition which will override this behavior. Look here: http://support.microsoft.com/kb/260519 I would take them to a php page that sets the header then jquery that loads the image and outputs it to the user? I'm not sure how to do this, to be honest. Actually, that wouldn't work. You would have to load the image with php so there would be no other html present, but do change the header. This could take some experimentation to get to work! It's a lot simpler to educate the user perhaps with a hover tooltip/div of some kind?
  15. Oh boy. I'm sorry to hear that you've been compromised. The recommendations state that you should... 1) Add code to perform strip_tags() on $shout in shoutbox.php 2) Prevent direct access to shouts.php with a .htaccess file By "sanitizing" the input, they mean that shoutbox.php is allowing a user to do naughty things to your computer by running specialized code through your shoutbox application. This is a rather serious threat. I would change my root password, maybe even make a chroot jail for your website. Somewhere in the shoutbox code, you need to find out where the input is taken in and you need to perform a "strip_tags" on it to remove html, script tags, etc. that could be used to execute code through your application as if it was the original intent of shoutbox.
  16. assuming that you ripped that off of the development page, examine the next function that they show you. function akismet_verify_key( $key ) { global $ksd_api_host, $ksd_api_port; $blog = urlencode( get_option('home') ); $response = ksd_http_post("key=$key&blog=$blog", 'rest.akismet.com', '/1.1/verify-key', $ksd_api_port); if ( 'valid' == $response[1] ) return true; else return false; } The ksd_http_post() function does not really submit anything. You must set the $request and $path depending on what you want to do. Continuing to read the documentation... the path for a comment check is "api-key.rest.akismet.com/1.1/comment-check" or simply 1.1/comment-check. The $request must follow the pattern of a url encoded parameter string.. Is it starting to make sense? The keys and parameters for $request need these values filled out... Really the documentation is your best friend when developing a complex application like this... http://akismet.com/development/api/ Get back to me! beta0x64
  17. What do you mean by an empty result? This sounds like one of those problems caused by a technicality. Also, could you try calling it without a timeout, just to rule that out?
  18. You could try... http://www.w3schools.com/Css/pr_text_text-indent.asp or text-align or something to that effect.
  19. Well, to be frank, you're asking someone to write the code for you... But, you could always store in the MySQL database for "Notes" the path to an image which you could use to make an <img> upon loading the page.
  20. I do not understand. If it doesn't have the model for State Farm, then is it an option for the select? I'm really not sure what you're trying to do. As far as making it appear or even adding it to the page/DOM (and even the MySQL database), of course you can. You might need jQuery LiveQuery, though, unless you want to make the select box hidden on the page. It's really up to exactly how you want to do this. Generally, have jQuery, through AJAX, send the selected option as a parameter to the PHP page (maybe some kind of session token to prevent abuse here?), then have PHP check the MySQL. Use the callback to read the output from the php page. If you want to make the select box's options dynamic, then you'll need to build it with PHP that checks the MySQL, put it through the callback, then add it to the DOM with jQuery. You will need LiveQuery if you do it that way. Hope I helped!
×
×
  • 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.