Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21

Thread: Warning: Illegal string offset

  1. #16
    Join Date
    Mar 2007
    @ginerjm, calm down, he is a beginner, perhaps if everyone was to put what they thought was the appropriate answer, then one may speak to the OP.

    If the process was blocked in to processes:

    1. Check for a real web form ($_POST['submit'])
    2. Sanitize inputs in to a safe variable / array using a whitelist
    3. Validation of the data streams, do they contain data, if not flag it.
    4. If we pass validation: Create the email body, variables for sending the email
    5. send email and capture any send resulting from the process
    6. handle any error or success response

    That to me sums up the process involved.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  2. #17
    Join Date
    Sep 2009
    I did not mean to cause offense. I did what I thought you meant.
    There's a lot more wrong with this code, but I'll let you try it first once you get the error checking implemented.

    good luck
    I got error checking implemented.

    What the h.... is 'validationok' meant accomplish for you?
    I understood that validation is set to true
    but if a field is empty then validation is false
    if (trim($Name==""))$validationOK=false;
    if it is true an email is sent
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
    and a web page is presented
    if ($success){
    header('Location: thank-you.html');
    if not then an error page is presented.
    header('Location: error-message.<html>');
    I know I am doing something wrong and to you I am not worthy, but I try.

    I am sorry I offended you.

    thank you

  3. #18
    Join Date
    Jul 2013
    Voorheesville NY USA
    Yes - you have the idea to set a var to true or false in order to find out if your inputs are valid. BUT - where did you check the var to see if it was true or not?
    PS - If you're posting here you should be using:

    ini_set('display_errors', '1');

    at the top of ALL php code while you develop it!

  4. #19
    Join Date
    Sep 2009
    if you mean how do I say it is a success or is not, that is where I am confused. I thought I had to declare a var to say it is a success. I think that is where I make mistakes.

    if $validationOK is true then it is a success. So I declare $validationOK to be $success ?

    I think I will do what you said before and start from nothing.

    again, thank you for helping.

  5. #20
    Join Date
    Jul 2013
    Voorheesville NY USA
    You have no idea how to program in any language, do you? The idea of testing a series of things and setting a switch ("a variable with just two values", ie, on/off, no/yes, true/false, etc.) is a perfectly valid structure that one uses to come up with a final result and provide direction as to what to do next is a commond practice. In your case you used a var called validationok and set it to false when you found an error. At the end of your series of tests though you have to do something with that variable like CHECK IT! You are not checking it. Just because you set it to false doesn't mean your program is going to react to it. YOU have to write some code to check if it is true or false and THEN do something according to that answer.

    A simple pseudo sample:

    (do some tests and set 'varok' to false when any one fails)
    (if varok == false)
    create an error message saying there is a problem
    send the form and the error message back to the client
    continue on with your script

    In your code you do some tests and set a var to false but then you just go right on sending the email whether or not the var is true or false. Do you get that?
    PS - If you're posting here you should be using:

    ini_set('display_errors', '1');

    at the top of ALL php code while you develop it!

  6. #21
    Join Date
    Sep 2009
    A simple pseudo sample:
    Now I understand what you are saying to me. I will work on this.

    thank you

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.11828 seconds
  • Memory Usage 2,905KB
  • Queries Executed 15 (?)
More Information
Template Usage (37):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (5)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (75):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • bbcode_parse_start
  • postbit_imicons
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates