Solved

graffiti wall php help

Posted on 2004-04-26
7
444 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

757 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

17 Experts available now in Live!

Get 1:1 Help Now