• don’t know if this correct place to ask this question.. why can only moderators post to “advanced” forum?? there should be a forum for php questions….

    I don’t want to do a ‘mailto’ link for email in my blog.. in order to prevent the harvesting of my email address by spammers I never put my email address in my website and always do mail with a form.. I’m trying to do a form pg in my blog.. if I copy index.php (so I get same header, footer, sidebar.. and form in main area where posts normally are..) in same dir where index.php is, and call it mail.php and remove everything inside it except the functions for the header, footer, and sidebar, i.e., leave like this (for testing for now):

    <?php get_header(); ?>
    <div id=”content”>
    test — form here…
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I get this error:

    Fatal error: Call to undefined function: get_header() in /home/francesb/public_html/home/mail.php on line 1

    why do I get this error when this file is in same location as index.php…

    thank you…

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter maya90

    (@maya90)

    PS: I do know how to do the back-end to send email, in fact I have it running successfully here:

    https://francesblog.com/mail/mail.html

    but this is outside the blog, blog is in ‘home’ dir; so I need it here: https://francesblog.com/home/mail.php

    (or anywhere else inside blog (i.e., inside ‘home’ folder.. so can have form in main area then around it the same header, footer, & sidebar as other pgs in blog..)

    thank you very much….

    Thread Starter maya90

    (@maya90)

    thank you very much.. that worked.. ONLY THING:

    where/how do I tell it to what address to send email to??

    (email add user puts in is not it, obviously…:)

    I know how to do this, looked for relevant code, changed this

    $to = $_REQUEST[’email’];

    to

    $to = <my address>;

    (I mean obviously email has to be sent to me, not to email address user puts in form…;)

    but I never received email (no errors when submitted form..)

    other thing I don’t get: this is form tag:

    <form name=”wp_contact_form” method=”post” target=””>

    action is not specified.. how does it know where to submit the form???

    I also don’t get why there’s db-code in there.. I don’t need any db-functionality here, just email sent to me, that’s it..

    main thing, though, even though I put my own email address in there, I never received email… (when I try from my own code, from form here.. https://francesblog.com/mail/mail.html, I get email immediately…)

    thank you…

    Who would know which one of the 5 plugins listed there was installed on your site… ?
    Every plugin comes with readme or it has instructions on the author’s site. You can read them as everyone else…

    Thread Starter maya90

    (@maya90)

    I did read the readme file, as I mentioned in my last reply.. it doesn’t say at all where u put what email add you want email sent to..

    in the forums indicated in the readme file (https://www.linksback.org/forums/wp-contact/18-contact-plugin.html) somebody asks precisely this question, and this is answer:

    It is set to go to the default wordpress email. I will include an option to change that in the next version.

    ??

    but there should be a way to change this manually, which I thought I did, but it didn’t work.. ok.. thank you…

    Thread Starter maya90

    (@maya90)

    I’m trying to do on my own..

    have form in sidebar I coded myself..

    I have action=”ThankYou.php” which is in same dir as form (i.e., in root for my blog (www.francesblog.com/home/), but I get a 404 on ThankYou.php; I even get a 404 if I put absolute link to it in the form!! (https://francesblog.com/home/ThankYou.php) why is this..

    even if I put a simple test pg in there (https://francesblog.com/home/test.php)

    I get a 404… why?????

    thank you..

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘php question…’ is closed to new replies.