Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

New Web Designer Looking for pointers


  • Please log in to reply

#16
LazyStudent

LazyStudent

    Member

  • Topic Starter
  • Member
  • PipPip
  • 21 posts
I did the form page.The php code that the program created is below. I have never used php before by the way. Anyway I uploaded both the php file and my guestbook form to the server. What do I do next? The guest book form is here:
http://www.bonfire-m.../Guestbook.html
And below is the php code.
<?
// +----------------------------------------------------------------------+
// | inPHormer form parse |
// | Built with inPHormer 1.03 |
// +----------------------------------------------------------------------+
// | Copyright © 2002 Shift srl |
// | http://www.shift.it |
// +----------------------------------------------------------------------+
$inPHormer_msg = "name: $name\nemail: $email\ncomment: $comment\nsubmit: $submit\nreset: $reset\n";
$inPHormer_err = "";
$inPHormer_ok = "http://www.bonfire-m...uestbook.html";
$inPHormer_subj = "Info from your Site";
$inPHormer_mailTo = "mymail@yahoo.ie";
$inPHormer_headSend = "From: inPHormer<$reset>\n";
$inPHormer_headSend .= "Reply-To: $reset\n\n";
if (!$name || !$comment || !$submit || !$reset) {
header("Location: $inPHormer_err");
exit;
} else {
if (ereg("^([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z,]+))*([_,-])?[@]([0-9,a-z,A-Z]{3,})([_\,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2,3}([.]([0-9,a-z,A-Z]){2,3})?$", $reset)){
mail($inPHormer_mailTo, $inPHormer_subj, $inPHormer_msg, $inPHormer_headSend);
$a = fopen("Guestbook.html", "a+");
fputs($a, "$name;$email;$comment;$submit;$reset\n");
fclose($a);
header("Location: $inPHormer_ok");
} else {
header("Location: $inPHormer_err");
exit;
}
}
?>
  • 0

Advertisements


#17
sunny441

sunny441

    Member

  • Member
  • PipPipPip
  • 258 posts
Ok good job that!!! Its always so easy with InPHormer, but I still think there are a few things that you need to fix before yu can actually edit the code!!! Am giving you a list of things - and remember to test the PHP on your email address and not your clients!!!!!! ;)

InPHormer hasn''t been updated in a while and there seems to be no updates or new releases in sight as well. Thats why all this trouble but anyway here are the things to do -

$inPHormer_err = "";
Here you will want to enter a page called error.html or something to that effect - this is basically a page which will tell the visitor that they have not entered some information into the form, if you do make some of the form fields mandatory.


$inPHormer_ok = "http://www.bonfire-m...uestbook.html";
You do not want to link back to the guestbook on your site!!! Instead link to a page called Ok.html or anything - that will tell the visitor that his infomation has been sent successfully! You could use the Meta re-direct tag on this page and after a few seconds have them re directed back to the bon-fire music home page!!


$inPHormer_mailTo = "mymail@yahoo.ie";
This is the email address the form data will be sent to once you click the submit or send button!!! remember to test on your e-mail address before actually putting up  a clients email address!!!


Ok thats that!! Now is the other part, the most important part before your code actually works You see the first line of the PHP code that looks like this -
$inPHormer_msg = "name: $name\nemail: $email\ncomment: $comment\nsubmit: $submit\nreset: $reset\n"

Now abovt that line you will have to enter a line for each of the form fields that you have created. since you have three form fields viz, name e-mail and comments you will have to do three lines. Each line will look like this

$name = $HTTP_POST_VARS['name'];


similarly you will have two more lines for email and comments as well. Please do make sure that you have the capitalization right , else your code will go kaput!!!

Hope that does help!!!!! Let us know how it goes, and we will be glad to be of any further assistance to you!!
:tazz:
  • 0

#18
LazyStudent

LazyStudent

    Member

  • Topic Starter
  • Member
  • PipPip
  • 21 posts
Hey I had to give up on the InPHormer program code because it turns out the band want a guestbook that returns the comments for everybody to see. They dont want it to just email them the comments.

With this in mind I set out to get some open source code. I want to learn php but I dont have the time right now so open source is my only option. I found some simply code but there is one big problem with it that I cannot fix. Its probably a simple solution but I dont have a clue when it comes to php.

Here is the link to the guestbook as it is now:
http://www.bonfire-m.../Guestbook.html

The problem is that the form is handled by taking all the user's input and placing it in a txt file. Every users info is placed in this file and each users info is placed on one line. The php code then displays each line as a seperate user. The problem is that when you press enter on in the comments field the txt file takes in the newline charactor thus displaying one users comments as 2. Any ideas on how i could sort this. If I dont sort this I think I'll just have to sign up to one of those guestbook programs. But I'd rather not.
  • 0

#19
LazyStudent

LazyStudent

    Member

  • Topic Starter
  • Member
  • PipPip
  • 21 posts
Ignore what I said in the last post. I found some open source that does the trick nicely. All that the designer of the code wants in return is that you have a very small text link to his site on the bottom of your guestbook page. Barely noticeable.If any of you want to get the check out this code use link on the bottom of my guestbook.
  • 0

#20
sunny441

sunny441

    Member

  • Member
  • PipPipPip
  • 258 posts
Awesome!!
Glad that it works for you.. and keep those websites coming along

cheers
  • 0

#21
Guest_joeultra_*

Guest_joeultra_*
  • Guest
try adding some more advanced graphics possibly through photoshop and sunny has a good idea for a guestbook. i'd stick with tables too.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP