Help - Search - Members - Calendar
Full Version: Message Form Needed
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
Jerry
I am trying to put up a simple script to let my visitors leave me a small message you know with their email and stuff, but that is not visible to everyone else. What I mean is maybe they type their message hit submit they get a thank you page and get redirected back to home page. Does anyone here know of one or get me started on creating one. Any and all help would be greatly appreciated.
Banjo
You could take a look at some guestbook scripts.
Jerry
Thanks for the reply Banjo, but not looking for a guestbook rather keep the post all private, don't want everyone being able to read them.
Banjo
Ok, ill try find something for you later.
Jerry
Thanks alot Banjo, I appreciate it.... biggrin.gif
Nite-Elve
QUOTE(Jerry @ Feb 20 2008, 04:02 PM) *
Thanks alot Banjo, I appreciate it.... biggrin.gif


I could make one. Do you want the info the user types in to go to your email, or store in a database, preferable MySQL?
Jerry
QUOTE(Nite-Elve @ Feb 20 2008, 09:22 PM) *
I could make one. Do you want the info the user types in to go to your email, or store in a database, preferable MySQL?


database, or flat file would be cool, Nite-Elve, it would be appreciated.
zchand
QUOTE(Jerry @ Feb 20 2008, 12:24 AM) *
I am trying to put up a simple script to let my visitors leave me a small message you know with their email and stuff, but that is not visible to everyone else. What I mean is maybe they type their message hit submit they get a thank you page and get redirected back to home page. Does anyone here know of one or get me started on creating one. Any and all help would be greatly appreciated.



Please hunter.gif your page url than we try to solve problem
Bye laugh.gif
Banjo
QUOTE(zchand @ Feb 23 2008, 05:46 AM) *
Please hunter.gif your page url than we try to solve problem
Bye laugh.gif


There isn't a problem he just wants a simple message form. And you don't need there url to make one or get him on the right steps.
Nite-Elve
QUOTE(Jerry @ Feb 20 2008, 11:22 PM) *
database, or flat file would be cool, Nite-Elve, it would be appreciated.

Sure, i'll work on it now smile.gif. I'm not even going to include that i made it either tongue.gif.

EDIT:

Alright done

http://dl.therunehorde.info/?file=script482&session=3

Hope you enjoy tongue.gif. Be sure to give me a link on where you are using it, i wanna see lol tongue.gif.


BANJO: Dood your from cruels? You made a client didn't you? Pretty nice tongue.gif.

Jerry
Thanks alot Nite-Elve, I appreciate the time you took for this and definitely I will give the link to check it out soon I have it up and running.
Thanks again good looking out.... smile.gif
Banjo
QUOTE
BANJO: Dood your from cruels? You made a client didn't you? Pretty nice


Yeh i am. Thanks, i don't play the game anymore but im making a better one with way more features on.
Nite-Elve
Your welcome smile.gif. Don't hesitate if you need anything else.

Banjo: Ah I see. Nice running into you here tongue.gif.
Banjo
Are we amen't to make the index file displaying the results or did you make one and not put in the zip?

I can make one just wondering if you already made one though.
Klinggon22
I checked that script looks cool but how is he suppose to view his messages?
Banjo
QUOTE(Klinggon22 @ Feb 25 2008, 11:12 PM) *
I checked that script looks cool but how is he suppose to view his messages?


You could try this, maybe change a few things.

CODE
<?php include("config.php"); ?>

<?php

$db = mysql_connect($host, $username, $password);
if(! $db )
{
  die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT name, comment FROM $tbl_name';

mysql_select_db($db_name);
$retval = mysql_query( $sql, $db );
if(! $retval )
{
  die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_assoc($retval))
{
    echo "Name: {$row['name']} <br> ".
         "Comment: {$row['comment']} <br> ".
         "--------------------------------<br>";
}
mysql_close($db);
?>
Paradoks
I included a PHP comment/emailer script, if you want you can give me your email adress or ur AIM Screenname and ill Email you the HTML form and the PHP config file :-)
EMOruffino
i have one thats on my production site:

http://contentzero.com/contact

its an ajax email script, pretty funny at times too smile.gif
IamShipon1988
I remember working on one for one of my sites. I'll take a look in my hard-drive and see if I can find it
Jerry
QUOTE(Banjo @ Feb 27 2008, 06:32 AM) *
You could try this, maybe change a few things.

CODE
<?php include("config.php"); ?>

<?php

$db = mysql_connect($host, $username, $password);
if(! $db )
{
  die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT name, comment FROM $tbl_name';

mysql_select_db($db_name);
$retval = mysql_query( $sql, $db );
if(! $retval )
{
  die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_assoc($retval))
{
    echo "Name: {$row['name']} <br> ".
         "Comment: {$row['comment']} <br> ".
         "--------------------------------<br>";
}
mysql_close($db);
?>


Thanks Banjo, but I get an error don't know what I am doing wrong. The script that Nite-Elve made works just that I don't know how to retrieve the comments left.
Banjo
What error do you get?

This is a demo of his script iv got working with a page with comments on

Add New

Comments
Jerry
QUOTE(Banjo @ Mar 1 2008, 12:08 AM) *
What error do you get?

This is a demo of his script iv got working with a page with comments on

Add New

Comments


The error I am getting Banjo is
Could not get data: Table '????????_zxq_net_ccments.$tbl_name' doesn't exist


I get this when I use the code you made for me to view the comments.
Banjo
Ok, replace the old code with this.

CODE
<?php include("config.php"); ?>

<?php

$sql = 'SELECT name, comment FROM comments';

mysql_select_db($db_name);
$retval = mysql_query($sql);
if(! $retval )
{
  die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_assoc($retval))
{
    echo "Name: {$row['name']} <br> ".
         "Comment: {$row['comment']} <br> ".
         "--------------------------------<br>";
}
mysql_close();
?>


Tell me if it works for you.
Jerry
Yes it worked Banjo, thanks alot I really appreciate it and all the time you took to make it...... biggrin.gif
Banjo
No probs, any problems just ask biggrin.gif
Conmiro
Interesting.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.