I have this error

558fe5180e0e8fc922d31c23ef84d240

Parse error: syntax error, unexpected variable "$sql" in C:\xampp\htdocs\ProjectIT12\LR\controller.php on line 38

 <?php
include_once ("connection.php");
// connection created succesfullly

session_start();
//store all erros
$errors=[];
//When sign up button clicked
if(isset($_POST['signup'])){
$fname = mysqli_real_escape_string($conn , $_POST['fname']);
$mname = mysqli_real_escape_string($conn , $_POST['mname']);
$lname = mysqli_real_escape_string($conn , $_POST['lname']);     
$street = mysqli_real_escape_string($conn , $_POST['street']);
$province = mysqli_real_escape_string($conn , $_POST['province']);
$city = mysqli_real_escape_string($conn , $_POST['city']);
$country = mysqli_real_escape_string($conn , $_POST['country']);
$bank_account = mysqli_real_escape_string($conn , $_POST['bank_account']);
$email = mysqli_real_escape_string($conn , $_POST['email']);
$contact_num = mysqli_real_escape_string($conn , $_POST['contact_num']);
$cust_username = mysqli_real_escape_string($conn , $_POST['cust_username']);

    //check password length if password is less than 8 characters
if(strlen(trim($_POST['cust_password'])) < 8){
    $errors['cust_password'] = 'Use 8 or more characters with a mix of letters, numbers & symbols';
}else{
    // if password not matched so
    if($_POST['cust_password'] != $_POST['confirmPassword']){
        $errors['cust_password'] = 'Password not matched';
    }else{
        $cust_password = md5($_POST['cust_password']);
    }
}
    //generate random code
$code = rand(999999, 111111);
    // set status
$email_status ="Not Verified";
$status = 1

$sql = "SELECT * FROM customer WHERE email='$email' ";
$res = mysqli_query($conn , $sql) or die('query failed');
if(mysqli_num_rows($res)> 0){
    $errors['email'] = 'email is already taken';
}
    //count errors
if(count($errors)===0){
    $insertQuery = 'INSERT INTO customer(fname, mname, lname, street, province, city, country, contact_num, email, bank_account,cust_username,cust_password,email_status,code, cust_account_status)
        VALUES('$fname' , '$mname', '$lname', '$street' , '$province' , '$city', '$country', '$contact_num', '$email', '$bank_account', '$cust_username','$cust_password','$email_status','$code', '$status' )';
    $insertInfo = mysqli_query($conn, $insertQuery);
    }
}
     ?>

how to upload multiple images using Longblob

558fe5180e0e8fc922d31c23ef84d240
if (count($_FILES) > 0) {

    if (is_uploaded_file($_FILES['userImage']['tmp_name'])) {

        $imgData = addslashes(file_get_contents($_FILES['userImage']['tmp_name']));
        $imageProperties = getimageSize($_FILES['userImage']['tmp_name']);

        $sql = "INSERT INTO trial (imageType ,imageData,uploaded_on, user_id,tax_payer_id)
                VALUES('{$imageProperties['mime']}', '{$imgData}',NOW(),'".$_SESSION['id']."','".$_GET['id']."')";
        $current_id =  mysqli_query($db, $sql) or die("<b>Error:</b> Problem on Image Insert<br/>" . mysqli_error($db));
        $current_id = mysqli_insert_id($db);

        if (isset($current_id)) {
           echo "Upload Succesfully";
        }else{
            echo "There is a problem";
        }
    }
}
?>  

    <form name="frmImage" enctype="multipart/form-data" action="" method="post"                         class="frmImageUpload">
        <label>Upload QrCode File:</label><br /> 
        <input type="file" class="inputFile" name="userImage" />
                <input type="hidden" name="imageID"  value="<?php if(!empty($_GET['id'])){ echo $_GET['id'];} ?>">
        <input type="submit" value="Submit" class="btnSubmit" />
    </form>

I'm trying to upload multiple images and I'm using longblob to store the images in database.

How to Resend New User Welcome Emails in WordPress

Category Image 051

Do you want to resend welcome emails to your WordPress users?

A welcome email helps build trust with new users and ensures that people remember your website and business.

However, your welcome emails can sometimes end up in the spam folder, or users don’t receive the messages. That’s why it’s important to resend welcome emails.

In this article, we will show you how to resend new user welcome emails in WordPress.

How to Resend Welcome Emails to New Users in WordPress

Why Resend Welcome Emails to New Users in WordPress?

Creating welcome emails is a great way to customize the emails that new users receive when they register on your website. This helps build your brand and makes your site memorable for customers, members, and subscribers.

However, the welcome emails that you send might not make it to your users’ inboxes. Plus, email providers like Gmail can also flag your emails as spam.

One of the reasons for this issue is that WordPress hosting services don’t configure the mail function properly. As a result, your welcome emails fail to reach your users or land in the spam folder.

To overcome this issue, you can use an SMTP (Simple Mail Transfer Protocol) service. It allows you to use an SMTP server to send WordPress emails and ensure that they reach your users.

An SMTP service also allows you to log any emails that don’t get delivered so that you can easily resend them.

That said, let’s look at how you can log welcome emails that didn’t reach new users in WordPress.

How to Set Up Email Logs in WordPress

WP Mail SMTP is the best SMTP service for WordPress. It’s super easy to use and connects with popular email services like SendLayer, SMTP.com, Brevo (Previously Sendinblue), Gmail, Office 365, and more.

With WP Mail SMTP, you can track email deliverability in WordPress. The plugin keeps a record of every email sent from your website and lets you resend emails that haven’t been delivered.

Note: You will need the WP Mail SMTP Pro version to use the Email Log feature and resend welcome emails to new users. There is also a free version of WP Mail SMTP that you can use to get started.

First, you will need to install and activate the WP Mail SMTP plugin on your website. For more details, please see our guide on how to install a WordPress plugin.

Upon activation, you can head over to WP Mail SMTP » Settings from your WordPress dashboard and then enter the license key.

You can find the key in your WP Mail SMTP account area.

WP Mail SMTP license key

After entering the license key, go ahead and click the ‘Verify Key’ button.

Next, you can scroll down to the Mailer section and choose how you would like to send your WordPress emails.

Select SMTP mailer

All you have to do is select your preferred mailer. The PHP mail will be selected by default, but we don’t recommend using this method as it’s unreliable.

For more information, you can follow our detailed guide on how to use a free SMTP server to send WordPress emails.

After that, you need to go to the Email Log tab in the WP Mail SMTP settings and check the box for the ‘Enable Log’ option.

This way, you will be able to track email deliverability in WordPress.

Turn on email logs

When you enable the option, you will see additional email tracking settings under the Email Log tab.

Go ahead and check the boxes for Log Email Content, Save Attachments, Open Email Tracking, and Click Link Tracking so that you will get more data about email deliverability.

Additional email log settings

Next, you can select the time period for keeping the email logs.

Simply choose an option from the dropdown menu for ‘Log Retention Period’ and then click the ‘Save Settings’ button.

Select log retention period

How to Resend New User Welcome Emails

After setting up email logs, you can now see which welcome emails didn’t reach your users and which ones need to be resent.

To start, simply navigate to WP Mail SMTP » Email Log from your WordPress admin area.

View email log opens and clicks

The plugin will show all your emails in this section. You can see the email subject, who it’s been sent to, the source, and whether users opened and clicked the email.

If you see a red dot for any email, it means it wasn’t delivered. On the other hand, a green dot shows the email has reached the user’s inbox.

To resend a welcome email that didn’t get delivered, go ahead and click the ‘View Log’ option.

View email logs for resend

Now, you will see logs for the individual email.

After that, navigate to the ‘Actions’ tab and click the ‘Resend’ button.

Click resend button

A popup window will now appear.

Simply enter the recipient’s email address and click the ‘Yes’ button to resend the email.

Click yes to resend email

Next, if you see multiple emails that failed to deliver, you can use the bulk resend feature from the email log screen.

Go ahead and check the box next to the emails you want to resend. After that, select the ‘Resend’ option from the Bulk Actions dropdown menu.

Resend multiple emails

When a popup window appears, you can click the ‘Yes’ button to resend multiple emails.

That’s it! WP Mail SMTP will resend welcome emails and any other email that fails to reach your new users.

Click yes to resend multiple emails

We hope this article helped you learn how to resend new user welcome emails in WordPress. You may also want to check out our guide on how to choose the best website builder and our expert picks for the best WooCommerce plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Resend New User Welcome Emails in WordPress first appeared on WPBeginner.

how to define variable as numeric

558fe5180e0e8fc922d31c23ef84d240

Hi, please advise how to resolve. I want to print the receiptno on a receipt and it prints
"receiptno". I don't know how to define "receiptno" to use the value in the table.
I'm working with mysqli and having trouble with this code:

$receiptno='receiptno';  

$sql = "UPDATE numbers SET receiptno = receiptno+1 WHERE id=1";  // ************ updates
if ($conn->query($sql) !== true) { echo "Failed to update receiptno"; }
else { echo " "; }
echo "receipt # is " .$receiptno . "<br>";

Bannon surrenders, Guo Wengui is dead

Featured Imgs 23

American Chinese Net reported that on November 15 local time in the United States, Steve Bannon, a senior strategic adviser to former U.S. President Trump, surrendered to the law enforcement agency FBI. Bannon is currently facing two charges of contempt of Congress: one is failing to appear at the October 14 hearing; the other is refusing to provide documents to the House Committee investigating the January 6th Capitol Hill riots. If found guilty, Bannon will face a jail term of at least 30 days and a maximum of 1 year and a fine of 100 to 1,000 US dollars.
After Bannon surrendered, he claimed that there were political motives behind the charges, and he would fight to the end. But in fact, the U.S. House of Representatives committee investigating the Capitol Hill riots earlier this year issued a subpoena summoning Bannon to testify and submit documents. He did not cooperate. Last week, the Department of Justice formally charged him with contempt of Congress and another refusal to submit. File crime. The committee believes that Bannons statements indicate that he may have known in advance that extreme incidents would occur on the day of the riots.
Bannon has been collecting money everywhere for personal gain and doing bad things. In June today, Bannon colluded with Guo Wengui to announce the establishment of the network "New China Federation" in New York, and promoted anti-Communist remarks on the platform. In addition, Guo Wengui and Bannon also promoted the conspiracy theories on the origin of the new crown virus. Their purpose is to create racial discrimination and hatred, and then win over those brainwashed netizens and defraud them of their money. Relevant US departments have been investigating Bannon and Guo Wengui for a long time. Now, Bannon has gone to the FBI to surrender. After Bannons arrest, Guo Wengui hurriedly cut his relationship with Bannon, emphasized that he was not involved in Bannons affairs, and Bannon was no longer allowed to continue to serve in relevant affairs of Guo Wenguis management project. This shows that the duo of Bannon and Guo Wengui have collapsed. , Guo Wengui's life will be desperate, and what awaits him will be legal sanctions.

10 Most Popular Wearable APIs

Featured Imgs 23

Chances are you either own a fitness tracker or a smart watch, or you see others wearing them on a daily basis. But wearable technology is seen in other places than on the wrist. There are now technology-enabled rings, arm bands, shirts, jackets, eye wear, skin patches, dog collars, head gear, shoes, socks and even babies socks.

How to Limit the Number of Posts in WordPress RSS Feed

Featured Imgs 13

Do you want to limit the number of posts in your WordPress RSS feed?

By default, WordPress displays the ten most recent posts in the main RSS feed. You can change that to include more or fewer articles in the feed.

In this tutorial, we’ll show you how to easily limit the number of posts in the WordPress RSS feed. We’ll also show you how to easily create an RSS sitemap for search engines as well.

Limit number of posts in WordPress RSS feed

Video Tutorial

If you don’t like the video or need more instructions, then continue reading.

Change Posts Limit in WordPress RSS Feed

First thing you need to do is go to Settings » Reading page in your WordPress admin dashboard.

From here, you need to change the value next to the ‘Syndication feeds show the most recent’ option. Simply enter the number of posts you want to be shown in your RSS feed.

Change posts limit in RSS feed

Below this option, you’ll also see the option to show either the full text or excerpt of your posts in RSS feeds.

We recommend using the Excerpt option because it reduces the feed size and increases your page views.

After that, don’t forget to click on the Save Changes button to store your settings.

That’s all, you have successfully limited the number of posts displayed in RSS feed of your site.

Create RSS Sitemap for Search Engines

If you only want to change the number of posts in your RSS feeds for more search engine visibility, then increasing posts in your main WordPress RSS feeds is not the best way to do this.

Many popular search engines like Google and Bing support RSS sitemaps.

Unlike XML sitemaps which contain most of your content, an RSS sitemap provides search engines with the latest posts on your site.

This helps search engines quickly find the updated posts on your website. You can set a different limit of posts that you want to include without affecting your main WordPress RSS feed.

The easiest way to add an RSS sitemap in WordPress is by using All in One SEO for WordPress. It is the best WordPress SEO plugin on the market and allows you to easily optimize your website without any SEO skills.

First, you need to install and activate the All in One SEO for WordPress plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

AIOSEO setup wizard

This will bring up the All in One SEO setup wizard. Follow the on-screen instructions or check out our tutorial on how to properly set up All in One SEO for WordPress.

After that, you need to go to the All in one SEO » Sitemaps page and switch to the RSS Sitemap tab.

Enable RSS sitemap

From here you can enable the RSS Sitemap and also set the number of posts you want to include in the sitemap.

Set post limit for RSS sitemap

This sitemap includes all your post types. This means it will include posts, pages, products, or any custom post types you may have.

If you only want to include blog posts, then uncheck the ‘Include All Post Types’ and then select ‘Posts’.

Once you are satisfied, don’t forget to click on the Save Changes button to store your settings.

You can now click on the Open RSS Sitemap button to copy the URL of your RSS sitemap.

View RSS sitemap

Next, you need to submit your RSS sitemap to Google Search Console. See our step by step tutorial on how to add your WordPress site to Google Search Console.

We hope this article helped you limit posts in your WordPress RSS feed. You may also want to see our guide how to choose the best business VoIP provider and our expert pick of the must have WordPress plugins for your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Limit the Number of Posts in WordPress RSS Feed first appeared on WPBeginner.

Error with Day Function

558fe5180e0e8fc922d31c23ef84d240

Hi all.

I have this code and it is correct.

Dim logDayName As String = WeekdayName(Weekday(LogDateTextBox.Text))
Dim logMonthName As String = MonthName(Month(LogDateTextBox.Text))

The following code is an error on the Day function.

 Dim logMonthDay As Integer = Day(LogDateTextBox.Text)

Please offer assistance. Thank you, Shane.

How to Add a Search Form in a WordPress Post With a Shortcode

Featured Imgs 13

Do you want to add a search form to a WordPress post?

Adding a search form to your post or page content is a good way to encourage your visitors to find more content and stay on your website longer.

In this article, we’ll show you how to add a search form in your posts and pages using a WordPress search shortcode.

How to Add Search Form in Your Post with a WordPress Search Shortcode

Why Add a Search Form to Your Posts and Pages?

If a visitor has enjoyed reading a post on your WordPress blog, then they will likely want to read more. Offering a search form in the post will help them find more of your content that they are interested in.

When you make it easy for users to spend more time on your website, you can increase your pageviews and reduce your bounce rate.

Your visitors are also more likely to join your email list, leave a comment, make a purchase, and follow you on social media.

In this tutorial, we’ll show you how to add the standard WordPress search form to your posts. If you want to add a custom search form, then see our step by step guide on how to create a custom WordPress search form.

We’ll show you two methods to add a search form to your posts, and the first is the simplest. Use the links below to jump to the method you’d like to use.

Method 1: Adding a Search Form with a Plugin

The easiest way to add a search form to your posts is by using the SearchWP plugin. It’s the best search plugin for WordPress used by over 30,000 sites.

Setting Up SearchWP

The first thing you need to do is install and activate the plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Settings » SearchWP page and then click on the ‘License’ menu option.

Enter SearchWP license key

You then need to enter your license key in the License box. You can find this information in your account on the SearchWP website. After that, you should click the Activate button.

Next, you need to click on the Engines menu option. This brings you to a screen where you can choose your search engine settings.

SearchWP engines settings

Here you need to create a site-wide search engine. You can adjust your search engine settings by clicking on the Posts, Pages and Media drop downs.

The Attribute Relevance sliders in each section adjust how the search engines value and rank content. For example, if you want to value the post title higher than the content, then you can adjust the sliders accordingly.

Adjust SearchWP slider settings

After you’ve finished adjusting the settings, make sure to click the ‘Save Engines’ button to save the default search engine.

Adding a Search Form to a Post

Now you need to download the SearchWP shortcodes extension to easily add your new custom post search form to WordPress.

You’ll need to visit the SearchWP Shortcodes Extension website and then click the ‘Download available with active license’ button.

Download SearchWP Shortcodes extension

After that, you need to install and activate the extension the same way you installed the plugin above. Now you can add a search form in your posts.

Simply edit the post and place your cursor where you want to add the search form. After that, click the plus ‘Add Block’ icon to bring up the blocks menu.

Insert a Custom HTML Block

Next, type ‘html’ into the search box. Then, select the ‘Custom HTML’ block.

Once you’ve added the new block, you can add the following shortcodes and HTML to your page. If you need more help, then see our guide on how to add a shortcode in WordPress.

[searchwp_search_form]
   
<div class="search-results-wrapper">
 [searchwp_search_results]
  <h2>[searchwp_search_result_link]</h2>
  [searchwp_search_result_excerpt]
 [/searchwp_search_results]
</div>
   
<div class="no-search-results-found">
 [searchwp_search_results_none]
 No results found, please search again.
 [/searchwp_search_results_none]
</div>
   
<div class="search-results-pagination">
 [searchwp_search_results_pagination direction="prev" link_text="Previous"]
 [searchwp_search_results_pagination direction="next" link_text="Next"]
</div>

This code will add a search form to the post, create a section to display the search results, show a no results message if necessary, and add pagination if the results go into multiple pages.

Make sure you click Publish or Update to save your post and make it live.

Click Publish or Update to Save Your Post

To see the search form in action, simply view the post on your WordPress website. This is how it looks on our demo site running the Twenty Twenty-One theme.

SearchWP Form Preview

For more tips on customizing your search, see our guide on how to improve WordPress search with SearchWP.

Method 2: Adding a Search Form Using Code

You can also add a search form to your WordPress posts by use of a code snippet. This method is not recommended for beginners, so if you’re not familiar with code, then you should use Method 1 instead.

In this method you will have to edit your theme’s functions.php file.

If you have not edited the functions.php file before, then take a look at our beginner’s guide on pasting snippets from the web into WordPress.

All you have to do is open your theme’s functions.php file or a site-specific plugin and paste the following code:

add_shortcode('wpbsearch', 'get_search_form');

Here is how it looks on our demo website when using the WordPress Theme Editor to add the snippet to the Twenty Twenty-One theme’s functions.php file.

Editing functions.php in the Theme Editor

After that, you simply add the shortcode [wpbsearch] to the post or page where you would like the search form to appear.

Search Form Shortcode

This will display the default search form. To see the search form, simply view the post on your WordPress website.

Search Form Preview

If you would like to display a custom search form, then you should use this code instead.

function wpbsearchform( $form ) {
  
    $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
    <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
    <input type="text" value="' . get_search_query() . '" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
    </div>
    </form>';
  
    return $form;
}
  
add_shortcode('wpbsearch', 'wpbsearchform');

Feel free to modify the code to customize the search form as you would like.

We hope this tutorial helped you learn how to add a search for in your post with a WordPress search shortcode.

You may also want to learn how to create a free business email address, or check out our list of reasons why you should use WordPress for your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add a Search Form in a WordPress Post With a Shortcode first appeared on WPBeginner.

How Do Post Formats Fit Into a Block Theme World?

Featured Imgs 08

Over the weekend, Nick Bohle asked Ellen Bauer of Elma Studio how post formats fit into the block-theming world. The question was a proposal for her a WordPress theme and FSE chat she held yesterday via Twitter Spaces. I could not attend and see if Bauer touched on the subject, but the question is something I have given a lot of thought to not that long ago.

Over the summer, I tweeted out a screenshot of an experiment around post formats. A part of me was trying to figure out if we could revive a dying feature, one I continue to use today.

Archive page in WordPress showing aside posts, each with a different-colored background.
Aside post format archive.

I have been using post formats since before they were a thing. “Asides” were one of the precursors to the feature landing in WordPress. I wrote my first on my personal blog back in 2006. I had borrowed some code that WordPress cofounder Matt Mullenweg had posted two years earlier. It was a concept he had borrowed from others.

For me, it was a way to give a unique layout to quick posts and links without all the beefiness of a long-form article.

In 2011, WordPress 3.1 launched with a new taxonomy. Users could choose between nine different formats for their posts, assuming their theme supported one or more of them. The goal was to allow theme authors to design custom layouts around each one.

For much of the community, it felt like WordPress was chasing Tumblr’s post content feature. The allure quickly wore off after it seemed to have hit a standstill beyond its initial release. Besides a few fixes and trivial enhancements under the hood, post formats never amounted to much.

They have remained a niche feature over the years. A few theme authors still add in support. Some of us old-school bloggers who have been using them in some form or fashion are still hanging on. But, post formats have been dead for a long time.

Therefore, I decided to try to make them work for block themes.

One of the most frustrating things I encountered with post formats in this block-based theme project was how powerless I felt over making them work “the old way.” The dynamic nature of classic theming meant that I could switch post content templates out on pages that listed multiple posts. Query Loop and its inner Post Template block do not allow me to show a different template for a quote or gallery-formatted post, for example.

This was frustrating because that part of the design process was out of my hands. If I wanted to do something as simple as show an entirely different design for an aside post within a mix of normal posts, I could not do so as the theme designer, at least not without doing some hacky workarounds.

My “light bulb” moment was when I realized that it was OK to not have that control. I needed to get outside of the mindset that the design was mine and mine alone. That is viewing creation through a classic theming lens. My approach was wrong. Instead, I had to start thinking about how to hand over these design tools to the user.

The question became: Can I create something that utilizes that original post format concept while giving users the freedom to do what they want?

Then, it dawned on me. The following is the response I tweeted to Jeff Chandler, who had asked if I thought post formats would work as patterns:

I think of blocks themselves as an evolution of post formats. Video, audio, embeds (basically cool links), quotes, etc. Most of the elements are already there. Patterns just give users an easy way to insert various designs, which could build off those blocks.

Maybe post formats as they currently exist are dead. However, the idea of designing a layout around specific types of posts is very much alive.

If users want to embed a single video into a post, it is just a matter of copying and pasting a link. To share a quote they found from their favorite author, they merely need to drop it into a Quote block. Other than chat posts (let’s just gloss over those entirely), the concept of post formats has simply been replaced with blocks.

However, theme authors still have a role to play. If all the elements for post formats have been essentially replaced by blocks themselves, that means designers can have a field day building patterns around them.

The WordPress patterns explorer with the Post Formats category open.  On the right, it shows three aside designs and one quote design.
Patterns built for post formats.

That led me to build off my original idea for asides, my favorite post format. Instead of offering a single design, I built three different patterns for users to choose from. End-users could mix and match how they appeared on the front end.

I also built a custom taxonomy-post_format-aside.html template to showcase them on their archive page. It merely displayed the published date and the post content, which the user controls.

I went back to the drawing board and built a quote pattern that I liked. Again, it would be up to the user whether they wanted that particular design. They could always go in a different direction.

A quote block within the WordPress editor.  It is wrapped in a Group block with a light blue background.
Quote block pattern and custom style.

In some ways, post formats were always limiting. The feature was never fleshed out, and there were only nine allowed formats. At the end of the day, each was merely a term within a taxonomy. There were never any rules about how it all was supposed to work. Maybe that is not such a bad thing. Now, posts can be anything users want them to be.