Solved

graffiti wall php help

Posted on 2004-04-26
7
464 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Doing something wrong with this PDO Select Statement... 3 18
parse url to form? 7 25
MVC - procedural PHP 10 35
How do I show metrics with PHP or Javascript 6 32
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

856 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