1. Welcome to the eTeknix Forums Guest. Please register or login and remember to read the forum guidelines to make your stay as pleasant as can be.

Website help

Discussion in 'HTML, Graphics & Programming' started by Rik1254, Feb 28, 2013.

  1. Rik1254

    Rik1254 Well-Known Member

    Joined:
    Feb 16, 2012
    Messages:
    650
    Likes Received:
    33
    Location:
    Abertillery, S.Wales Valleys
    Show PC Specs
    CPU:
    Core i5-2500k
    Motherboard:
    Asus P8Z77-I Deluxe
    Memory (RAM):
    8GB Kingston Genesis 1866Mhz DDR3
    Storage:
    Samsung 850 Pro 512GB, Samsung 830 128GB, 2TB WDG 64mb, 3TB Seagate 64mb
    Graphics Card(s):
    Gigabyte G1 Gaming GTX 970
    Power Supply (PSU):
    Corsair AX760i
    Case:
    Corsair Carbide 250D
    Monitor(s):
    Too many
    Operating System(s):
    Windows 8.1 Pro 64bit
    Internet Connection:
    FIBERRRRRRRRRR
    Having to create my own website for a college assignment and to be incorporated into this, we need a contact form (which is already supplied).

    Now I've integrated the contact form and confirmation page into the website already, just need to somehow get it working with the PHP doc we've been supplied.

    PHP:
    <?php 
    if(isset($_POST['submit'])) { 
    $to "xxxxx@coleggwent.ac.uk"
    $subject "What are you thinking submission!"
     
    // data the visitor provided
    $name_field filter_var($_POST['name'], FILTER_SANITIZE_STRING); 
    $email_field filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
    $comment filter_var($_POST['comment'], FILTER_SANITIZE_STRING);
     
    //constructing the message 
    $body " From: $name_field\n\n E-Mail: $email_field\n\n Message:\n\n $comment";
     
    // ...and away we go!
    mail($to$subject$body);
     
    // redirect to confirmation
    header('Location: A.html');
    } else { 
    // handle the error somehow 

    ?>



    Ive got this contained within the same folder as the contact form and confirmation page, but whenever I click "send" on the contact form, it just displays the PHP doc.
    This did work in college without an internet connection and Im now confused how to get this working.
    A.html is the confirmation page and Ive tried using the entire url (c\:etc....), but that didnt work either.
     
  2. Tommo

    Tommo Well-Known Member

    Joined:
    Jan 17, 2011
    Messages:
    464
    Likes Received:
    27
    Location:
    Chichester, West Sussex, United Kingdom
    Show PC Specs
    CPU:
    AMD Phenom II X6 1090T @ 4.1GHz
    Motherboard:
    Gigabyte GA-890GPA-UD3H AMD 890GX
    Memory (RAM):
    Corsair XMS3 8GB (4x2GB) DDR3 PC3-12800C9 1600MHz
    Storage:
    OCZ Vertex 2E 60GB 2.5&quot; SATA-II SSD, Samsung SpinPoint F3 1TB
    Graphics Card(s):
    HIS ATI Radeon HD 5850 iCooler V Turbo 1024MB GDDR5
    Power Supply (PSU):
    OCZ ModXStream Pro 600w Silent SLI
    Case:
    Modded Antec 300
    Monitor(s):
    Iiyama ProLite E2407HDS 24&quot;
    Operating System(s):
    Windows 7 Premium
    Internet Connection:
    Plus Net ISDN
    Use the correct http address. Call the page up on your browser and copy the url:

    PHP:
    header('Location: http://www.example.com/');
    If you use advanced editing and use the PHP code tags it makes it easier to read.

    If your using HTTP/1.1 you may have to work it this way to get it to send to the same directory as what your original file is in.

    PHP:
    $host  $_SERVER['HTTP_HOST'];
    $uri   rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra 'A.html';
    header("Location: http://$host$uri/$extra");
     
  3. Rik1254

    Rik1254 Well-Known Member

    Joined:
    Feb 16, 2012
    Messages:
    650
    Likes Received:
    33
    Location:
    Abertillery, S.Wales Valleys
    Show PC Specs
    CPU:
    Core i5-2500k
    Motherboard:
    Asus P8Z77-I Deluxe
    Memory (RAM):
    8GB Kingston Genesis 1866Mhz DDR3
    Storage:
    Samsung 850 Pro 512GB, Samsung 830 128GB, 2TB WDG 64mb, 3TB Seagate 64mb
    Graphics Card(s):
    Gigabyte G1 Gaming GTX 970
    Power Supply (PSU):
    Corsair AX760i
    Case:
    Corsair Carbide 250D
    Monitor(s):
    Too many
    Operating System(s):
    Windows 8.1 Pro 64bit
    Internet Connection:
    FIBERRRRRRRRRR
    Im working offline here, so the address would be (for my case) - file:///C:/Users/rik/Desktop/Webpage/A.html

    I've used both of your examples and both dont work.
     
  4. Tommo

    Tommo Well-Known Member

    Joined:
    Jan 17, 2011
    Messages:
    464
    Likes Received:
    27
    Location:
    Chichester, West Sussex, United Kingdom
    Show PC Specs
    CPU:
    AMD Phenom II X6 1090T @ 4.1GHz
    Motherboard:
    Gigabyte GA-890GPA-UD3H AMD 890GX
    Memory (RAM):
    Corsair XMS3 8GB (4x2GB) DDR3 PC3-12800C9 1600MHz
    Storage:
    OCZ Vertex 2E 60GB 2.5&quot; SATA-II SSD, Samsung SpinPoint F3 1TB
    Graphics Card(s):
    HIS ATI Radeon HD 5850 iCooler V Turbo 1024MB GDDR5
    Power Supply (PSU):
    OCZ ModXStream Pro 600w Silent SLI
    Case:
    Modded Antec 300
    Monitor(s):
    Iiyama ProLite E2407HDS 24&quot;
    Operating System(s):
    Windows 7 Premium
    Internet Connection:
    Plus Net ISDN
    Ever looked at Xampp for a home server for your coursework? I used it all the time when I was coding.

    You say this worked offline at college?
     
  5. Rik1254

    Rik1254 Well-Known Member

    Joined:
    Feb 16, 2012
    Messages:
    650
    Likes Received:
    33
    Location:
    Abertillery, S.Wales Valleys
    Show PC Specs
    CPU:
    Core i5-2500k
    Motherboard:
    Asus P8Z77-I Deluxe
    Memory (RAM):
    8GB Kingston Genesis 1866Mhz DDR3
    Storage:
    Samsung 850 Pro 512GB, Samsung 830 128GB, 2TB WDG 64mb, 3TB Seagate 64mb
    Graphics Card(s):
    Gigabyte G1 Gaming GTX 970
    Power Supply (PSU):
    Corsair AX760i
    Case:
    Corsair Carbide 250D
    Monitor(s):
    Too many
    Operating System(s):
    Windows 8.1 Pro 64bit
    Internet Connection:
    FIBERRRRRRRRRR
    Never used Xampp, so can safely say no :p

    This did work offline in college, but it was kept in a different directory. I assume that just changing the addresses to my relevant ones would make it work?
    I do remember my tutor saying that I would need to create a new page for something and for the life of me I cant remember if it was to do with this of for something different.
     
  6. Tommo

    Tommo Well-Known Member

    Joined:
    Jan 17, 2011
    Messages:
    464
    Likes Received:
    27
    Location:
    Chichester, West Sussex, United Kingdom
    Show PC Specs
    CPU:
    AMD Phenom II X6 1090T @ 4.1GHz
    Motherboard:
    Gigabyte GA-890GPA-UD3H AMD 890GX
    Memory (RAM):
    Corsair XMS3 8GB (4x2GB) DDR3 PC3-12800C9 1600MHz
    Storage:
    OCZ Vertex 2E 60GB 2.5&quot; SATA-II SSD, Samsung SpinPoint F3 1TB
    Graphics Card(s):
    HIS ATI Radeon HD 5850 iCooler V Turbo 1024MB GDDR5
    Power Supply (PSU):
    OCZ ModXStream Pro 600w Silent SLI
    Case:
    Modded Antec 300
    Monitor(s):
    Iiyama ProLite E2407HDS 24&quot;
    Operating System(s):
    Windows 7 Premium
    Internet Connection:
    Plus Net ISDN
    What are you using as a home server?
    Whats the path to your document directory as far as your PHP is concerned?
     
  7. Rik1254

    Rik1254 Well-Known Member

    Joined:
    Feb 16, 2012
    Messages:
    650
    Likes Received:
    33
    Location:
    Abertillery, S.Wales Valleys
    Show PC Specs
    CPU:
    Core i5-2500k
    Motherboard:
    Asus P8Z77-I Deluxe
    Memory (RAM):
    8GB Kingston Genesis 1866Mhz DDR3
    Storage:
    Samsung 850 Pro 512GB, Samsung 830 128GB, 2TB WDG 64mb, 3TB Seagate 64mb
    Graphics Card(s):
    Gigabyte G1 Gaming GTX 970
    Power Supply (PSU):
    Corsair AX760i
    Case:
    Corsair Carbide 250D
    Monitor(s):
    Too many
    Operating System(s):
    Windows 8.1 Pro 64bit
    Internet Connection:
    FIBERRRRRRRRRR
    Im a complete web design noob, so you'll have to excuse me, but I dont believe Im using anything as a home server? Im litterally just coding using notepad and testing through chrome.
     
  8. TheWOLF26

    TheWOLF26 Forum Mod

    Joined:
    Jun 29, 2011
    Messages:
    1,055
    Likes Received:
    35
    Location:
    Romania
    Show PC Specs
    CPU:
    Intel core I7 2600K 3.4Ghz with custom made watercooling
    Motherboard:
    ASUS P8P67 REV 3
    Memory (RAM):
    Kingston HyperX Savage 8GB(2x4GB), DDR3, 1600MHz, CL9, 1.5V, XMP
    Storage:
    WD Caviar Blue 1TB SATA3 6GB/s
    Graphics Card(s):
    EVGA GTX 680 Classified 4GB
    Power Supply (PSU):
    Corsair GS800
    Case:
    An MSI old case(a very HARD case)
    Monitor(s):
    ASUS VH222D 22" 1920x1080
    Operating System(s):
    WINDOWS 7 ULTIMATE 64 bit
    Internet Connection:
    Broadband 1000mb/s
    I'm also a noob in the whole coding thing as i don't have a clue about the programming language:)))) If you want help with the music :)) i'm here
     
  9. Rik1254

    Rik1254 Well-Known Member

    Joined:
    Feb 16, 2012
    Messages:
    650
    Likes Received:
    33
    Location:
    Abertillery, S.Wales Valleys
    Show PC Specs
    CPU:
    Core i5-2500k
    Motherboard:
    Asus P8Z77-I Deluxe
    Memory (RAM):
    8GB Kingston Genesis 1866Mhz DDR3
    Storage:
    Samsung 850 Pro 512GB, Samsung 830 128GB, 2TB WDG 64mb, 3TB Seagate 64mb
    Graphics Card(s):
    Gigabyte G1 Gaming GTX 970
    Power Supply (PSU):
    Corsair AX760i
    Case:
    Corsair Carbide 250D
    Monitor(s):
    Too many
    Operating System(s):
    Windows 8.1 Pro 64bit
    Internet Connection:
    FIBERRRRRRRRRR
    Found the problem
    Just informed by my tutor that the college has its own hosting server that runs in the background and where we've been coding naturally and storing it directly in there, I thought there wasnt a server.

    Turns out I need that server :p
     
  10. Tommo

    Tommo Well-Known Member

    Joined:
    Jan 17, 2011
    Messages:
    464
    Likes Received:
    27
    Location:
    Chichester, West Sussex, United Kingdom
    Show PC Specs
    CPU:
    AMD Phenom II X6 1090T @ 4.1GHz
    Motherboard:
    Gigabyte GA-890GPA-UD3H AMD 890GX
    Memory (RAM):
    Corsair XMS3 8GB (4x2GB) DDR3 PC3-12800C9 1600MHz
    Storage:
    OCZ Vertex 2E 60GB 2.5&quot; SATA-II SSD, Samsung SpinPoint F3 1TB
    Graphics Card(s):
    HIS ATI Radeon HD 5850 iCooler V Turbo 1024MB GDDR5
    Power Supply (PSU):
    OCZ ModXStream Pro 600w Silent SLI
    Case:
    Modded Antec 300
    Monitor(s):
    Iiyama ProLite E2407HDS 24&quot;
    Operating System(s):
    Windows 7 Premium
    Internet Connection:
    Plus Net ISDN
    Sorry, yeah this is what I thought the problem may be. Look at XAMPP, easy to install and gives you a full localhost server.

    apache friends - xampp for windows

    Need any help setting it up just let me know
     
  11. Rik1254

    Rik1254 Well-Known Member

    Joined:
    Feb 16, 2012
    Messages:
    650
    Likes Received:
    33
    Location:
    Abertillery, S.Wales Valleys
    Show PC Specs
    CPU:
    Core i5-2500k
    Motherboard:
    Asus P8Z77-I Deluxe
    Memory (RAM):
    8GB Kingston Genesis 1866Mhz DDR3
    Storage:
    Samsung 850 Pro 512GB, Samsung 830 128GB, 2TB WDG 64mb, 3TB Seagate 64mb
    Graphics Card(s):
    Gigabyte G1 Gaming GTX 970
    Power Supply (PSU):
    Corsair AX760i
    Case:
    Corsair Carbide 250D
    Monitor(s):
    Too many
    Operating System(s):
    Windows 8.1 Pro 64bit
    Internet Connection:
    FIBERRRRRRRRRR
    Cracking, Ill get a look at that when I get back on the computer tomorrow.
    Thanks for the help :)
     
  12. Sarge_T

    Sarge_T Well-Known Member

    Joined:
    Dec 4, 2012
    Messages:
    429
    Likes Received:
    56
    Location:
    Denmark
    Show PC Specs
    CPU:
    i7 6700k / i5 4690k
    Motherboard:
    ASUS Maximus VIII Hero / ASUS Maximus VII Impact
    Memory (RAM):
    32GB Kingston HyperX Fury DDR4 2666MHz / 16GB Corsair Dominator Platinum DDR3 1866Hz CL9
    Storage:
    2x 240GB Kingston HyperX 3K SSD / 240GB Samsung 840 Pro / 2x 240GB Samsung 840 EVO
    Graphics Card(s):
    EVGA GTX 980 SC ACX / ?
    Power Supply (PSU):
    Corsair AX860i / Corsair AX760i
    Case:
    be quiet! Silent Base 800 / BitFenix Prodigy
    Monitor(s):
    BenQ XL2411T
    Operating System(s):
    Windows 10 Pro 64-bit
    Internet Connection:
    150mbps/30mbps
    I can vouch for XAMPP too, currently using it for my MySQL classes (3rd time I'm learning about SQL, and 2nd time with MySQL! 1 time with Microsoft SQL Server, liked that the most :p) and will probably have to integrate it with some PHP soon..
     
  13. altereDad

    altereDad Well-Known Member

    Joined:
    Dec 24, 2012
    Messages:
    129
    Likes Received:
    12
    Location:
    Winnipeg, Canada
    Show PC Specs
    CPU:
    3.0 GHz Intel Core 2 Duo
    Motherboard:
    ECS G31T-M 1.0
    Memory (RAM):
    4096 MB
    Storage:
    WD 640GB 7200RPM
    Graphics Card(s):
    ATI Radeon HD 4650
    Power Supply (PSU):
    Standard ATX for CM Centurian 5
    Case:
    Cooler Master Centurion 5
    Monitor(s):
    Samsung Syncmaster 2233BW
    Operating System(s):
    Windows 7 Ultimate 64bit
    Internet Connection:
    50Mbps D/3Mbps U
    Crap I have to relearn this sh..... it has been far too long
     
  14. Tommo

    Tommo Well-Known Member

    Joined:
    Jan 17, 2011
    Messages:
    464
    Likes Received:
    27
    Location:
    Chichester, West Sussex, United Kingdom
    Show PC Specs
    CPU:
    AMD Phenom II X6 1090T @ 4.1GHz
    Motherboard:
    Gigabyte GA-890GPA-UD3H AMD 890GX
    Memory (RAM):
    Corsair XMS3 8GB (4x2GB) DDR3 PC3-12800C9 1600MHz
    Storage:
    OCZ Vertex 2E 60GB 2.5&quot; SATA-II SSD, Samsung SpinPoint F3 1TB
    Graphics Card(s):
    HIS ATI Radeon HD 5850 iCooler V Turbo 1024MB GDDR5
    Power Supply (PSU):
    OCZ ModXStream Pro 600w Silent SLI
    Case:
    Modded Antec 300
    Monitor(s):
    Iiyama ProLite E2407HDS 24&quot;
    Operating System(s):
    Windows 7 Premium
    Internet Connection:
    Plus Net ISDN
    Somebody once told me that learning a second language (which coding effectively is) is like riding a bike, you never forget.

    For me its been 2 years:
    [​IMG]
     

Share This Page

Users Viewing Thread (Users: 0, Guests: 0)