Jump to content

toxictoad

Members
  • Posts

    94
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

toxictoad's Achievements

Member

Member (2/5)

0

Reputation

  1. Tested it out and it does send all the info now so thankyou Niel. One thing though, the way I had it before, the email addresses entered in the form became the return email address but now it's only in the email so is there a way to have the email address entered in the form to become the retunr email as before? Thanks again for your time and help
  2. Thanks guys, Yep new to php and struggle but persevere... So nope I don't really understand how to concatinate :-/ Neil if I copy your code so <?php $name = $_REQUEST['name'] ; $phone = $_REQUEST['phonenumber'] ; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {$emailResult= "<div>Your email was sent sucessfully</div>"; } else {$emailResult= "<div>We encountered an error sending your email</div>";} ?> becomes <?php $to = "myemail@mydomain.com"; $subject = "Contact Enquiry"; $emailBody = "Name: ".$_REQUEST['name']."\n"; $emailBody .= "Phone: ".$_REQUEST['phonenumber']."\n"; $emailBody .= "Email: ".$_REQUEST['email']."\n\n"; $emailBody .= $_REQUEST['message']."\n"; $headers = "From: $email"; $sent = mail("myemail@mydomain.com", "Contact Enquiry", $emailBody, $headers); if($sent) {$emailResult= "<div>Your email was sent sucessfully</div>"; } else {$emailResult= "<div>We encountered an error sending your email</div>";} ?> everything will work?
  3. Hey all, I just can't see what's wrong with my form/php. I fill in the form, and it gets sent to the correct address and has the correct return address and the message but the Name and Phone fields are not included in the email. Here's the HTML <form method="post" action="contact.php" name="contact" id="contact"> <table width="496" border="0"> <tr> <td width="83"><strong>Name:</strong></td> <td width="403"><input name="name" type="text" size="40" /></td> </tr> <tr> <td><strong>Telephone:</strong></td> <td><input name="phonenumber" type="text" size="40" /></td> </tr> <tr> <td><strong>Email:</strong></td> <td><input name="email" type="text" size="40" /></td> </tr> <tr> <td valign="top"><strong>Message:</strong></td> <td><textarea name="message" cols="30" rows="5"></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Reset" value="Reset" /></td> </tr> </table> </form> And the PHP <?php $to = "myemail@mydomain.com"; $subject = "Contact Enquiry"; $name = $_REQUEST['name'] ; $phone = $_REQUEST['phonenumber'] ; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {$emailResult= "<div>Your email was sent sucessfully</div>"; } else {$emailResult= "<div>We encountered an error sending your email</div>";} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>email confirmation</title> </head> <body> <?php echo $emailResult; ?> </body> </html> I thought it might be this line $sent = mail($to, $subject, $message, $headers) ; so changed it to: $sent = mail($to, $subject, $name, $phone, $message, $headers) ; but that gave me errors. Can anyone see what I can't? Thanks
  4. The first table amp_cats holds the name of each category, each category then has a product line and prices on each. So the line to the price of 250 business cards goes like this amp_cats > amp_pri > amp_pri_bc > amp_pri_bc_re > amp_pri_bc_re_p > amp_pri_bc_re_p_1c where the final table holds the quantity and price for each set of 1 colour business cards. So in your example the first table starts like this (amp_cats) PK | ser --------- 01 | pri | 02 | pro | --------- The next is (amp_pri) --------------- PK | type | FK | --------------- 01 | bc | 01 | 02 | bo | 01 | --------------- But the only value in amp_pri that can be used as an FK is the PK from amp_pri to the FK of amp_pri_bc. So can I just use the PK or do I have to create a new field for the exclusive purpose of creating a FK in amp_pri_bc? Also in the very last table in the first post was going to be like this (after amending the PK) PK | Quantity | Price -------------------- 01 | 250 | 38 02 | 500 | 55 03 | 1000 | 65 But if I understand the normalization right, I don't need that PK as I would be able to use the Quantity field as it's a unique number for each record. Is this correct? So it would be like this PK | Price ----------- 250 | 38 | 500 | 55 | 1000 | 65 | ----------- etc Am i on the right track?
  5. Following your example would I therefore need a new field in the Printing table for there to be a foreign key or can I use the primary key from this table to be the foreign key in the following table?
  6. Thanks Mchl, that's the sticky I went to before and followed the info on http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html My database would basically follow the same structure as what I posted but for each field in the amp_cats table (only names and prices will change. I understand the reasons for doing it this way and can see from this design that it will reduce the data entered and reduce the possibility of errors but other than that I guess that's all I understand. I still have no idea how they join together but that's for another post
  7. ah I see ok thank you Mchl that makes it a lot clearer. Apart from that, is this the correct way to build the table structure?
  8. Hey all, I've asked this a while back and was pointed to a tutorial and since have read various info on relational databases although I still am unsure if I understand it right. I'll try and lay it out the way i do understand it and hopefully you'll be able to follow and help. The database is to store prices on various products. Database name: am_pricing Table: Categories, name: amp_cats Fields: PK | Cat | FK E.g: ____________ 01 | pri | 01 | 02 | pro | 02 | 03 | ba | 03 | -------------- Table: Printing, name: amp_pri Fields: PK | Type | FK (The PK here is the first FK from amp_cats) E.g: ___________ 01 | bc | 01 | 01 | bo | 02 | 01 | cg | 03 | ------------- Table: Printing, Business Cards, name: amp_pri_bc Fields: PK | Type | FK (The PK here is the first FK from amp_pri) E.g: ___________ 01 | re | 01 | 01 | fc | 02 | ------------- Table: Printing, Business Cards, Regular, name: amp_pri_bc_re Fields: PK | Type | FK (The PK here is the first FK from amp_pri_bc) E.g: ___________ 01 | p | 01 | 01 | g | 02 | 01 | m | 03 | ------------- Table: Printing, Business Cards, Plain, name: amp_pri_bc_re_p Fields: PK | Colour | FK (The PK here is the first FK from amp_pri_bc_re) E.g: ___________ 01 | 1 | 01 | 01 | 2 | 02 | ------------ Table: Printing, Business Cards, Plain, 1 Colour, name: amp_pri_bc_re_p_1c Fields: PK | Quantity | Price (The PK here is the first FK from amp_pri_bc_re_p) E.g: ___________ 01 | 250 | 38 | 01 | 500 | 49 | 01 | 1000 | 65 | 01 | 2000 | 99 | 01 | 5000 | 199 | 01 | 10000 | 299 | ----------------- That's a lot of tables and that's just a little bit of it (1 of 5 main categories for pricing) but is this right? I really hope so! Thanks
  9. Thanks peranha you made a good point about the focus of the cameras. Lets say for arguments sake that I was to put this info together, what would you be able to provide? Exact locations? For my idea I'd only be interested in cameras that are viewing public areas and not private bt I guess if people wanted to add private camera locations it wouldn't be excluded, just have to be differentiated between. I'm in the UK and the only idea I had was to make notes of where the cameras are as I walk/cycle around then adding these to google maps but this probably wouldn't show what the camera types are or what they can see. After looking around at online CCTV footage some have a very wide range they can move, some giving 360° with quite a lot of zoom etc so I guess just the actual locations of the camera could be certain without inside knowledge of the cameras.
  10. Some time ago my mountain bike was stolen from the city centre, during the day and they used (presumably) a pair of bolt croppers. The police could offer nothing to help and then I started thinking that whoever stole my bike must have been seen by cameras in the city centre and for a while I started looking out for them wondering how many there were and how hard it would be to do anything without being seen/recorded. Sure I understood that with it being such a petty crime they wouldn't bother looking at the CCTV footage but it did get my thinking. Then I started thinking about a website that could show where all the cameras are. As with most of my thinking it doesn't get far out of my head, but then I remembered the idea and did a little search. I couldn't find anything at the time like a website showing where cameras are but I did stumble on this http://forum.no2id.net/viewtopic.php?t=24819 that I found interesting and useful. So now I was just wondering what others thought about it? The website idea was a user generated site showing where cameras are all over the place, what areas they cover (approx viewing angle) etc. People could upload photos of the cameras, I don't know whether the google maps API could be used so to give a better view etc of the location. Something like that anyway. I guess it wouldn't have helped me in any way and maybe this could be used negatively but it was an idea I wanted to throw out there...
  11. if you're going to use tables for page layout you might as well use layers/floating divs or whatever...it's not good design but better than tables and will give you precise positioning with ease (using the right WYSIWYG editor) and contained in an external pussy.css file
  12. I've been using 3ix.com for about 18 months, not had any real issues with them. They have live 24/7 tech support, from $1 (USD) per month you can host one domain with 10gb space and 20gb bandwidth so great for a testing server as they have the PHP 5, MySQL version 5, CPanel 11, Addon Scripts etc. For $3 pm you can host 3 domains with unlimited bandwidth, works well for me!
×
×
  • 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.