Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 12-20-2007, 07:31 PM Help please...
Colin's Avatar
Average Talker

Posts: 27
Name: Colin Smiley
Trades: 0
Hey...I am working on a website that I can add links to proxy's to and that otehr people can submit, I saw a script that does just this and it costs :P I don't need alot of features but basicly right now I have a form to flat file / emailer (to notify me) If a user submits one but I have one problem...here is my code:
PHP Code:
<?php
$url 
$_GET["proxysite"];
$name $_GET["name"];

print(
"<b>Thank You!</b><br />Your information has been added! You can see it by <a href=savedinfo.php>Clicking Here</a>");
$out fopen("proxies.php""a");
if (!
$out) {
print(
"Could not append to file");
exit;
}
fputs ($out,implode,("\n"));
fwrite($out,"<a href="$url">Test</a><br />");
fclose($out);
$msg $url;
$from $from "From: submitted@colinsmiley.net";
mail("proxies@colinsmiley.net""Proxy Submission""$url");
?>
The error I get:
Code:
Parse error:  syntax error, unexpected T_VARIABLE in C:\wamp\www\proxylist\submit2.php on line 15
I know the problem with the code is here:
PHP Code:
fwrite($out,"<a href="$url">Test</a><br />"); 
But I don't know how to fix it, Please help me...thanks
Colin is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-20-2007, 09:31 PM Re: Help please...
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
When you move in and out of a string, you need to append each part with a dot . or escape quotes so it won't confuse the parser.

Either:
PHP Code:
fwrite($out,"<a href='" $url "'>Test</a><br />"); 
Or:
PHP Code:
fwrite($out,"<a href=\"$url\">Test</a><br />"); 
will work
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 04:32 AM Re: Help please...
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
As above about quotes but your error is this

PHP Code:
$from $from "From: submitted@colinsmiley.net";

// should be 

$from ="From: submitted@colinsmiley.net"

Last edited by maxxximus; 12-21-2007 at 04:34 AM..
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 06:53 PM Re: Help please...
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Quote:
Originally Posted by maxxximus View Post
As above about quotes but your error is this

PHP Code:
$from $from "From: submitted@colinsmiley.net";

// should be 

$from ="From: submitted@colinsmiley.net"
I don't think this an error. I believe that is perfectly allowed. If you want to assign a value to two variables you can write
PHP Code:
$a $b "value"
In this case $a and $b happens to be the same variable. It basically mean
PHP Code:
$from "From: ...";
$from $from
It's absolutely unnessesary, but not an error. The error in the script is the one pointed out by mgraphic.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Help please...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14177 seconds with 12 queries