LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-24-2005, 09:44 AM   #1
Zeppelin_Fan
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE
Posts: 16

Rep: Reputation: 0
Question PHP form help


I'm trying to creat an affliate application page but I can't get it to work. I keep getting an error for either a line that doesn't exist or a plave where there is no $. The area around these errors is the actual form. Any suggestions? oh and the error looks like this:
Quote:
Parse error: parse error, unexpected $ in /home/worm13/public_html/boards/afflilate_app.php on line 75
and here's the code for the area around the error (starts at line 50):

PHP Code:
if ( $at && $au && $ao && $ab) { //is everything is there
//check and make sure that the URL is unique
$query = "SELECT aff_url FROM affiliates WHERE aff_url = '$au'";
$result = @mysql_query($query);
if (mysql_num_rows($results) == 0) { //is what really makes sure its not been used
//add the affiliate
$query = "INSERT INTO affiliates (aff_title, aff_url, owner, about, since) VALUES ('$at', '$au' '$ao', '$ab', NOW() )"; 
$results = @mysql_query($query); //adds the affiliate

echo '<tr><td class="system" colspan="100%" align="center"> Thank you for applying! Return to the<a href="http://www.eternalrealm.centaurinetx.com/boards/affiliates.php"> Affiliates Page.</a>
</td></tr>';
foot();
exit();
} //end of submit conditionals! YAY!
echo '<tr><td class="dark">Affiliate Application</td></tr>';
?>
<form method="post">
<feildset>
<tr><td '.shade().'>Site Title:<input type="text" name="aff_title" size="15" maxlength="30" value="aff_title" /> </td></tr>

<tr><td '.shade().'>Site URL:<input type="text" name="aff_url" size="15" maxlength="30" value="aff_url" /> </td></tr>

<tr><td '.shade().'>Site Owner:<input type="text" name="owner" size="2" maxlength="30" value="owner" /> </td></tr>

<tr><td '.shade().'>About the Site: <textarea rows="3" cols="50" name="about"> </textarea></td></tr>

 <div align="center"><input type="submit" value="affiliates" /></div>
</feildset>
</form>
<?php
foot
()
?>

Edit; Fixed code that was copied wrong.

Last edited by Zeppelin_Fan; 03-24-2005 at 04:50 PM.
 
Old 03-24-2005, 10:09 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
- add a ";" after each foot()
-2 "}" are missing somewhere as you opened 4 if's and closed only 2
 
Old 03-24-2005, 03:07 PM   #3
Zeppelin_Fan
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you for your help! I hope it works.
 
Old 03-24-2005, 03:30 PM   #4
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
This part looks kind of odd too:

PHP Code:
echo '<tr><td class="syste
if ( $at && $au && $ao && $ab) { //is everything is there
//check and make sure that the URL is unique 
Shouldn't you be closing "syste there?
 
Old 03-24-2005, 03:35 PM   #5
TheLinuxDuck
Member
 
Registered: Sep 2002
Location: Tulsa, OK
Distribution: Slack, baby!
Posts: 349

Rep: Reputation: 33
Quote:
Originally posted by deiussum
This part looks kind of odd too:

PHP Code:
echo '<tr><td class="syste
if ( $at && $au && $ao && $ab) { //is everything is there
//check and make sure that the URL is unique 
Shouldn't you be closing "syste there?
It looks likes Zeppelin_Fan accidently overshot the mouse, and copied some code from the terminal buffer, instead of just what was on the current page. (= I always hit SHIFT-PAGEUP instead of just PAGEUP, which usually makes me do a double-take.
 
Old 03-24-2005, 04:47 PM   #6
Zeppelin_Fan
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE
Posts: 16

Original Poster
Rep: Reputation: 0
Hmm...that seems to be an error more in copy and pasting it then anuything. I know becuase those tags are closed in the acutal script.

Yea there was an error there probably when I copied and pasted.

Last edited by Zeppelin_Fan; 03-24-2005 at 04:51 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No form output in PHP jabfinger Programming 2 07-15-2005 06:48 PM
Simple PHP help with a form :-) 2782d4 Programming 3 12-17-2004 02:53 AM
PHP to sendmail from form lawadm1 Linux - Software 1 08-16-2004 11:55 PM
php/form kev82 Programming 0 02-25-2004 06:21 PM
Creating form with PHP absolut Linux - Newbie 1 01-21-2004 01:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration