Jump to content

Creating PHP variables with fixed strings


chrisshortys

Recommended Posts

Hi there, I am very new to the world of coding but am slowly creating pages!

 

Now I have been doing work with PHP and mySQL this week and I have a question that I cannot find the answer for(probably because I am searching for the wrong phrase!).

 

What I want to be able to do is to take a piece of information from a html form and convert this into PHP a variable but with a modification. e.g.

 

 

From the html table the data is stored in the html variable "comp"

 

$tablename = $_POST[comp]

 

Now what I actually want the variable to end up as is something like BL_comp or comp_BL

 

How do you place the letters before or after the html/PHP variable?

 

All help would be greatly appreciated!

 

Chris

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.