Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Web design and Programming (https://novahq.net/forum/forumdisplay.php?f=32)
-   -   yet another problem... (https://novahq.net/forum/showthread.php?t=28739)

General Nuisance 08-11-2005 01:53 AM

yet another problem...
 
hey guys im beginning to think that this board was created just for me.. lol

just made this become affiliates script and its getting this error...

Parse error: parse error, unexpected $ in /var/www/localhost/htdocs/novazone/become_affiliates.php on line 61

i have looked over it and found a few minor issues but still didnt fix the error...

//I know there isnt any mysql_connect commands..//

PHP Code:

<?php

$self 
$_SERVER['PHP_SELF'];
$email $_POST['email'];
$wn $_POST['wn'];
$wurl $_POST['wurl'];
$wage $_POST['wage'];
?>
<html>
<body text="#FFFFFF" background="themes/default/back.gif" link="#FFFFFF" vlink="#FFFFFF" alink="#339933">

To become an Affiliate With The Nova-Zone we expect the following:
<BR>
<BR>
<li>That your site has been in operation for a least 30 days</li>
<li>Not A squad</li>
<li>Must Have a Paid Domain</li>
<BR>
<BR>
If your site contains ANY* of the following it will be removed ASAP.
<BR>
<BR>
<LI>ANY* FORM OF CHEATS THIS INCLUDES LINKS OR DOWNLOADS</li>
<li>ANY FORM OF PORNOGRAPHIC MATERIAL</li>
<li>Not active</li>
<BR>
<BR>
We also request that you add our link to your site.
<BR>
<BR>
If you feel that your site matches the above requirements then feel free to submit your request using the form below.
<BR>
<BR>
<form method="POST" action="<?php echo (' $self ');?>">
  Your Email Address: <input type="text" name="email" size="20"></p>
  <p>Your Websites Name: <input type="text" name="wn" size="20"></p>
  <p>Your Websites URL: <input type="text" name="wurl" size="20"></p>
  <p>How long your site has been around*THIS WILL BE CHECKED*:
  <input type="text" name="wage" size="20"></p>
  <p><input type="submit" value="Submit" name="submit"></p></form>
<?php
if( $email and $wn and $wurl and $wage )
{
//create the query//
$sql="insert into affiliates (email, wn, wurl, wage) values ( $email, '$wn', '$wurl', '$wage')";
//EXECUTE THE QUERY//
$rs $DB->Query$sql );
//confirm the added entry//
if($rs)
{
echo 
'Thank You For submiting Your Request we will be in contact with you.'
}
?>
* = BUT NOT LIMITED TO.
</body>
</html>

Thanks in advance..

Scott 08-11-2005 06:31 AM

If you coded with tabs it would be alot easier to see... yout missing an } after your first If statement.

General Nuisance 08-11-2005 10:18 AM

ahh.. thanks...

i generally do put allot of spaces in between the stuff but i didnt on that one for some reason...

General Nuisance 08-11-2005 11:03 AM

ok i added that and it does work now but when i fill out the form it does not submit the data to mysql and come up with page cannot be displayed..

http://nova-zone.com/become_affiliates.php

edit just tried the link above and it has the url bar and it says $self up there... hmm..

General Nuisance 08-11-2005 11:08 AM

ok i found it :)

i had:
PHP Code:


<form method="POST" action="<?php echo (' $self ');?>">

i took out the 2 ' 's and it worked :)

dont quite understand but who cares it works...

EDIT:

ok its working now but only if i put email as my email address if i put GeneraNuisance@charter.net it says invalid mysql sytax and if i put GeneralNuisanceATcharter.net then it says invalid field name and if i put email it works fine...


Scott 08-11-2005 11:10 AM

when I try to submit the form I get:

Fatal error: Call to a member function on a non-object in /var/www/localhost/htdocs/novazone/become_affiliates.php on line 53

which is prolly $DB->Query( $sql );

I was wondering about that because there is no class in that script and there is no include to include a file with the class..?

General Nuisance 08-11-2005 11:23 AM

i was typing while you were.. lol go back and read my post above..

and yes i forgot that... because i have my site built i cant have it as a popup i had to make it a regular page...

Scott 08-11-2005 11:56 AM

on the mysql insert your missing the 2 quotes, '$email'

General Nuisance 08-11-2005 12:23 PM

cool, thanks..

try it....

i would like to make the Thank you message appear by itself.. if its possible..

Scott 08-11-2005 12:48 PM

change your code around a bit:

put
PHP Code:

<?php 
if( $email and $wn and $wurl and $wage 

//create the query// 
$sql="insert into affiliates (email, wn, wurl, wage) values ( $email, '$wn', '$wurl', '$wage')"
//EXECUTE THE QUERY// 
$rs $DB->Query$sql ); 
//confirm the added entry// 
if($rs

echo 
'Thank You For submiting Your Request we will be in contact with you.'

?>

after the first bit of code and then put exit; where you want it to stop the script, in your case after the thanks message.

General Nuisance 08-11-2005 01:04 PM

still goes to bottm of page....

this is current script..

PHP Code:

<?php
require('themes/default/header.php');


$self $_SERVER['PHP_SELF'];
$email $_POST['email'];
$wn $_POST['wn'];
$wurl $_POST['wurl'];
$wage $_POST['wage'];
?>



<html>
<body text="#FFFFFF" background="themes/default/back.gif" link="#FFFFFF" vlink="#FFFFFF" alink="#339933">

To become an Affiliate With The Nova-Zone we expect the following:
<BR>
<BR>
<li>That your site has been in operation for a least 30 days</li>
<li>Not A squad</li>
<li>Must Have a Paid Domain</li>
<BR>
<BR>
If your site contains ANY* of the following it will be removed ASAP.
<BR>
<BR>
<LI>ANY* FORM OF CHEATS THIS INCLUDES LINKS OR DOWNLOADS</li>
<li>ANY FORM OF PORNOGRAPHIC MATERIAL</li>
<li>Not active</li>
<BR>
<BR>
We also request that you add our link to your site.
<BR>
<BR>
If you feel that your site matches the above requirements then feel free to submit your request using the form below.
<BR>
<BR>
<form method="POST" action="<?php echo ( $self );?>">
  Your Email Address: <input type="text" name="email" size="20"></p>
  <p>Your Websites Name: <input type="text" name="wn" size="20"></p>
  <p>Your Websites URL: <input type="text" name="wurl" size="20"></p>
  <p>How long your site has been around*THIS WILL BE CHECKED*:
  <input type="text" name="wage" size="20"></p>
  <p><input type="submit" value="Submit" name="submit"></p></form>

<?php
if( $email and $wn and $wurl and $wage 

//create the query// 

$sql="insert into affiliates (email, wn, wurl, wage) values ( '$email', '$wn', '$wurl', '$wage')"

//EXECUTE THE QUERY// 

$rs $DB->Query$sql ); 
}
//confirm the added entry// 

if($rs

echo 
'Thank You For submiting Your Request we will be in contact with you.'


exit;
?>
<BR>
<BR>
* = BUT NOT LIMITED TO.
<?php require('themes/default/footer.php'); ?>
</body>
</html>


JonM 08-13-2005 10:54 PM

try putting your form code into the if else statement...

General Nuisance 08-13-2005 11:25 PM

Quote:

Originally posted by -Elite-
try putting your form code into the if else statement...
that worked :) thanks allot..

E,FuDD 08-17-2005 12:57 AM

tried it now, it looks a1


All times are GMT -5. The time now is 08:04 AM.

Powered by vBulletin®