Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 27

Thread: Dig in

  1. #1
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts

    Dig in

    Hey People of CodingForums.com
    please go as harsh as you like for
    www.jamiewest.org.uk
    please note I know there is no page for food at the moment.
    ill check back later for feedback
    thanks in advance.
    Rafiki

  • #2
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts
    try setting a max width. When it is full screen on my 21inch monitor is looks much less attractive then when I minimize the screen a bit.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The font-size is a little small. I was expecting the tabs to have rounded corners as well but they didn't. Don't use XHTML1.1 if you don't know how to pass the correct headers. Its an XHTML template yet you have some elements that are in uppercase. All elements need to be in lower case. Hmm it also looks like register globals is on. Type this in your address bar and watch what happens to the subject field.
    Code:
    http://www.yoursite.com/contact.php?subject=this is a test
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,791
    Thanks
    8
    Thanked 131 Times in 129 Posts
    Loks wise it's fine. Along with the coding... you have all your headers as H1's. Might want to look into changing that. A min-width would be a nice touch as well.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #5
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    The font-size is a little small. I was expecting the tabs to have rounded corners as well but they didn't. Don't use XHTML1.1 if you don't know how to pass the correct headers. Its an XHTML template yet you have some elements that are in uppercase. All elements need to be in lower case. Hmm it also looks like register globals is on. Type this in your address bar and watch what happens to the subject field.
    Code:
    http://www.yoursite.com/contact.php?subject=this is a test
    @ aero
    i use
    PHP Code:
    value="<?php if(isset($_GET['subject'])) { echo $_GET['subject']; } ?>"
    because i link to that page with the subject already being sent.
    also i dont no how to round the corners lol i should increase the font size to? @ others, min width? max width?
    Last edited by rafiki; 03-01-2008 at 12:10 PM.

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Code:
    value="<?php if(isset($_GET['subject'])) { echo $_GET['subject']; } ?>"
    should use $_POST instead, I think, as your form uses method="post"

    Also apply float:left; and some suitable width for your labels(Name, Subject etc.) in contact form, which will align them well.
    Last edited by abduraooft; 03-01-2008 at 12:17 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    no because when the page loads from a link in my site the value shown in the box is from $_GET then it will check $_POST when form is submitted
    also rounded corners?
    Code:
    -moz-border-radius: 15px 15px 15px 15px;

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Aah.. that's fine (I see your links to contact page.)
    But, if you'd like to validate the form data, before sending to you/posting to DB, then you may have to change that part. Say else echo $_POST['subject']; along with the errors.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #9
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    ill show you whole code you'll see how it works.

    PHP Code:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html>

    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
    <meta name="description" content=""/>
    <meta name="keywords" content=""/> 
    <meta name="author" content=""/> 
    <link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
    <title>Contact Me</title>
    </head>

    <body>

    <div class="container">

        <div class="header">
            
            <div class="title">
                <h1>JamieWestDotOrgDotUK</h1>
            </div>

            <div class="navigation">
                <a href="index.php">Home</a>
                <a href="blog.php">Blog</a>
                <a href="contact.php">Contact Me</a>
                <a href="cooking.php">Food</a>
                <a href="http://php.jamiewest.org.uk/index.php">PHP Projects</a>
                <div class="clearer"><span></span></div>
            </div>

        </div>

        <div class="main">
            
            <div class="content">
            <br /><br />
            <?php 
            $to 
    'guessit@jamiewest.org.uk';
            
    $headers  'MIME-Version: 1.0' "\r\n";
            
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
            
            
    $error 0;
            
            if (isset(
    $_POST['name'])){
            
    $name mysql_real_escape_string($_POST['name']);
            }else{
            echo 
    'Enter your name. <br />';
            
    $error++;
            }
            if (isset(
    $_POST['email'])){
            
    $from mysql_real_escape_string($_POST['email']);
            
            }else{
            echo 
    'Enter your <b>VALID</b> Email address. <br />';
            
    $error++;
            }
            if (isset(
    $_POST['subject'])){
            
    $subjct mysql_real_escape_string($_POST['subject']);
            }else{
            echo 
    'Enter a subject.<br />';
            
    $error++;
            }
            if (isset(
    $_POST['message']) && (strlen($_POST['message'] <= 20))){
            
    $message mysql_real_escape_string($_POST['message']);        
            }else{
            echo 
    'Please use atleast 20 characters in your message.';
            
    $error++;
            }
            if (
    $error == 0){
            
    $msg "Message: <BR/ > $message <br /> From: <br />  $from <br /> Name: $name ";
            
    $mail mail($to$subject$msg$headers);
            if(
    $mail) {
            echo 
    'Thanks for contacting me.';
            }else{
            echo 
    'Sorry mail could not be sent, try later.';
            }
            }else{
                
            
                }
                
    ?>
                <form action="contact.php" method="post" >
                <LABEL for="name">Name:</LABEL><input id="name" type="text" name="name" class="styled" /><br />
                <LABEL for="email" >Email:</LABEL><input id="email" type="text" name="email" class="styled" /><br />
                <LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value="<?php  echo htmlspecialchars($_GET['subject']); ?>" class="styled" /><br />
                <textarea name="message" class="styled" cols="45" rows="5">Enter message here....</textarea> <br />
                <br />
                <input type="submit" value="Send" class="button" /><br/><br/>
                </form><BR/>

    ill check after work, got called in :@:@
    Last edited by rafiki; 03-01-2008 at 12:30 PM. Reason: called to work

  • #10
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    isset($_POST['subject']) is not enough to check whether someone filled this or not. You have to check the length or at least
    PHP Code:
    if(isset($_POST['subject']) && trim($_POST['subject'])!="" 
    Then you have to check the email format and so on...

    BTW, remove the email id from the above post, spammers can read it.
    Last edited by abduraooft; 03-01-2008 at 01:29 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #11
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You spelt subject wrong. Also why are you using mysql_real_escape_string? What are you putting into a database?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #12
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    nothing it still removes the danger element though right? ill change subject now, and the guessit@jamiewest.org.uk email address doesnt exist, its a cover for what its meant to be

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I'm guessing you are connecting to a database already then or that function call would fail without one. As to the rounded corners that only works in Mozilla based browsers. There isn't much to review on your site as you didn't actually code the front-end. I'm guessing everything else is just a blog, wordpress perhaps. I had a contact form that was getting spammed 5 times a minute. I then found this article: http://www.phpbuilder.com/columns/ia...n20060412.php3

    Now I haven't received any spam since I've implemented the suggestions in the article. You can also use something like this to prevent emails that contain nothing but links.
    PHP Code:
    if(preg_match('/http/i',$Name) || preg_match('/http/i',$Email) || preg_match('/http/i',$Comment))
    {
    // do something    

    Last edited by _Aerospace_Eng_; 03-01-2008 at 05:19 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #14
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    i added
    http://www.ilovejackdaniels.com/php/...ss-validation/
    and will take a look into that article.
    a good thing is im not indexed in google yet so spammers wont find my contact form at the moment.
    @aero i also included the contents of that article, if you would be so kind as to test i would be most gratefull
    Last edited by rafiki; 03-01-2008 at 05:29 PM.

  • #15
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    IAs to the rounded corners that only works in Mozilla based browsers.
    how can i round corners in all browsers?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •