Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    9
    Member #
    11017
    Hi,
    I'm currently working on a project for university and I need a webpage where users can submit their email address to a database. The way ive got it going so far is that i am trying to store the address in a database within a table called 'mail' with the 'email' field being included in it, this i have already set up.

    However, i keep getting the error message "Parse error: parse error, unexpected T_VARIABLE in /spare/apache/htdocs/stud/c0359743/cit1340/signup/create_entry.php on line 7"

    I have looked at this line for so long now and I have no idea what the problem is (im very new to PHP)

    Ive included the files here, ive masked the username and password etc in the dbconnect file for obvious reasons.

    Anyone have any ideas?? Also is there some existing PHP script that i could use to perform this function that anyone knows of? I need to allow users to 'unsubscribe' also. I am allowed to use other peoples script as long as they are credited in the report.

    Many Thanks.

  2.  

  3. #2
    Senior Member karinne's Avatar
    Join Date
    Dec 2003
    Location
    Aylmer QC Canada
    Posts
    1,607
    Member #
    4335
    Liked
    8 times
    try changing create_entry.php like this

    PHP Code:
    .......

    if (
    $_REQUEST["submit"] == "Sign!")
    {
      
    $email $_REQUEST["emailaddress"];
        
    $query "insert into mail (email) values ('$email')"    ;
        
    mysql_query($query) or die("query failed: $query ".mysql_error());
    ?>
    ....... 
    [a web design portfolio - Currently NOT AVAILABLE for work | web design | Re-coding | PSD-to-HTML]
    I'm also on: virb - facebook - twitter - flickr - del.icio.us

  4. #3
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    a so called T-Variable..... is caused by some syntactic failure in your script.

    In your case, the immediate culprit, is the lack of a concatination symbol where your double quote ends.
    PHP Code:
    $query "insert into mail (email) values ('".$_REQUES 
    The symbol is a "." where string info ends and code starts.
    S. Rosland


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:49 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com