Jump to content

Brandon_R

Members
  • Posts

    115
  • Joined

  • Last visited

    Never

Everything posted by Brandon_R

  1. What are you trying to do? Are you trying to change the statement '$age = 0' in a php file to the value of age passed in the form? If so you will need to use string literals to built the query to search for ie '$age = ' and the post value to built the replace ie '$age = ' . $_POST['age']; and then search and replace it in the file and then rewite the new code in the file. $fileContents = file_get_contents('oldfile.php'); $newFile = str_replace('$age = 0;', '$age = ' . $_POST['age'], $fileContents); file_put_contents('oldfile.php', $newFile);
  2. Does OpenID work? I've been trying to get it to work to make logging in easier but it was to no avail. Usually i type in yahoo.com on other websites and it works but not here. The error is the identifier did not return the proper results.
  3. I actually want to match the entire psp code from an html page. Say we have a page with html such as title, head, meta, content etc. I want it to pull those psp codes from the page and hopefully into an array, one code per array element. It matches the code some times and other times it just doesn't get a match.
  4. I created a regex to match psp codes from full to basic #!!999999999 Monies 0x00000000 0x00000000 ;this is a comment 0x00000000 0x00000000 ; Mod this ;mod this #Hello 0x00000000 0x00000000 Here it is (#!*.+[\r\n]*(??:;.+[\r\n]*)*(?:0x[a-f0-9]{8}\s0x[a-f0-9]{1,8}(?:\s*;.+)*[\r\n]*)*)+) Can someone show me where i went wrong? Im pretty sure it's the newline as it checks for \r\n but im pertty sure on html pages its <br /> but still not positive. A Code can have one title and infinitly* many code lines followed by comment lines
  5. Sorry, did not see Flash Actionscript 3 (just showing one state) Silly me.
  6. It looks as though the state Washington is hard coded into the file. Make sure you are passing through the state when you click.
  7. We have a winner - PFMaBiSmAd's post Facebook Like as an example - if someone likes a page they will click it if not then don't say anything. Kinda iterating the old saying (If you ain't got anything nice to say then don't say nothing). I am in favor of a one sided rep system like a "Like" OR "Thanks" system and not a double sided one like ratings/thumbs up or down etc as those can cause trouble.
  8. Nope don't have an example, i just pictured it in my head lol and i thought it looked good Anyways thanks for reading my suggestion though.
  9. Take a look at the logo See how the question mark (?) looks like a P? How about we use that as the first (P) in PHP. Thanks
  10. Hello guys, i wrote a regex to capture a repeated group but instead it repeats the captured group only getting the last line matched. I wanted it to match _C0 Infinite LP (8000) _L 0x110E6938 0x00001F40 _L 0x110E6940 0x00001F40 _L 0x110E6950 0x00001F40 _L 0x1162A528 0x00001F40 With name tags so after the PHP regex has run, codeTitle would contain the stuff after _C0 and codeAddresses would be an array with all the lines on the left such as 110E6938, 110E6940 etc and codeValues would be an array with all the stuff on the right. So far i have ((?P<gameCodes>(_C0\s(?P<codeName>.+)\r\n(_L\s0x(?P<codeAddress>[a-f0-9]{8})\s0x(?P<codeValue>[a-f0-9]{8})(?:\r\n)?)+)))+ but that doesn't work. It only gets the last line and sometimes it doesn't even do that can you guys help?
  11. Didn't know PHPfreaks was made using the zend framework Any others?
  12. Could you guys share some websites built using the zend framework? Doesn't have to be opensource, i want to check out loading times, see what the zend framework is capable of etc? The websites can be a total zend framework application or just a part of it but i perfer total website built using the zend framework. In addition, some zend framework scripts could be helpful so i can see how it's used etc.
  13. It's better practice to have the function getName() to return private variables, as that name should be. Simply replace your echo with return and then it shall work. Then to place the name in an array create a variable like $person = array('name' -> $name); then it shall work. Then to add other values to the array $person['age'] = $age etc. On a side note since you are just beginning, you shouldn't head right in to OOP as it can be confusing if you don't know the basics.
  14. You need to run urldecode() on the variable.
  15. You would need to use javascript/ajax to perform the search and return the results in a div id. Assign some keywords to the catgory 1 select menu and when clicked on it searches the database for the keywords ie in your case glove, and returns the results in the div id you specify.
  16. <?php $teams = mysql_query(" SELECT teamid FROM team WHERE ladderid = $ladder ORDER BY teamid "); while ($team = mysql_fetch_array($teams)) { $gamesWon = mysql_query(" SELECT matchid FROM matches WHERE winnerid = $team[teamid] "); $gamesWonCount = mysql_num_rows($gamesWon); $gamesLost = mysql_query(" SELECT matchid FROM matches WHERE loserid = $team[teamid] "); $gamesLostCount = mysql_num_rows($gamesLost); echo " Games Won: $gamesWonCount, Games Lost: $gamesLostCount, ToTal Games Played: ($gamesWonCount + $gamesLostCount) "); } ?>
  17. In addition to using CURL you may want to check out Google's Search API - http://code.google.com/apis/ajaxsearch/documentation/
  18. You could put this in the body tags of the page <body onload="submitform();"> and put the following function in javascript tags function submitform() { document.form.submit(); }
  19. You could try something like ioncube but i don't suggest it. Most people including me will NEVER use encrypted scripts.
  20. That may be what's known as a 'special case' rather than universally applicable. Whatever!! Being a creative genius, I decided to use my first name and the initial of my surname for my username here. Quite a story!! Same story with andy just i put an underscore between them.
  21. An api usually outputs the data as XML so you can have id, title etc as XML tags and the value of that inside the tag. You would need to use a mysql query to pull the data and then use DOM etc to insert the data into a tag and output it. Then the client site would use DOM to get the XML and parse it and output it to their visitors.
  22. Adding onto the SEO suggestion the above posted suggested, the regex i would use for a nice SEO friendly name will be '#^[A-Z0-9._-]#si' [/cODE] Basically that allows any alphanumeric character, an underscore, a dash or a period. You might want to add or remove constraints as you wish. Windows doesn't allow slashes, arrows, colon, asterick, question mark bar or quotation marks in file names so you might want to prevent files to be named this incase a user downloads the file and gets an error on his/her windows pc.
  23. Oh i thought you meant a normal variable created outside the function and you want access to it inside the function, Session is just one of the superglobals and can be referenced in the globals array. $GLOBALS['_SESSION']['user_id'] would contain the same as $_SESSION['user_id'] can be used anywhere, ie in functions etc
  24. You can pass the value as an argument or globalize it.
×
×
  • 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.