Jump to content

HaLo2FrEeEk

Members
  • Posts

    724
  • Joined

  • Last visited

    Never

Everything posted by HaLo2FrEeEk

  1. I'm not using the database at all for this page, except in the header and footer, which I use on every other page that uses this same layout.
  2. Well I'd hope it'd be secure from SQL injections...seeing as I'm not inserting anything into the database :/ And I've built a complete GetFileshare class that will grab the fileshare of any gamertag supplied and display either screenshots, films, maps, or gametypes. Unfortunately, I can't post it here since it'll be considered advertising. Darn.
  3. Hey, I was wondering if there was a way to create a virtual webcam / audio device in C#. I found this site called justin.tv that lets you stream media from a webcam live to the site, and people can watch and listen. There's also a plugin to stream static video files from your harddrive called SeeToo. There are a few programs out there that will simulate a webcam device readable by the streaming interface, but they either don't work how I want them to, or they don't work with Vista x64. What I want to do is make a little app that will let me load up a windows media playlist and create a little picture with the album art and song title/artist/album, etc. then feed that to the streaming interface so I can stream the music live when I'm offline. Since something like this has been done with other programs I know it's at least possible to make a virtual video device, but is it possible to do the same with an audio device? And how would one go about doing something like that in C#? So to wrap up, basically what I want to be able to do is load up a playlist of audio or video files and create a virtual video and audio device that the audio and video will play through. If it's an audio file in the playlist, the program will get the album art and title/album/artist info and make that the video, if it's a video it will obviously just play the video. Anyone able to help me out with this?
  4. I'm not trying to advertise, I want to post it for people to use. You're telling me there's nowhere for people to post their own php classes?
  5. EDIT: Ok, nevermind, for whatever reason it was printing the URLs the same, but the url I grabbed from the parsed HTML was escaping the & signs, so it was passing the URL with the escaped entity, which was causing it to have issues. I got it working now and I just wasted a ton of time typing this post! Sorry! I'm trying to make something so that my users can embed images from another site in my forum. The reason they can't is because it's a dynamically generated image that uses this format: http://www.bungie.net/Stats/Halo3/PlayerModel.ashx?p1=0&p2=8&p3=6&p4=6&p5=2&p6=26&p7=21&p8=24 That's a player snapshot from Halo 3, a player's current armor variant. The link above is mine. Now, I've got a function that parses that information from the remote page here: http://www.bungie.net/Stats/Halo3/Default.aspx?player=halo2freeek You can see the image at the bottom. My function works, I've tested it by printing out the URL. Here is my code: <?php function parseModelURL($gt) { $html = file_get_contents("http://www.bungie.net/Stats/Halo3/Default.aspx?player=".$gt); preg_match('%PlayerModel\.ashx\?(.+?)"%', $html, $match); $modelurl = $match[1]; //$modelurl = str_replace("&", "&", $modelurl); if($modelurl == '') { $modelurl = 'null'; } return $modelurl; } $gamertag = str_replace(" ", "+", $_REQUEST['gt']); $model = parseModelURL($gamertag); $snapshot_url = "http://www.bungie.net/Stats/Halo3/PlayerModel.ashx?".$model; $snapshot = file_get_contents($snapshot_url); echo $snapshot; ?> If a person tries to visit that link with a missing value, or without any values, it shows this: My code is supposed to parse the last bit of the URL, this part: p1=0&p2=8&p3=6&p4=6&p5=2&p6=26&p7=21&p8=24 And it does, and returns it and saves it to $model. Then I attach that to the beginning of the url: http://www.bungie.net/Stats/Halo3/PlayerModel.ashx? so I should have the full link I posted at the top of this post. Then it uses file_get_contents to retrieve that image and for whatever reason, I still get the grey image. I've tested it by manually putting in the whole URL into the file_get_contents function and it works fine, but if Ilet it insert the URL in there using the variables it echoes out the grey image. I cannot explain why this is happening and it's really REALLY annoying. Please, can someone help me figure this out! I'm going to be using htaccess to rewrite the url so instead of this: http://infectionist.com/misc/snapshot.php?gt=gamertag it's http://infectionist.com/misc/gamertag.png But I need it to work first. Thank you in advance for any help!
  6. I don't know where I should post this. I wrote a PHP class that I want to make available to the PHPFreaks community. I'd also like comments on it (critique) on how to make it better and/or improve things within it. I was thinking PHP Applications, but that seems like a place to post official php stuff, not stuff that people here wrote. So, anyone know where, if anywhere, I can post this?
  7. That's the karma train coming for you. I'm sorry but you were all over me telling me how much my stuff sucked on the first page. And I hear what you're all saying. I do know a lot about PHP validation, I just haven't done Jvascript in so long that I'm a little (read, a LOT) rusty. I didn't even know what XSS is. One point Iwanted to make clear is that I WILL (when I get around to working on this again, I'm a man of many, MANY interests) be implementing PHP validation that will not allow submission of the form if all the required information is filled in. The following fields MUST be put in: Gamertag Film Email Accept Price Accept ToS For now those are the ones I'm requiring. I'll probably (read, will) do checks on all of them to make sure no one modified the code to, say, submit it without selecting a resolution or format, but I wanted to reiterate, these first steps were a combination of Javascript validation and making it look pretty to the end user. Like I said I do one step at a time and I finished the really hard stuff on this step (which was retrieving the information from the offsite page, parsing it to get what I wanted and displaying it on the page using AJAX [trust me, that was a LOT harder than it seems, I thought it'd be easy too]), I went and made it look a little more appealing. I might consider switching to divs later, I don't know, but tables work regardless of what they're meant for, they work for this, and well. Thank you all for your replies, I will take them all into consideration when I start work on this again and I'll post when I have more to show!
  8. How is adding Javascript to make it look good then PHP validation on the next page lazy? I'd say that's the opposite of lazy. Lazy is the fact that I work on this once a month, that's lazy, but you don't see very often people doing things like this actually going out of their way to make it look good and work like I am. I have a policy in place, I wrote up a huge post at my own site about exactly how all of this was gonna go down. I have papers written up at home detailing every step of the process, validation, submission, everything. I'd say that you're being a little too assuming in what you're thinking about me, maybe you should have asked. Just because I do one step at a time doesn't mean I only have one step at a time planned, I have the whole thing planned.
  9. I have years of development experience, too.
  10. Ok, I understand now, daniel, I didn't know you could do that so simply since I don't use FF but I can see now. Javascript is still a decent way of doing simple validation, it's very widely used I know that. I was always planning on having php validation on the other end (submit.php) that would either tell the user they'd forgotten to enter something and send them back (which would be harder), or just print the entry fields for what they forgot to enter and make them enter it. The latter will be easier since I have the javascript that hides and shows the div containing the rest of the form, I wouldn't know how to make that appear on page load...well, I suppose I could, I just think it'd be easier to simply reprint the whole form with the valid entries printed as text and the invalid entries printed as text boxes, forcing them to enter it before the script will continue. That will all be done in php. Does that sound like a decent plan? Should I simply remove the javascript I have now, or should I leave it? I'm partial to leaving it there, mostly because it took a long time to get everything to work together with the fading and highlighting and everything.
  11. Well I'm using the code from the link that premiso posted above, but all that does is return a yes or no if the login was successful. I changed it a little bit to accept GET values from the url to provide the login details but that's it. I don't know how to actually get the page I need to get and parse it WHILE logged into the .net service, then log out when I'm done. I've never been good at cURL (actually that's an overstatement, I've used it once). I use the snoopy library of file_get_contents to retrieve offsite pages, and I don't know how to use the snoopy library to sign into .net.
  12. Now that we're on better terms, can you help me figure out some ways a person would be able to bypass this first, simple layer of protection that I've layed down? I know t's only Javascript, but there has to be something more I can do to help.
  13. I just wanted testers for the service only though, not the layout or the look of the page. Bugs, etc. If there's something I can do to make it so that the form can't be submitted (or is harder to submit) without filling in all the things, purely using Javascript as the first step, then please, let me know about that. For now, I want to make it work. Inline styles are fine for me, tables, etc. That works, which is what I care about now. When I'm done making it work, I'll make it pretty but I don't do that all at once. I'd rather see raw output that works then a pretty page that doesn't. I'm not refusing the help, I need the help, I just wasn't asking for help on the layout, I said that. gevans, I'm sorry I blew up at you, it wasn't yo, it was darkfreaks. If there's one thing I hate it's when people say something sucks without giving ways they can fix it. he started by saying my validation sucked and giving me links to php functions, I told him I was using javascript for this first layer of validation, he told me that I had poor programming concepts, I told him that I was going to use php, just not this step, next step, he said that I had to use php, I told him, angrily at this point, that I said I was going to use php I just was only using javascript for this first step. Then he told me I needed to clean up my code, I told him it was the last thing I did. Then you, gevans, posted telling me that I was stupid for using tables, that I needed to use list tags for my links (I'm still not sure if you even meant the navigation links, I don't know how I could use a list tag for that), and then again mentioned compliance, which I'd already stated was the last thing I ever did. Maybe I'm not that good at this, I'm better at php anyway, I just need help making this more secure, not pretty. If you guys can give me comments on how to make it work better, I can make it pretty later, it's not public yet (except this test, it is). I don't know how one would go about removing the onsubmit attribute of a form and still submitting it. Do they save the form to their computer and modify the code so that it submits to the actual url and not the relative page? Seems like a lot of trouble for nothing since the next step, which will use php validation, will catch all those missing fields and just send them back to the actual form page and they'll have to start over.
  14. I never got the help I needed with this...I know it's possible because there are services in place already that do something like this. At the very least could someone help me figure out how to make the code posted by premiso work for what I need to do. Basically I need to grab a page that's only accessible if you're signed into .net.
  15. Oh my freaking god. Ok, just stop it, then, all of you. Obviously none of you read otherwise all these stupid questions would be answered. darkfreak, you're starting to piss me off. I know my code isn't perfect, I know there are errors, bugs, glitches, and unvalidated code. I KNOW, that's why they call this a TEST, so you can TEST these things to find the bugs and FIX them. code validation is the LAST step I do because I PERSONALLY find it tedious to do it after every step, that's just me. You do it how you want, I will do it how I want. I don't care about your XSS attacks, this is the first step. Javascript doesn't allow for the same kind of feature set as php does, thus when I have my php code (on the next step, that isn't written yet) go through the data that's being input, it should catch it all. The javascript is an extra little feature to stop half the people from submitting the form if everything's not filled in, the rest will be stopped by the php. gevans...I realize you wre trying to be helpful but I wasn't asking for suggestions on the layout of my site. I don't give a shit if you don't like that I use tables, I'm gonna keep doing it. It looks fine, it works, I didn't write it, so get over it. Notice how if you go to the forums it's the same layout, and at the bottom there's a nice little link saying "xbox 360 by scott stubblefield"...that's becuase he wrote the template for a phpbb2 forum and I modified it so I could use it with my frontpage of my site. I find tables to be more organized and divs to not be as compatible, so I use tables. Where do I have a list of links, in the navigation bar? Why would I use ordered list or unordered list in the navigation bar, I don't want bullets or numbers up there and I don't care to write the css to get rid of them. Oh and where is the inline styles? I only had one bit of style code on that page and I got rid of it because the feature it was for didn't work properly. And yes, submit.php should be printing an array, it should be printing the submitted POST array from the form on capture.php. And how can you not know what a gamertag is? How old are you? Whatever, use halo2freeek, that's my gamerag, it'll return a list with the item "rack on tours". And for the last time, compliance checks are the ABSOLUTE LAST THING I DO. My workflow: 1. make it work 2. make it pretty Ok?
  16. Thank you, I will, but that's the last step I take. I find it's too tedious to keep doing it because while the code that I write is pretty clean to start with, everyone makes mistakes and I'd rather fix them all at once than after every step. It took me a year after I brought the new version of my site online to go through and validate it...still, I did it, so yeah.
  17. Do you read?!? Honestly, for Chist's sake. This is one layer of protection only! The people that have JS disabled won't even be able to start the submission process because when they enter in their gamertag, the page uses AJAX to load up the films for that gamertag. Since AJAX is called up via Javascript, the films will never load up, and thus the form will never appear, and thus no, they won't be able to enter anything. Better programming conepts than you think, you just have to actually THINK, and not just assume, use what you know. This is THE FIRST STEP of the system, the VERY FIRST STEP. Directly after the person submits this information I'll have my php do a load more checks to make sure everything is valid. Things like email validation, referencing the gamertag with the saved film clip submitted, and a ton of other things to make sure things go smoothly. This will all be transparent to the user but it will be there. Have any more constructive comments?
  18. You realize that this is only one layer of the validation. Basically all I'm doing here is checking to make sure the fields were filled in period. In the next layer I'll check to make sure they were filled in with valid values, but I wanted to stop people from submitting the form if the information wasn't there. How about next time you actually read the post instead of just clicking those fancy little underlined words and then insulting me...mmmmk. For the record, this one layer of validation is using Jvascript only, no php involved, thus I don't have the same abilities as I will when I incorporate the second layer of validation.
  19. Note: When this service is 100% set up and operational it will be something I charge for, but this test is just that, a test. No information is submitted to the database, nothing is saved, nothing is sent. Nothing will be charged, obviously, since who charges for a test. I wanted to clear that up since people on another site called me many mean names because they thought I was charging them to test this. There is no charge, I haven't set that up yet. I had this big long post written up, but in my haste to grab the URL to link to it I accidentally closed the tab with the post page...so it's gone. I suppose I'll just say I added a bunch of features, fixed a bunch of things, and I'm at the point where I should stop procrastinating and start working on the actual submission for the darned thing! I've set up a public test for people to mess with, test, break, find things I need to fix...etc. Please check it out here: http://infectionist.com/misc/capture/public_test/capture.php I think it's pretty cool. Nice little fade effects when you don't fill in a required field, and fade out when you fill it in. It uses my getFileShare class (which you can find a thread about in this forum). Basically it's a custom php Class that I wrote that'll let you retrieve the fileshare items of any gamertag supplied, it makes it REALLY easy. I cut down 15-20 lines of code using it, and that's pretty considerable. As far as I know, validation is working, but that's what I want people to test the most completely. The following fields are required: Gamertag, Film, Email Address, Accept the price, and Accept the ToS. Those fields must be filled in/checked for a submission to take place. If anyone manages to get it to submit without filling in one of those fields, please let me know. Also, probably my favorite new feature is the little notification you get when the price changes (when you switch between 720p and 480p). Try it, I won't ruin the surprise, but I love it. Just select a film and change between 720p and 480p, back and forth. I've tested it as much as I can in IE7 and Firefox, but since I know how it's supposed to work, I can't find things that don't work how they're supposed to do, that's why the public test! Anyway, try it out, lemme know what you think. Submission doesn't actually submit anything, it just takes you to a page with the information you entered on it, but by all means, click the button, you'll need to to test it properly. Here's the link again: http://infectionist.com/misc/capture/public_test/capture.php
  20. No, I changed it after posting that link to just hide the "therest" div everytime the gamertag textbox was changed, no matter if it was emptied or whatever. This should stop people from being able to enter all the information, change the gamertag, then click submit, confusing my system. This way if they change the gamertag, they have to reselect a film from the list, and refill all the information out. I think I've got this under control, thank you very much for your help.
  21. I guess I didn't explain properly. The snippet I posted is from a php page that will be called via AJAX, after the page is loaded completely. The ajax page recieves the field "gt" as an input and uses it. If that field isn't present it messes up the validation process of the parent page, causing all sorts of issues. I need to hide "therest" so that no data can be entered there and thus the validation will always return false until the "gt" field is filled in. Filling in the "gt" field and either clicking a button or blurring the field will call the AJAX again, populating a div directly below it, which contains a select element. When a value is chosen from that select element then "therest" can be shown again. Here's the page I'm talking about: http://infectionist.com/misc/capture/public_test/capture.php if you don't have an xbox live gamertag, just use halo2freeek, that's mine and it'll work for testing purposes.
  22. I did a lot of research on this and tried as many things as I could, but I still can't get this to work. I have a div I need to hide on a certain event within my php file. The event already has a check to kill the script if a certain parameter is met, so I tried something like this: $gt = $_REQUEST['gt']; if(!$gt) { ?> <div style="display:none;"><select name="film" id="film"><option value="#"></option></select></div> <script language="Javascript" type="text/javascript"> document.getElementById('therest').style.display='none'; </script> <?php die("Gamertag not specified<br><br>"); } Which I thought would print the javscript code to the page when the value "gt" was not supplied, thus making the div "therest" hidden. It's not working though. Can anyone lead me to a solution to make this work please? Thanks in advance, and sorry for all the questions today!
  23. Nevermind, this seems to only work in Internet Explorer, I tried it in Firefox and it only unhighlighted the main parent node, not the previous sibling. In IE7 the previous sibling gets unhighlighted no problem...any ideas for a way around? I don't want to have a lot of code to differentiate between different browsers, I'd just like a universal solution that will work in both browsers.
  24. Will that work if the Javascript is located in a separate file? It's called up in the hader from a .js file. It should work, though, I have something similar to that...I'll try it, thanks! Edit: Worked great, thanks! Now I have anothr question, say my HTML is like this: <tr> <td id="email_ex" width="50%" valign="top" style="border-bottom:1px solid black;">Email address (so I can keep you updated on the status of your request and contact you when it's done.)</td> <td id="email_entry" width="50%" align="center" style="border-bottom:1px solid black;"><input type="text" name="email" id="email" size="35" onchange="unhighlight(this, 't')"></td> </tr> And I need to apply unhighlight to both the parent of the input box, and the other table data node...would I use previousSibling? I'm not quite sure how that works...I suppose I could just try it... I've added another variable into my function called "sib". If I want to fade both the box with the element and the previous box in the table row, then I set it to "t" and it'll automatically do both.
  25. I have something set up like this: <td id="email_entry" width="50%" align="center" style="border-bottom:1px solid black;"><input type="text" name="email" id="email" size="35" onchange="unhighlight(this.parentNode)"></td> And I'd like to grab the input field's parent's ID, the table data tag, whose ID is email_entry. I don't want to have to manually put in the elementId of each item I'm going to put this code in. It's part of a validation process, when the submit button is clicked there is a javascript validation on the required fields. All the fields that don't validate turn orange. I want that orange to fade when the person fills something in, even if it's not the valid input for that field, it'll just be validated again when they click submit again. I'll be doing server-side validation too, but this is just an extra measure. Can anyone tell me how to get the parent node's ID for an element? Like in the example above, what Javascript would I use? I've tried this.parentNode, this.parentNode.className, I don't know what else to try, but google is failing me.
×
×
  • 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.