/    Sign up×
Community /Pin to ProfileBookmark

PHP Question Help Needed

ok heres what i want to do.

I want to Have a form where the user puts in a link to an image and they click submit and on the page it shows the image. This does have a purpose for me .

Current Code

image.html

<html>
<body>

<body>
<html>

<body bgcolor=”gray” text=”maroon”>

<form action=”image.php” method=”POST”>
<table cellspacing=”4″ cellpadding=”2″ border=”2″>
<tr>
<tr><td width=”100%”>Image URL:</td><td width=”100%”> <input type=”text” name=”image”/><br></td></tr>

<tr><td width=”100%”><input type=”submit” /></td></tr></table>
</form></body>
</html>

</form>
</html>

[hr]

image.php
</body>

<?
echo
“<html>”
.”<body>”
.”<body bgcolor=’gray’ text=’maroon’>”
.”<title>IGN Image Maker</title>n”
.”<img src=””.$_POST[‘image’].” style=”margin-left: 20px;”>n”

.”</body>”
.”</html>”
?>

[hr]

Im currenty receiving this error

Parse error: parse error, expecting `‘,” or `‘;” in /home/benson1/public_html/nucleus/image.php on line 7

to post a comment
PHP

29 Comments(s)

Copy linkTweet thisAlerts:
@TeachDec 09.2003 — [i]Originally posted by RefreshF5 [/i]

[B]ok heres what i want to do.



I want to Have a form where the user puts in a link to an image and they click submit and on the page it shows the image. This does have a purpose for me .



Current Code





image.html



<html>

<body>



<body>

<html>



<body bgcolor="gray" text="maroon">











<form action="image.php" method="POST">

<table cellspacing="4" cellpadding="2" border="2">

<tr>

<tr><td width="100%">Image URL:</td><td width="100%"> <input type="text" name="image"/><br></td></tr>



<tr><td width="100%"><input type="submit" /></td></tr></table>

</form></body>

</html>



</form>

</html>



[hr]



image.php

</body>



<?

echo

"<html>"

."<body>"

."<body bgcolor='gray' text='maroon'>"

."<title>IGN Image Maker</title>n"

."<img src="".$_POST['image']." style="margin-left: 20px;">n"



."</body>"

."</html>"

?>



[hr]



Im currenty receiving this error



Parse error: parse error, expecting ','' or ';'' in /home/benson1/public_html/nucleus/image.php on line 7 [/B]
[/QUOTE]


Shouldn't that be ."<img src=".$_POST['image']." style="margin-left: 20px;">n"
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — ill try that
Copy linkTweet thisAlerts:
@pyroDec 09.2003 — No, it should actually be:

[code=php]."<img src="".$_POST['image']."" style="margin-left: 20px;">n";[/code]
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — Parse error: parse error in /home/benson1/public_html/nucleus/icontester.php on line 8

<?

echo

"<html>"

."<body>"

."<body bgcolor='gray' text='maroon'>"

."<title>IGN Image Maker</title>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n";

."</body>"

."</html>"

?>


[hr]

the body line [confused] whats wroing wtih that?
Copy linkTweet thisAlerts:
@pyroDec 09.2003 — My bad. I didn't look at how you were doing the echo - you will want to get rid of the ; at the end of line 7:

[code=php]<?php
echo
"<html>"
."<body>"
."<body bgcolor='gray' text='maroon'>"
."<title>IGN Image Maker</title>n"
."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>";
?>[/code]
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — [i]Originally posted by RefreshF5 [/i]

[B]Parse error: parse error in /home/benson1/public_html/nucleus/icontester.php on line 8



<?

echo

"<html>"

."<body>"

."<body bgcolor='gray' text='maroon'>"

."<title>IGN Image Maker</title>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n";

."</body>"

."</html>"

?>





[hr]



the body line [confused] whats wroing wtih that? [/B]
[/QUOTE]

you need to close it....

[code=php]
<?
echo
"<html>"
."<body>"
."<body bgcolor='gray' text='maroon'>"
."<title>IGN Image Maker</title>n"
."<img src="".$_POST['icon']."" style="margin-left: 20px;">n";
."</body>"
."</html>"; // <-- I included a ;.
?>
[/code]

I havent tested it but it should work... If it doesnt sry ?
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — LOL I was just about to add another reply saying to remove that ; from the code... but u got there first ?b
[i]Originally posted by RefreshF5 [/i]

[B]Parse error: parse error in /home/benson1/public_html/nucleus/icontester.php on line 8



<?

echo

"<html>"

."<body>"

."<body bgcolor='gray' text='maroon'>"

."<title>IGN Image Maker</title>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n";

."</body>"

."</html>"

?>





[hr]



the body line [confused] whats wroing wtih that? [/B]
[/QUOTE]
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — <?

echo

"<html>"

."<body>"

."<body bgcolor='gray' text='maroon'>"

."<title>IGN Image Maker</title>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n";

."</body>";

."</html>"; // <-- I included a ;.

?>


^^ current code


http://nucleus.ih0p.com/icontester.html

^^site its hoested at


im still getting the same error on line 8
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — try this:
[code=php]
<?
echo
"<html>"
."<body>"
."<body bgcolor='gray' text='maroon'>"
."<title>IGN Image Maker</title>n"
."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>
[/code]

[i]Originally posted by RefreshF5 [/i]

[B]<?

echo

"<html>"

."<body>"

."<body bgcolor='gray' text='maroon'>"

."<title>IGN Image Maker</title>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n";

."</body>";

."</html>"; // <-- I included a ;.

?>





^^ current code





http://nucleus.ih0p.com/icontester.html



^^site its hoested at





im still getting the same error on line 8 [/B]
[/QUOTE]
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — [i]Originally posted by pyro [/i]

[B]Already said that: http://forums.webdeveloper.com/showthread.php?s=&postid=119630#post119629 [/B][/QUOTE]

I know but he must not of gotten the message :- i dunno.
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — ok now i am trying to advance with the script

[code=php]

<?
echo
"<html>"
<head>
<style>
body {background-repeat: no-repeat;}
</style>
</head>

."<body>"
."<body background='iconthing.gif'>"
."<title>IGN Image Maker</title>n"
<br>
<br>
<br>
<br>

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>
[/code]


no idea why this got an error?
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — More advanced sure easeir to read u bet:
[code=php]
<html>
<head>
<style>
body {background-repeat: no-repeat;}
</style>
</head>
<body>
<body background='iconthing.gif'>
<title>IGN Image Maker</title>
<br>
<br>
<br>
<br>
<img src="<? print "$_POST['icon']"; ?>" style="margin-left: 20px;">
</body>
</html>
[/code]

^ use that. it works!

[i]Originally posted by Kyleva2204 [/i]

[B]I know but he must not of gotten the message :- i dunno. [/B][/QUOTE]
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — Parse error: parse error, expecting T_STRING' or T_VARIABLE' or `T_NUM_STRING' in /home/benson1/public_html/nucleus/icontester.php on line 14


i tried that and got this^^^
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — [i]Originally posted by RefreshF5 [/i]

[B]Parse error: parse error, expecting T_STRING' or T_VARIABLE' or `T_NUM_STRING' in /home/benson1/public_html/nucleus/icontester.php on line 14





i tried that and got this^^^ [/B]
[/QUOTE]

ok i assume u cant use HTML like that on ur server. lemme re-do thiz..
[code=php]
<?php
print "
<html>
<head>
<style>
body {background-repeat: no-repeat;}
</style>
</head>
<body>
<body background='iconthing.gif'>
<title>IGN Image Maker</title>
<br>
<br>
<br>
<br>
<img src="$_POST['icon']" style="margin-left: 20px;">
</body>
</html>
";
?>
[/code]
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — also u may want to try thiz:
[code=php]
<?
echo
"<html>"
."<head>"
."<style>"
."body {background-repeat: no-repeat;} "
."</style>"
."</head>"
."<body>"
."<body background='iconthing.gif'>"
."<title>IGN Image Maker</title>n"
."<br>"
."<br>"
."<br>"
."<br>"
."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>";
?>
[/code]
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — Parse error: parse error, expecting T_STRING' or T_VARIABLE' or `T_NUM_STRING' in /home/benson1/public_html/nucleus/icontester.php on line 16



basically the same error this time cept on line 16. I had the picture posting with my background before. but the bg image kept posting which i didnt want and i wanted 4 spaces before the image was posted.

http://nucleus.ih0p.com/testing123.html

^^that is my desired look
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — [i]Originally posted by RefreshF5 [/i]

[B]Parse error: parse error, expecting T_STRING' or T_VARIABLE' or `T_NUM_STRING' in /home/benson1/public_html/nucleus/icontester.php on line 16







basically the same error this time cept on line 16. I had the picture posting with my background before. but the bg image kept posting which i didnt want and i wanted 4 spaces before the image was posted.



http://nucleus.ih0p.com/testing123.html



^^that is my desired look [/B]
[/QUOTE]

why dont u just include that with the main file :- that way u dont have to overlap the original..?
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — im not sure what you mean that picture abouve was done in photoshop

http://nucleus.ih0p.com/icontester.php

^^thats as far as i can get.

i need the picture down 4 spaces and the bg to not double

[code=php]



<?
echo
"<html>"
."<body>"
."<body background='iconthing.gif'>"
."<title>IGN Image Maker</title>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>

[/code]



^^^thats the script i used for that.
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — could u like send me the full file so I could show u what I mean?
[i]Originally posted by RefreshF5 [/i]

[B]im not sure what you mean that picture abouve was done in photoshop



http://nucleus.ih0p.com/icontester.php



^^thats as far as i can get.



i need the picture down 4 spaces and the bg to not double



[code=php]



<?
echo
"<html>"
."<body>"
."<body background='iconthing.gif'>"
."<title>IGN Image Maker</title>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>

[/code]



^^^thats the script i used for that. [/B][/QUOTE]
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — http://nucleus.ih0p.com/icontester.php


^woot got the image moving down 4 spaces but i cant get the bg to not double ?


[code=php]



<?
echo
"<html>"
."<body>"
."<body background='iconthing.gif'>"
."<title>IGN Image Maker</title>n"
."<br>n"
."<br>n"
."<br>n"
."<br>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>

[/code]


^^ma code
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — here:
[code=php]
<?
echo
"<html>"
."<body>"
."<body style="background: iconthing.gif; background-repeat: no-repeat">"
."<title>IGN Image Maker</title>n"
."<br>n"
."<br>n"
."<br>n"
."<br>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>

[/code]
Copy linkTweet thisAlerts:
@ConorauthorDec 09.2003 — http://nucleus.ih0p.com/icontester.html

that causes the bg to not appear at all
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — Ok, this is a mayjor joke to my mind.. if u catch my drift.. Try this code. if thiz don't do it ILL TRY AGIAN... any who is this an addon for ur board? if so smart addon ? after its done u should publish it.
[i]Originally posted by RefreshF5 [/i]

[B]http://nucleus.ih0p.com/icontester.html



that causes the bg to not appear at all [/B]
[/QUOTE]
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — sry heres the code.
[code=php]
<?
echo
"<html>"
."<body>"
."<body style="background-repeat: no-repeat; background-image: iconthing.gif">"
."<title>IGN Image Maker</title>n"
."<br>n"
."<br>n"
."<br>n"
."<br>n"

."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>
[/code]
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — ok!!! that last code had a bug in it. THIS ONE I KNOW WORKS.. well on my Comp it does... Here.
[code=php]
<?
echo
"<html>"
."<head>"
."<title>IGN Image Maker</title>n"
."</head>"
."<body style="background: url('http://nucleus.ih0p.com/iconthing2.gif'); background-repeat: no-repeat">"
."<br>n"
."<br>n"
."<br>n"
."<br>n"
."<img src="".$_POST['icon']."" style="margin-left: 20px;">n"
."</body>"
."</html>"; // <-- I included a ;.
?>
[/code]
Copy linkTweet thisAlerts:
@pyroDec 09.2003 — No need to be echoing out all that HTML. You guys were on the right path earlier, but gave it up:

[code=php]<html>
<head>
<title>IGN Image Maker</title>
</head>
<body style="background: url('http://nucleus.ih0p.com/iconthing2.gif'); background-repeat: no-repeat">
<br>
<br>
<br>
<br>
<img src="<?PHP echo $_POST['icon']; ?>" style="margin-left: 20px;">
</body>
</html>[/code]
That will be quite a bit closer. Just start using valid HTML and it will be even better.
Copy linkTweet thisAlerts:
@Kyleva2204Dec 09.2003 — I know i tried to do that but it didnt work on his server but it did on mine.
[i]Originally posted by pyro [/i]

[B]No need to be echoing out all that HTML. You guys were on the right path earlier, but gave it up:



[code=php]<html>
<head>
<title>IGN Image Maker</title>
</head>
<body style="background: url('http://nucleus.ih0p.com/iconthing2.gif'); background-repeat: no-repeat">
<br>
<br>
<br>
<br>
<img src="<?PHP echo $_POST['icon']; ?>" style="margin-left: 20px;">
</body>
</html>[/code]
That will be quite a bit closer. Just start using valid HTML and it will be even better. [/B][/QUOTE]
Copy linkTweet thisAlerts:
@pyroDec 09.2003 — No, in your version you had double quotes around it -- they can't be there.
×

Success!

Help @Conor spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...