Solved

graffiti wall php help

Posted on 2004-04-26
7
451 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

912 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now