Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default more errors and help :S

    Parse error: syntax error, unexpected $end in /home/colin/public_html/v4/search/add.php on line 36
    PHP Code:
    <center>
    <?php
    // set your infomation.
    $dbhost='localhost';
    $dbusername='';
    $dbuserpass='';
    $dbname '';

    // connect to the mysql database server.
    mysql_connect ($dbhost$dbusername$dbuserpass);
    //select the database
    mysql_select_db($dbname) or die('Cannot select database');

    if (
    $_POST['name']) {
    $name $_POST['name'];
    if (
    $_POST['about']) {
    $about $_POST['about'];
    if (
    $_POST['url']) {
    $about $_POST['url'];
    $query "INSERT INTO search (name,about,url) VALUES ('".$name."','".$about."','".$url."')";
    mysql_query($query)or die(mysql_error());
    echo 
    $name." was inserted successfully";
    }else{
    echo 
    "About was left blank";

    }
    ?>
    <h2>Add</h2>
    <form action='add.php' method='POST'>
    Name: <input type='text' name='name' size='33' /><br />
    Url: <input type='text' name='url' size='33' /><br />
    About: <textarea name='about' cols='25' rows='5'/></textarea><br />
    <input type='submit' value='Add!' />
    </form>
    <a href="search.php">Search for a website.</a>
    </center>
    then hopefully my search engine and sumbit thing will be done maybe

    + how do you so when it echos the feild url it makes it into a hyperlink
    Last edited by Colin-Roberts; 03-09-2006 at 07:26 PM.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  2. #2
    Join Date
    Aug 2006
    Location
    Doncaster, UK
    Posts
    479
    Tokens
    0

    Default

    Point out line 36 fgs,

  3. #3
    Join Date
    Dec 2005
    Location
    XX
    Posts
    2,308
    Tokens
    2,015

    Latest Awards:

    Default

    I know, hightlight it or something i cba to count down to 36 or copy it into my editor


  4. #4
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    kk 1 sec i will.

    Edit:
    </center>
    is line 36 :S

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  5. #5
    Join Date
    Aug 2006
    Location
    Doncaster, UK
    Posts
    479
    Tokens
    0

    Default

    Quote Originally Posted by Soccer-Pro View Post
    kk 1 sec i will.

    Edit:
    is line 36 :S
    Bugger it mate.

    It's just text, not php

    I dont have a clue.
    Last edited by 1; 03-09-2006 at 07:31 PM.

  6. #6
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    lol me either :S hopefully mentor can shine some light on it

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  7. #7
    Join Date
    Aug 2005
    Posts
    1,080
    Tokens
    0

    Latest Awards:

    Default

    Google it
    Back?

  8. #8
    Join Date
    Aug 2006
    Posts
    181
    Tokens
    0

    Default

    god colin we fixed this earlier ^.^

    PHP Code:
    <center>
    <?php
    // set your infomation.
    $dbhost='localhost';
    $dbusername='';
    $dbuserpass='';
    $dbname '';

    // connect to the mysql database server.
    mysql_connect ($dbhost$dbusername$dbuserpass);
    //select the database
    mysql_select_db($dbname) or die('Cannot select database');

    if (
    $_POST['name']) {
    $name $_POST['name'];
    if (
    $_POST['about']) {
    $about $_POST['about'];
    if (
    $_POST['url']) {
    $about $_POST['url'];
    $query "INSERT INTO search (name,about,url) VALUES ('".$name."','".$about."','".$url."')";
    mysql_query($query)or die(mysql_error());
    echo 
    $name." was inserted successfully";
    }else{
    echo 
    "About was left blank";

    }
    }
    ?>
    <h2>Add</h2>
    <form action='add.php' method='POST'>
    Name: <input type='text' name='name' size='33' /><br />
    Url: <input type='text' name='url' size='33' /><br />
    about: <textarea name='about' cols='25' rows='5'/></textarea><br />
    <input type='submit' value='Add!' />
    </form>
    <a href="search.php">Search for a website.</a>
    </center>

  9. #9
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    lol soo...

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  10. #10
    Join Date
    Aug 2006
    Posts
    181
    Tokens
    0

    Default

    Try the code i posted does it work?

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
  •