Jump to content

Brandon_R

Members
  • Posts

    115
  • Joined

  • Last visited

    Never

Everything posted by Brandon_R

  1. Can't get it to work. Edit, i now see they have to contain the same amount of of values in the array so they can get matched. Ill see if i can write an error checking to stop if it doesn't match. Im new at PHP so ill need a little help.
  2. Hello guys can someone show me how to create a loop for this array echoing out the result. The array is $hello = array("hello", "guys", "hows", "it"); $goodbye = array("Its", "going", "find", "thanks"); $aiight = array("Good", "then", "thats", "well"); After the above array is run through the loop the result for each echo should be Hello Its Good Guys Going Then Hows find thats It thanks well. I tried nested foreach loops and the result was catastrophic. It was more like a factorial problem than matching the first element in the array with the first element in the other 2 arrays.
  3. I am checking for all the variables to make sure they exist before saving.
  4. @Alex Seems like im going to try your method. I am going to do some error checking for each foreach. I would like to know which number the foreach loop is on so i can output Input for example Number 7 was incorrectly formatted. Is there any native way to do that or do i have to add counter++ in the foreach to determine the number it is at.
  5. Hello guys i am having a bit of trouble looping through arrays. Notice i said arrays I was just wondering if i can do this $array1 = explode($_POST['array1']); $array2 = explode($_POST['array2']); foreach ($array1 AS $array1exploded AND $array2 AS $array2exploded) { code here to play with the arrays } If not could you guys guide me on how to do it.
  6. Hello guys i need a bit of help with this. I need a regex to extract the base URL from a long url. Please take a look at the following example: http://www.example.com/1-link-to-the-page.html after the regex is run on the above code $url should contain http://www.example.com/ Thank You In Advance for your help
  7. Google can follow javascript links now. It is evolving guys keep up
  8. Try this: <?php // The message $message = $_POST['nameFirst'] . ' ' . $_POST['nameLast'] .'\r\n'; $message .= $_POST['school'].'\r\n'; $message .= $_POST['email'].'\r\n'; $message .= $_POST['nameFirst'] . $_POST['nameLast'] ."has entered the fall league."; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail('basketball@metroindybasketball.com', 'Fall League Registration', $message); ?>
  9. Thanks, i might need to use ajax because the textarea and the upload form are on the same page and i want to do it without reloading. Brandon_R
  10. Hello guys i was wondering if this was possible. Inputting the value of a text file into a textarea based on a txt file that a user can upload just to be read then deleted (not stored in the server). If so could you post me to some guides? i've tried searching. Brandon_R
  11. I cant belive i didnt see this. if (!preg_match('#^U[LC](?:[uE]S|JP)-[0-9]{5}$#', $game_region_id)); <--- look at the ';' that doesnt belong there. Thanks anyways guys, wasnt the regex
  12. Here is the code that runs the function: var $validfields = array( 'gamecodearchiveid' => array(TYPE_UINT, REQ_INCR, VF_METHOD, 'verify_nonzero'), 'gamecodearchivename' => array(TYPE_STR, REQ_YES, VF_METHOD, 'verify_gamecodearchivename'), 'gamecodearchiveregionid' => array(TYPE_STR, REQ_YES, VF_METHOD, 'verify_gamecodearchiveregionid'), 'gamecodearchiveregion' => array(TYPE_UINT, REQ_YES, VF_METHOD, 'verify_gamecodearchiveregion'), 'gamecodearchivecodes' => array(TYPE_STR, REQ_YES, VF_METHOD, 'verify_gamecodearchivecodes') ); as You can see its the 3rd 1 down that defines the function to verify the input then goes on to save. thats basically it I already posted the finction above. If the reges isnt working could you guys just give me 1 that checks (4 letters then a dash then 5 numbers)? Dont worry about the exact letters.
  13. this is all thats entered in the form for this field. I even have a maxlength = 10 just to make sure. Ill try the new regex. Thanks
  14. Basically its what users type in the form and i catch it with a post like $game_region_id = $_POST It looks like this ULUS-12345 or UCUS-12345 or UCJS-12345
  15. /** * Verifies that the game region id is valid * * @param string numbers and/or letters * * @return */ function verify_game_region_id(&$game_region_id) { if (!preg_match('#^U[LC](?:[uE]S|JP)-[0-9]{5}$#', $game_region_id)); { return false; } } Basically i want it to match wither ULUS-12345 or UCUS-12345 or UCJS-12345. The last 5 digits must be numbers. Thanks for all your help so far guys Brandon_R
  16. If you want the real SEO benifits of a social bookmark site look for the ones that add dofollow to your links and do not have a digg bar. If you just want traffic from them digg is the most popular. Twitter should be good for on the moment traffic but when a search query (such as the death of a pop king) gets outdated you wont get any more traffic from it.
  17. Hello guys i wrote my script etc but now i need functions to prevent sql injection and where to add it. I know of some like addslashes etc but on what variables do i add it? All that enters the database such as from a textarea or just the url like sql.php?id=1 and add the addslashes to the id from a request etc? Thanks Brandon_R
  18. Thanks It Worked . All i was missing was a period.
  19. Hello guys im sorry i didnt explain fully. $total['text'] = $another; $total['text'] = 'Basic Text'; How about i go about writing them in 1 line? $total['text'] = 'Basic Text' $another; doesnt work. Thank You. I know very basic questions but im kinda new to PHP Brandon_R
  20. Hello guys i was wondering how i would go about combining basic text with a variable for example basic text = "Basic text" and the valiable is $another. $total['text'] = ??? Please Help Brandon_R
  21. Hello guys im not exactly sure if this should go in the mysql or regex section so ill post in the mysql section first. I need a code to generate an insert query from the following page: http://www.sonyindex.com/Pages/PSP_US_Serial.htm All the Game ID example ULUS-10310, UCUS-98601 should go in the row game_psp_id All the Game Names example Twisted Metal - Head-On should go in the row game_name The 3rd part is kinda tricky. I need to convert the U to a US and insert it in the row game_region So in all the first query should look like this to properly insert the first line in the database: mysql_query("INSERT INTO game_list (game_name, game_psp_id, game_region) VALUES('Twisted Metal - Head-On ', 'UCUS-98601 ', ' US' ) ") or die(mysql_error()); dont worry about the auto_increment row because i already got that under. I need to insert all values with a game ID, game name and game region defined. As you can see on the page, some have game ID's but no game name etc you can skip those Please Help Brandon_R
×
×
  • 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.