Jump to content

ginerjm

Members
  • Content Count

    4,770
  • Joined

  • Last visited

  • Days Won

    63

Posts posted by ginerjm


  1. I am curious as to what exactly "fixed" your issue.  Hopefully you learned that you should wrap those "t" and "scr" indices with quotes and not left them stranded with no definition, causing php to have to work to understand what you are doing.    True?   


  2. Obviously the 't' is meant as an index into the array that is in $path.  One should ALWAYS use quotes around an index value unless it is a php variable name.  Since you are using something called just "t"   you need to figure out what belongs there - most likely a dollar sign.   Clearing that up and avoiding what php is defaulting your index to (from the error message it may be simply the value "t") an incorrect value.

    Do you know what $path actually contains?  You can do a bit of debugging by simply displaying it.

    • Like 1

  3. You have to be kidding.  This post is meaningless to almost anyone who reads it.  I understand that there is a language problem but you don't even attempt to make clear what you are using, what you are doing nor what any of your code even looks like.   

    Questions:

    What is "getevent()"?

    What is "Mage"?

    Where is this printing taking place?

    What is "checkout_cart_product_add_after"?  A function you wrote?  Part of a package you are trying to learn about?


  4. I'm curious as to why you have this need to create individual spreadsheet (files) when you already have the data in a database from which you are able to draw this info from.  Are you creating these files for others to use outside of this data-gathering app?  And do they do updates within these spreadsheets that you then have to somehow apply to your nice-and-neat already-maintained database?


  5. Never sanitize input data?  Why on earth would you NOT do that?  Hackers can put anything into an input field and your script has to be prepared to handle it or face the consequences.  The rule might be 'never alter input'.  But for sure you have to sanitize it to avoid damage to your database or whatever your script is doing with the data.


  6. Macgyver - great post.  But - I don't get the purpose of #7.  When I'm done I simply resend the screen back for another set of input or with the results of the logic process.  Don't understand your  need for a get request.


  7. How about this query?

    $wpdb->query(
    	'DELETE  FROM '.$wpdb->prefix.'kudos_email
    		WHERE kuemid  IN($del_id)'
    			);

    Your query statement has a Where clause that looks like this EXACT string:  'WHERE kuemid  IN($del_id)'.

    That is not what you want.   Try using double quotes instead of single.

    ALSO - my research does not show any valid use of the IN operator with an array of args.  You need to do an implode on your array to add the commas and use that resulting String value.


  8. Two questions:

    1 - What do you mean by "read navigation"?  

    2 - Your php code has a lot of functions but no "main line" code that makes use of them.  Perhaps that is why you are posting here?


  9. Regarding your edits:

    	if (ctype_alpha($name) === false)
    	{
        $errors[] = 'name contain letters!';
    	}
    	


     Do you WANT letters or not?

    As a newbie how about this:

    	if (!ctype_alpha($name))
    	   $errors[] = 'Name must be all alphabetic';
    	

    And this could be different:

    if(empty($errors))
    {
    	if (mail('XXXXXXX@gmail.com','contact form',$message, 'From: '.$email))
     	{
    	   	header('Location: index.php?sent');
    	   	exit();
    	} 
    	else
    	{
    		echo "Message not sent";
    		exit();
    	}
    }
    	

    Note the use of separate physical lines for each line of code.  Combining them makes for troublesome reading down the road.  Trust me.

    Also - the php mail function is not the greatest mail tool.  It only offers a boolean response and that can be wrong without you knowing it.

     


  10. First - do you know that what you have so far actually works??? Your 'from' address has to be valid for the mail server to use.  You're allowing the user to provide it which is probably not what you want to have happen.

    A bar?  You mean like a moving 'progress' bar?  Or just a 'line' of text?


  11. IF you don't understand what I said above, take a fresh look at the code I provided you earlier and read it carefully and try to understand what you are doing differently.

    • Like 1

  12. Or you could have just said:

    $cat_name = str_replace('&', 'and ', strtolower($cat_name));

    No need to define arrays for this purpose nor to create a second field to hold category name.

    • Like 1
×
×
  • 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.