guyfromri's Profile User Rating: -----

Reputation: 46 Craftsman
Active Members
Active Posts:
815 (0.43 per day)
16-September 09
Profile Views:
Last Active:
User is offline Jul 17 2014 08:39 AM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Dream Kudos:

Latest Visitors

Icon   guyfromri very exciting things happening for the new year -- i'm hoping all my fellow D.i.C.ers are going to support me in my endeavors :)

Posts I've Made

  1. In Topic: Comparing Data Between Two Arrays

    Posted 11 Jul 2014

    Thanks for the feedback, guys. Let me explain a little better and see if I'm on the right track.

    Step 1: I have a table that contains all payment types that a user can select from. They can select 1 or all. I query out all data and assign it to an array for a reference. Let's say this array contains 10 rows from a table and the reference point will be the PaymentID.

    Step 2: I gather all the payments that a user has selected. I now have a second array that contains 3 values (1, 3, 4). If I want to loop through this array and quickly find the corresponding PaymentID from array 1, I'm looking for that function. Once I've identified the existing [row] in array 1, I want to use that information to return the name and other data about that payment type.

    I've read about array_dif and array_intersect but I'm not sure what else is out there and if there's anything that's more effective or more widely used?

    Thanks again!
  2. In Topic: nl2br not working after stripslashes or html cleanse?

    Posted 19 Jun 2014

    Thanks for the replies guys. I'm going to research a few things but answers here.

    View Postchris98, on 19 June 2014 - 03:16 AM, said:

    Have you tried stripping the tags after you've inserted it into the DB? I know it's not the best way, but to experiment it may help. Have you tried without stripping the tags and see if that helps?

    I have tried it with only stripslashes and it works great but it was allowing html injection...

    View Postastonecipher, on 19 June 2014 - 03:51 AM, said:

    htmlspecialchars() isn't needed on a prepared statement insert/ update. And the default character set is now utf-8 if that is going to be an issue.

    I'm going to look this up because I don't know much about the char sets and how they affect the db/data. I was under the impression that with prepared statements, you don't need to strip html, slashes, etc but when I added an apostrophe with no stripslashes, it printed back from the db with a slash in all instances. When I added a bold tag to the input box, it printed back to the page bold in all instances. Is there a better way to prevent injections than the old school way here? I'm guessing it might have to do with pdo and I'm going to look it up but I haven't had to be this diligent about user input yet so it's something I haven't really encountered in my travels.

    View Postastonecipher, on 19 June 2014 - 03:59 AM, said:

    Do newline characters exist in the text prior to insert? You might want to use the <pre> tag to preserve formatting.

    They come straight from the <textarea that I'm using. If I add to the db without any formatting, the forms look nice when populated by that data but that still leaves me open to injections. I'm going to look up pre and see what it's all about.

    Thanks everyone for the feedback! I'm going to research but any more input is definitely welcomed!
  3. In Topic: Parsing Data from a Dynamically Generated Form

    Posted 17 Jun 2014

    Hey! Thanks for the response.

    Very basic solution that I had over-thought thoroughly...I guess sometimes you get so in to the details that you lose site of the big picture.

    Just to add to this, I took it a step further. I grouped the phones together in their own separate array so I could parse each from one array, other form values from another array and organize a little more. Here's what I used.

    //Cnt is tallied in the loop so each has it's own key in the sub-array "Phones" then each of these names gets grouped in yet another sub-array inside Phones. The final value of $Cnt is then stored in a hidden input element so when I call the jQuery to add another phone number to the form, I can continue with the original Cnt and keep going.
    <input class = 'w75' type = 'text' name = 'Phones[$Cnt][AC]' id = 'Phoneac_$PhoneID' maxlength = '3' value = '$AC'>
    <input class = 'w75' type = 'text' name = 'Phones[$Cnt][PF]' id = 'Phonepf_$PhoneID' maxlength = '3' value = '$PF'>
    <input class = 'w75' type = 'text' name = 'Phones[$Cnt][LN]' id = 'Phoneln_$PhoneID' maxlength = '4' value = '$LN'> 

    Thanks again!
  4. In Topic: Radius Search based on ZipCode

    Posted 20 May 2014

    View Postmodi123_1, on 19 May 2014 - 04:31 PM, said:

    Have you thought about using something like this:

    for getting spacial radii?

    Thank you! This seems very complicated though and I'm not sure I would be able to apply my php correctly if I did get this method to work. Is this something you have used in the past? I could very well be over-complicating it but it looks like it might be a little more robust than I actually need for this project.

    View Postbaavgai, on 20 May 2014 - 06:43 AM, said:

    Ask your database to tell you what it actually evaluates that as... it might provide insight.

    SELECT distinct zip,
       POWER(latitude - 41.77, 2) + POWER(longitude - 71.35, 2)  as d2
    FROM Build00GeoData 

    Thanks very much! I hadn't thought to actually view the conditions I was using and see what they were. As suspected, they're a random number that represents the square root of my longitude+latitude but based on my lack of experience with maps these types of calculations, I'm not sure how I could use these values to calculate distance.

    Thanks both! These are great starting points for me. :)
  5. In Topic: Creating clean URL's and paths

    Posted 6 May 2014

    Hey Guys - My hard drive died so I wasn't able to respond to this or work on my site for a while. Anyway, I've tried to implement the code as suggested but I keep redirected to my index page. Am I doing something wrong here? Thanks again for all the help!

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule ^(.*)/$ menu.php?id=$1 [L,QSA]

My Information

Member Title:
D.I.C Addict
29 years old
April 14, 1985
Rhode Island
Full Name:
Programming Languages:

Contact Information

AIM  GuyfromRI85
MSN  jmcgovern7
Website URL:
Website URL  http://
Yahoo  jpms41485


Page 1 of 1
  1. Photo

    guyfromri Icon

    06 Oct 2010 - 18:52
    thanks everyone!!!
  2. Photo

    cordwell Icon

    05 Oct 2010 - 20:03
    Congrz the Winner
    Keep it safe
  3. Photo

    DaneAU Icon

    05 Oct 2010 - 00:30
  4. Photo

    raziel_ Icon

    10 Jun 2010 - 06:32
    sup dude :)
Page 1 of 1