Dear

I am pasha from (Bangalore)India, i have a query

In a web page how can i allow a user to write tetimonal online and it should be veiwed by everyone..means that should be present in feedback page...as users post their comments that should go adding on the web page

once the user has clicked the button(write Testimony) then a pop-up window will be there in which all the details will be requested for the user to enter like...
name, email ID, contact Number, city and Trestimony(in a multi-text box)

after entering all the details if the user presses submit botton, then their testimony should be visible on the feedback page

As the Content is displayed on the page then immediately a mail should be received containing name, mail ID, contact no, city and testimony..

please help me how to do this

Dani AI

Generated

A short, practical plan for that builds on the points from , and : use a modal for input, POST the form to a server endpoint, validate and persist the data in a testimonials table, optionally hold new entries in a moderation queue, send an admin notification, and return a JSON success so the page can append the new item immediately (or after approval).

Database example (minimal schema):

CREATE TABLE testimonials (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100),
  email VARCHAR(150),
  phone VARCHAR(30),
  city VARCHAR(100),
  message TEXT,
  status ENUM('pending','published','spam') DEFAULT 'pending',
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  ip VARCHAR(45),
  user_agent VARCHAR(255)
);

Implementation notes and a tiny insert example (server side): always validate on the server, use prepared statements and never trust client input.

$stmt = $pdo->prepare(
  "INSERT INTO testimonials (name,email,phone,city,message,ip,user_agent) VALUES (?,?,?,?,?,?,?)"
);
$stmt->execute([$name,$email,$phone,$city,$message,$_SERVER['REMOTE_ADDR'],$_SERVER['HTTP_USER_AGENT']]);

Security, UX and policy caveats: sanitize/escape output (e.g., htmlspecialchars) to prevent XSS before rendering messages; use prepared statements to prevent SQL injection; add CAPTCHA or rate limits to reduce spam; keep email/phone out of public view (display name, city and message only) and store contact details only for admin use with clear consent. Prefer an explicit moderation workflow (status = pending) to avoid publishing spam or libel. For email notifications, use an authenticated SMTP library and queue sending so a slow mail server does not block the request. For better UX append the new testimonial client-side only after the server confirms success (or show a “pending” state if moderation is enabled).

Recommended Answers

All 4 Replies

There are many ways to do this. How you should do it really depends on what you know, and what you have to work with (i.e., your web hosting/server type and what it supports).

This isn't really a web design question either...

use a commenting system lile disqus as the testimonial thing

Have a go with Bootstrap to get your popup.

Then you need some PHP (and MySQL) to set out your database, insert and extract from it. You want a PHP server and a MySQL database setup to hold a column for each piece of data you want to store.

So try getting that setup, then we can write some simple PHP SQL SELECT and INSERT queries to get the data in and out.

Have you any web/server-side development experiance?

Matt

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.