So far I have this code, but it says "Error at line 16":
<title>Scratch User Panel 1.0</title>
<?php
if(!isset($_POST['submit'])){ ?>
<form action="userpage_creator.php" method="post" name="userpageCreator">
Username: <input type="text" name="username" />
Status: <input type="radio" name="status" value="New Scratcher" />New Scatcher<br />
<input type="radio" name="status" value="Scratcher" />Scratcher<br />
<input type="submit" name = "submit" value = "View Source"/>
</form>
<html>
<head>
<?php
}
if(isset($_POST['submit'])){
<?php echo "
Username:" . $_POST['username'] . "
Account Type:" . $_POST['status'] . "
Status: [img]http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=" . $_POST['username'] . "[/img]
Newest Project: [url=http://blocks.scratchr.org/API.php?action=projects&type=newest&return=link&user=" . $_POST['username']. "][...][/url]
Newest Friend: [url=http://www.blocks.scratchr.org/API.php?action=friends&type=newest&return=link&user=" . $_POST['username']. "][...][/url]"
?>
<?php
}
}
?>Offline
...
<?php
}
if(isset($_POST['submit'])){
<?php echo "
...
^^^^ You put a php tag inside a php tag ¬_¬ Simply get rid of the second <?php
If you got notepad++ you'd notice it yourself because the colouring would look wrong (Hint hint :P )
You could also delete lines 22 and 23 (?> <?php) because there's nothing between them.
Last edited by sparks (2011-09-15 11:18:59)
Offline
Done that but:
Parse error: syntax error, unexpected '<' in /home/a5292800/public_html/userpage_creator.php on line 16
Offline
<title>Scratch User Panel 1.0</title>
<?php
if(!isset($_POST['submit'])){ ?>
<form action="userpage_creator.php" method="post" name="userpageCreator">
Username: <input type="text" name="username" />
Status: <input type="radio" name="status" value="New Scratcher" />New Scatcher<br />
<input type="radio" name="status" value="Scratcher" />Scratcher<br />
<input type="submit" name = "submit" value = "View Source"/>
</form>
<html>
<head>
<?php
}
if(isset($_POST['submit'])){
echo "
Username:" . $_POST['username'] . "
Account Type:" . $_POST['status'] . "
Status: [img]http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=" . $_POST['username'] . "[/img]
Newest Project: [url=http://blocks.scratchr.org/API.php?action=projects&type=newest&return=link&user=" . $_POST['username']. "][...][/url]
Newest Friend: [url=http://www.blocks.scratchr.org/API.php?action=friends&type=newest&return=link&user=" . $_POST['username']. "][...][/url]"
}
}
?>Now it says "Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/a5292800/public_html/userpage_creator.php on line 23
"
You can check here for error updates!: http://plaxon.comyr.com/userpage_creator.php
Offline
You forgot to finish your echo with a ";". The error message tells you what you're looking for. It's found a } when it's not expecting it which either means you have too many of them (Although then you often get the message "unexpected $end". In this case the } was unexpected because it's still waiting for the ;. Since it actually tells you what it's expecting you can easily look around the line number given to spot where a , or ; should have gone.
Offline
I removed the } it told me to remove on line 23, but it still says the error.
Offline
where did you learn reading?
unexpected '}' means the '}' doesn't belong to there.
expecting ',' or ';' means you have to put one of these.... -.-
sorry for being a bit rude, but it really sometimes annoys when you just post an error message and cry for help while you could easily find it out yourself
Last edited by roijac (2011-09-15 16:12:36)
Offline
sparks wrote:
WE, you don't remove the }, you add a ; after the echo command that you missed out (end of line 22)
![]()
Please get notepad++! It makes errors really apparent!
I have notepad++ and it's great! Thanks, that's what I forgot to put the ; at the end
Offline
Good good, once you save a file as .html or .php it should start colour coding
I find it hurts my eyes to look at the while textarea for too long so I tend to use the 'bespin' style under settings > Style Configurator. You might spot a style you like there
Offline
Ok! I don't find it hurting my eyes though. By the way, how do I make a global variable, so that if it changes on one pc online, it changes on all pcs?
Offline
Bye the way, I made the thing now! You can see it here: http://plaxon.comyr.com/userpage_creator.php
I made it to help people make their own forum userpages
(See this post.)
Offline
good going @WindowsExplorer , i want to suggest Aptana Studio 3 over Notepad++ it also helps u by assisting with function calls and stuff much ahead of notepad++ ,, but then aptana is a pure web-development ide.
Offline
sparks wrote:
That site leads to a webhost 404
website wrote:
Website Under Review
You are seeing this page because the system administrator of 000webhost.com is currently checking this website for malicious content. This redirect page will be removed once we finish manually checking all files on this account. Since we check over 100 websites per day, it can take about 2-4 hours to complete. If you are the owner of this website, you will get an email confirmation once it's done. If you are a visitor, please come back later.
www.000webhost.com is the most popular free web hosting provider, and as such, suffers from abusers. Around 5% of users sign up here just to start hacking or phishing websites or causing other problems. So, in order to survive, we must monitor what our users are hosting.
We are sorry for the inconvenience, but checking all content manually is the only way to provide you with the most secure and reliable service. If you find any illegal websites on our network, you can report it here.
Thats what it says to me now
Offline
How do I set a variable to the pc's ip address? I searched it, but none of them worked
Offline
WindowsExplorer wrote:
How do I set a variable to the pc's ip address? I searched it, but none of them worked
![]()
$ip = $_SERVER['REMOTE_ADDR'];
Works for me.
Offline
TheSuccessor wrote:
WindowsExplorer wrote:
How do I set a variable to the pc's ip address? I searched it, but none of them worked
![]()
Code:
$ip = $_SERVER['REMOTE_ADDR'];Works for me.
[offtopic]YOU'RE BACK!!!![/offtopic]
Offline
cskidmsonic wrote:
TheSuccessor wrote:
WindowsExplorer wrote:
How do I set a variable to the pc's ip address? I searched it, but none of them worked
![]()
Code:
$ip = $_SERVER['REMOTE_ADDR'];Works for me.
[offtopic]YOU'RE BACK!!!![/offtopic]
Yep!
Offline
roijac wrote:
where did you learn reading?
unexpected '}' means the '}' doesn't belong to there.
expecting ',' or ';' means you have to put one of these.... -.-
sorry for being a bit rude, but it really sometimes annoys when you just post an error message and cry for help while you could easily fins it out yourself
+1
Offline
roijac wrote:
where did you learn reading?
unexpected '}' means the '}' doesn't belong to there.
expecting ',' or ';' means you have to put one of these.... -.-
sorry for being a bit rude, but it really sometimes annoys when you just post an error message and cry for help while you could easily fins it out yourself
You know, I only started PHP a few days ago, so it doesn't help much to be a bit rude.
Offline
Also, how do I make a text to image thing work. None of the tutorials that I found worked
Offline