Solved

graffiti wall php help

Posted on 2004-04-26
7
472 Views
Last Modified: 2012-06-23
Hello I want to make a php script for my company where I have
a wall - and people can come and post graffiti on that wall [with whatever
font and color they want] [sensor away foul language] they can overlap
each other.. but after like  50 people's post's it starts deleting the
first one made.. so there are never too many.
0
Comment
Question by:KraLord
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 

Expert Comment

by:jonmullen
ID: 10929191
Honestly you are better off using flash for this, and just php to access the database for the comments, or perhabs for just 50 entries just use a flat file.
0
 

Author Comment

by:KraLord
ID: 10932421
Yes, thats true jonmullen, but do you know like what to  put in the code for the flash frames or some examples
0
 

Author Comment

by:KraLord
ID: 10983169
ok dont cry
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 1

Expert Comment

by:Random_Pete
ID: 11004604
And if you want your question to remain unanswered then insulting the moderators is a great idea ...
0
 

Author Comment

by:KraLord
ID: 11009008
who is insulting in here?
0
 
LVL 1

Accepted Solution

by:
Random_Pete earned 500 total points
ID: 11057530
Well ... you said "ok dont cry" which sounds ... well ... insulting.

As for your question, you need to do the following. You need a "submit.php" page. It would look like this:

<PHP
if (isset($_POST["graffiti_submit"])) {
  $newrow = array(
     "name"=>$_POST["graffiti_name"],
     "email"=>$_POST["graffiti_email"],
     "message"=>$_POST["graffiti_message"],
     "color"=>$_POST["graffiti_color"],
     "size"=>$_POST["graffiti_size"],
     "x"=>$_POST["graffiti_x"],
     "y"=>$_POST["graffiti_y"]);
  /*insert here a line of code to store $newrow in a database or text file*/
}
?>
<HTML><HEAD><BODY>
<FORM METHOD="POST" ACTION="submit.php">
Type your name: <INPUT TYPE="text" NAME="graffiti_name"><BR>
Type your email address: <INPUT TYPE="text" NAME="graffiti_email"><BR>
Type your message: <INPUT TYPE="text" NAME="graffiti_message"><BR>

...and so on for the rest of the parameters - then ...

Click to submit: <INPUT TYPE="button" NAME="graffiti_submit">
</BODY></HEAD></HTML>

Now you also need the main page to display all the graffiti. It will begin by reading all the data back in from the textfile or database, into a variable called $data. How you do this will depend on how you store the data, and should probably be asked as a separate question because it's a big topic on its own. Once you have read the $data your php script will need to do this :

foreach ($data as $graffiti) {
  print "<DIV style=\"position:absolute; top:".$graffiti["y"]."px; left: ".$graffiti["x"]
   ."px; font-color: ".$graffiti["color"]."; font-size: ".$graffiti["size"]."\">".$graffiti["message"]
   ."</DIV>\n";
}

There ya go, dead simple.

0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question