Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #15262

Re: Is there a better way?

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: Is there a better way?
Date 2015-04-15 11:01 -0400
Organization A noiseless patient Spider
Message-ID <mglueo$t3h$1@dont-email.me> (permalink)
References <767d57a3-1f14-4714-a063-53c53973ecbf@googlegroups.com> <089707d2-684f-4291-9adb-0980c2cbed05@googlegroups.com>

Show all headers | View raw


On 4/15/2015 7:40 AM, Paul Knaggs wrote:
> On Tuesday, 14 April 2015 03:47:47 UTC+1, Paul Knaggs  wrote:
>> I was looking at using Angular to try and do this but was told by a developer my code was not very good is there a better way? 
>>
>> The code is an extract from function.php used in a dynamic page "request.php?=123"
>>
>>
>>
>> case "foo":
>>     if($type == "foo"){
>>      $sql1 = $wpdb->get_results("SELECT * FROM  `him_form_fields` WHERE `form_id` = '$form_id' AND `inputtype` = '$type' ORDER BY `orderby` ASC ", ARRAY_A);
>>      foreach($sql1 as $row1) {
>>        $website=get_field_value($serialno,$form_id,$row1['systemname']);
>>        if(!empty($website)){
>>          echo '<div class="foo"><a href="'.$website.'" id="pearl_per_link_a" target="_blank"><span class="foo"></span></a><input type="hidden" name="foo[]" value="'.$website.'"></div>';
>>       }
>>      }
>>     }
>>    break;
> 
> Thanks for taking the time to reply I was just looking at using Angular but it was not set in stone. But thanks very much for your comments they are what one would expect informative and productive to resolving any issues. Maybe I should have posted the entire page but thats a lot of code. The more you know you realise how little you know.
> 

Paul,

I don't know anything about Angular, so I don't know if it's good or
bad, and make no recommendation either way.

The comments I gave you are just good practices which should be used
with any PHP code accessing a database.  And things like validating all
user input and escaping strings used in database requests are to help
prevent hacking.  You can never protect too much from hackers!

And good luck with your project.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a better way? Paul Knaggs <paul@tagmebands.co.uk> - 2015-04-13 19:47 -0700
  Re: Is there a better way? Jerry Stuckle <jstucklex@attglobal.net> - 2015-04-14 07:54 -0400
  Re: Is there a better way? Paul Knaggs <paul@tagmebands.co.uk> - 2015-04-15 04:40 -0700
    Re: Is there a better way? Jerry Stuckle <jstucklex@attglobal.net> - 2015-04-15 11:01 -0400
  Re: Is there a better way? richard <noreply@example.com> - 2015-04-15 15:04 -0400
    Re: Is there a better way? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-04-15 15:40 -0400
      Re: Is there a better way? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-04-15 17:14 -0400
      Re: Is there a better way? richard <noreply@example.com> - 2015-04-15 20:02 -0400
      Re: Is there a better way? Denis McMahon <denismfmcmahon@gmail.com> - 2015-04-16 15:18 +0000
      Re: Is there a better way? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-22 17:17 +0200
    Re: Is there a better way? "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2015-04-15 20:56 +0000
    Re: Is there a better way? Denis McMahon <denismfmcmahon@gmail.com> - 2015-04-16 01:25 +0000
    Re: Is there a better way? Evan Platt <evan@theobvious.espphotography.com.invalid> - 2015-04-17 07:35 -0700
      Re: Is there a better way? richard <noreply@example.com> - 2015-04-17 11:52 -0400
        Re: Is there a better way? Evan Platt <evan@theobvious.espphotography.com.invalid> - 2015-04-17 10:04 -0700
          Re: Is there a better way? Jerry Stuckle <jstucklex@attglobal.net> - 2015-04-17 13:22 -0400
            Re: Is there a better way? richard <noreply@example.com> - 2015-04-17 14:49 -0400
              Re: Is there a better way? Evan Platt <evan@theobvious.espphotography.com.invalid> - 2015-04-17 12:20 -0700
              Re: Is there a better way? Jerry Stuckle <jstucklex@attglobal.net> - 2015-04-17 15:27 -0400
        Re: Is there a better way? Evan Platt <evan@theobvious.espphotography.com.invalid> - 2015-04-17 10:30 -0700
          Re: Is there a better way? richard <noreply@example.com> - 2015-04-17 14:56 -0400
            Re: Is there a better way? Evan Platt <evan@theobvious.espphotography.com.invalid> - 2015-04-17 12:25 -0700
              Re: Is there a better way? Jerry Stuckle <jstucklex@attglobal.net> - 2015-04-17 15:29 -0400
              Re: Is there a better way? Tim Streater <timstreater@greenbee.net> - 2015-04-17 22:19 +0100
      Re: Is there a better way? Richard Yates <richard@yatesguitar.com> - 2015-05-24 15:22 -0700

csiph-web