Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6989381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:12:16+00:00 2026-05-27T19:12:16+00:00

I have a newsletter template in one file and a mail script in another

  • 0

I have a newsletter template in one file and a mail script in another file which basically pulls email addresses from a database and loops through each one sending the email to them.

I am using this code to get the contents of the newsletter template:

$content = file_get_contents('attach/T_newsletter.php');

What I need to do now is send PHP variables along with this eg:

T_newsletter.php?test=hello

and then be able to pull them from the URL in the template and adjust the content accordingly.

Could someone explain how I would do this please?

Thanks for any help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:12:17+00:00Added an answer on May 27, 2026 at 7:12 pm

    If you want to do that, you will need to call that file “T_newsletter.php” as part of a URL:

    $content = file_get_contents("http://yourdomain.com/T_newsletter.php?test=hello");
    

    and inside T_newsletter.php:

    <?php
      $v = $_GET['test']; // this will be 'hello'
    
      if($v == 'hello')
      {
        ...
      }
      else
      {
        ...
      }
    ?>
    

    The other option would be to use a template engine like Twig or Smarty to parse the files directly if you do not wish to make an HTTP request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to made a page which will send Email to Newsletter subscribers. There
I have Email Newsletter on the Common Footer file whch is displayed all ove
I have a newsletter for one of my sites and I can't the email
I have made an HTML-Newsletter Template. I have one Bug. How can i adjust
Recently I have sent a newsletter to an old email database I own. After
I have created a newsletter system that allows me to specify which members should
I have 50 newsletters which all have different email accouts, hex colour codes and
The problem i have is that i have created newsletter template, added few subscribers
I have a basic newsletter signup form with an email field and two buttons
Hi friends I have created newsletter system. In which I want to send person

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.