PHP Variable input from user

taking php variable input from user

Page 1 of 1

4 Replies - 14481 Views - Last Post: 08 July 2005 - 06:40 AM Rate Topic: -----

#1 bimal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-July 05

PHP Variable input from user

Posted 06 July 2005 - 08:32 PM

Hi

anyone's help will be appriciated.


I have a form where content for email will be saved. In message field user wants some variable data like Dear <username>. Where <username> is variable. I am useing textarea for taking users input. Now how can it reconized those variables.

please email me solution for this. bimaltamrakar@gmail.com

thanks,
Is This A Good Question/Topic? 0
  • +

Replies To: PHP Variable input from user

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP Variable input from user

Posted 07 July 2005 - 06:55 AM

We actually prefer to post answers in the forums, that way everyone may benefit from the answer.

I assume by text area, you are actually referring to a text box. Making the assumption as well that you are using a POST method on your form, you would retrieve the information in the following manner:

$username = $_POST['username']


You can also import all request variables...Here is a good overview.
Was This Post Helpful? 0
  • +
  • -

#3 bimal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-July 05

Re: PHP Variable input from user

Posted 08 July 2005 - 04:53 AM

thanks for your reply

Please review my problem again. Let me explain in simple language


i have one variable

$var1="Dear <username> this is your email address <email> and your password is <password>"

now <username> has to be replace by the value from database which i already have in $username, $email, $password

Hope you got it now!
Was This Post Helpful? 0
  • +
  • -

#4 bimal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-July 05

Re: PHP Variable input from user

Posted 08 July 2005 - 04:56 AM

i new to php

do php have any function for find and replace

let me know..
Was This Post Helpful? 0
  • +
  • -

#5 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP Variable input from user

Posted 08 July 2005 - 06:40 AM

$var1="Dear $username this is your email address $email and your password is $password"



php does have string replacement functions...str_replace() is among the most used.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1