Jump to content

ginerjm

Members
  • Content count

    4,343
  • Joined

  • Last visited

  • Days Won

    49

ginerjm last won the day on October 8

ginerjm had the most liked content!

Community Reputation

198 Excellent

About ginerjm

  • Rank
    Handball player
  • Birthday 03/23/1952

Profile Information

  • Gender
    Male
  • Location
    Voorheesville NY

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. ginerjm

    HELP ME, NEED PHP ARTICLE SCRIP?

    What is an "article script"? If you don't know how to write PHP code, I suggest you start with something small and something you fully understand and learn how to write PHP code, as well as a website. And how to ask decent questions....
  2. ginerjm

    Why If Not Statement Fetch Condition Fails ?

    So - phpsane is now 'site-developer' on the other forum. What a misnomer!
  3. ginerjm

    Echo variable that gets generate LATER

    Can you please explain why one would want to output something that they haven't assigned a value to yet? The code you posted shows us no reason to do the echo prior to setting your value, so it makes absolutely no sense. A good way around all this discussion would be to do the proper thing. Write your script where the php is done first, then the html is output - from the doctype line through to the end of your output. Don't mix them together except where you may have to loop thru some data in order to build the needed output (an html table?). In those cases simply assign the html to a var and then place that var in the html code that you output later on. End of issue.
  4. ginerjm

    display images

    My ide is very good at highlighting things. I'm an old style coder that does not rely on anyone completing my code so that feature is not needed. Not sure what 'principles' you mean about HTML writing.
  5. ginerjm

    display images

    I use heredocs for large chunks of non-php code. I rarely use a php tag in the midst of my scripts. For short pieces of html (perhaps in loops that build things) I use an echo statement rather than exit and enter php. I never output html/js code directly until I have begun outputting the entire html document.
  6. Once again - WHAT are you trying to do? Use plain English please without any reference to code
  7. ginerjm

    Encryption? Salt? Secret Key? Whaaat?

    You encrypt a birthdate. (Why?) And then a hacker sees your encrypted data. But then he also sees your code? How is one connected to the other? Methinks you are trying to learn how to secure your DATA and confusing that with something entirely un-related. Slow down and take the first advice that was presented here to properly store your data into the database and stop worrying (for the moment) about your code being secure. For one thing - you might keep your more sensitive PHP scripts in a folder that is not in your root tree so that normal hacking to view that portion of your domain will not get to them.
  8. ginerjm

    display images

    Is error checking turned on? What if there is no POST['model'] element? You aren't handling that. And why don't you check for it before bothering to read in that file? PS - I really dislike your style of writing code. This going in and out of php mode is tiresome. Absolutely awful.
  9. You know - I read up on this 'array_reduce' function and I still don't get it. Neither do I see why you see a need to use it. How about you just explain what you are trying to do instead of showing us this code? I don't understand for one. I don't see how this reduce is needed to process some query results as well as produce some "alphabetical list". What's the connection?
  10. ginerjm

    Instagram API Intergartion

    Huh?
  11. ginerjm

    When to use { }

    In case you haven't found the issue yet - you don't have a closing brace for your 'if' - at least not in the correct location.
  12. ginerjm

    When to use { }

    Think of the braces as "grouping operators". When you need to collect a few lines (or more) as one group, then wrap them in braces. This is most often used as part of an if/else construct where you need to be sure that the lines you want executed for the if condition of for the else condition must all happen. That is why it is a good practice to always use them in an if/else statement. Sooner or later you will add one more line to the if or to the else and forget to add the braces and then wonder why your newly-fixed code doesn't do what you think it should do. Notice how braces are used when writing a function. After the function header line that identifies the function there is always a set of braces to 'group' the following lines together as the block of code used in that function. Does that help?
  13. ginerjm

    Insert Query Inside foreach Loop ...

    For what it's worth, I never use the bind_param thing. I simply create the array of parms and use it in the execute. $parms = array('fname'=>$arr['val1'], 'lname'=>$arr['val2']) $stmt->execute($parms); Those two lines would be inside your loop after having done the prepare ahead of the loop. Of course the $arr values have to be already defined at the point of the creation of the $parms array.
  14. ginerjm

    Need help getting last insert id from mysql

    Besides switching to PDO simply because it is easy and better, why not examine why you have this 'query' function. Functions are great for tasks that may be repetitive or complex and you will benefit by writing a block of code that does the work for you and can be relied on at multiple times. In your case you have a function that executes ONE LINE OF CODE! What is the point of that? How do the 6 lines of code in your function (including the call line itself) help you when you could have simply written that query call line in place of it all? If your function actually accomplished some real work it would be great. You could have validated that the query call actually runs or that it actually ran before blindly returning, but you don't. So why the extra overhead here?
×

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.