PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, February 23, 2022

[FIXED] Display random generated characters on form to mail

 February 23, 2022     database, html, mysql, php, phpmyadmin     No comments   

Issue

I've created a form which will generate random characters and will be sent through mail, it works but it won't show the tracking number.

Here are my variables:

$length = 10;

$trackingcode = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
$reqname = $_POST['reqname'];
$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];
$empname = $_POST['empname'];
$position = ($_POST['position']);
$account = $_POST['account'];
$platform = $_POST['platform'];
$processor = $_POST['processor'];
$ram = $_POST['ram'];
$monitor = $_POST['monitor'];
$phone = $_POST['phone'];
$phonetype = $_POST['phonetype'];
$headset = $_POST['headset'];
$status = $_POST['status'];
$approval = $_POST['approval'];

And here's the form to mail code:

$message .= "<tr style='background: #CDD9FF;'><td><strong>Tracking Code</strong> </td><td style='color:blue;'>" . strip_tags($_POST['trackingcode']) . "</td></tr>";

For some reason it won't post, I think because I used $_POST, correct me if I'm wrong. What should I do?


Solution

You have to use this

$message .= "<tr style='background: #CDD9FF;'><td><strong>Tracking Code</strong> </td><td style='color:blue;'>" . $trackingcode) . "</td></tr>";


Answered By - Siddharth Ramani
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing