mizako
Members-
Content Count
373 -
Joined
-
Last visited
Everything posted by mizako
-
Hi, I created months ago a guestbook PHP/MySQL script. It ist simple but i think that it is beauty also because of that. I use also Javascript to validate contributions. The SQL query to create the table: CREATE TABLE `guestbook` (`id` int(5) NOT NULL auto_increment,`name` text NOT NULL,`email` varchar(30) NOT NULL default '',`content` text NOT NULL,PRIMARY KEY (`id`)) This is the primary file PHP file of the guestbook: <?php echo '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"no\"'.'?>'; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://forums.xisto.com/no_longer_exists/; <head> <title>GuestBook</title> <link rel="stylesheet" type="text/css" href="./guestbook.css"/> <script type="text/javascript"> <!-- function open_new_window_new(url) { new_window = window.open(url,'window_name','toolbar=0,menubar=0,resizable=0,dependent=0,status=0,width=495,height=400,left=25,top=25') } --> </script></head><body> <h1><a href="../index.html">Home</a> Guestbook</h1> <div><a href="javascript:open_new_window_new('./form_new.html');"><img src="edit.gif" width="18" height="13" alt="write"/>Write a message.</a></div> <hr class="separator"></hr> <?php $sql_db = "dabase_name"; $sql_user = "mysql_user"; $sql_pass = "mysql_pwd"; $sql_table = "guestbook"; if(isset($pos)==0) $pos=0; // start position for the page indexer $count=3; // number of displayed items per page mysql_connect("localhost", $sql_user, $sql_pass); mysql_select_db($sql_db); $result = mysql_query("select MAX(id) from ".$sql_table.";"); $data = mysql_fetch_assoc($result); $size = $data['MAX(id)']; $result = mysql_query("SELECT * FROM ".$sql_table." where id<=".($size-$pos)." order by id desc;"); if($result) { $i=0; while(($data = mysql_fetch_assoc($result)) && ($i < $count)) { ?> <?php print "<div>"."\n"; print "<div><strong>Name</strong>: ". $data['name']."</div>\n"; if(isset($data['email'])) { print "<div><strong>Email</strong>: <a href=\"mailto:" . $data['email'] . "\">" . $data['email'] . "</a></div>\n"; } print "<div><strong>Comments:</strong> <div>".$data['content']."</div></div>\n"; print "</div>"."\n"; ?> <hr></hr> <?php $i++; } } mysql_close(); print "<div class=\"center\">Pages: "; for($j=0; $j<$size; $j++) if(!($j % $count)) print "<a href=\"book.php?pos=".$j."\">".(($j/$count)+1)."</a>\n"; print " - Total number of entries: ".$size." - Ir: \n"; if ($pos > 0) print "<a href=\"book.php?pos=".($pos-$count)."\">Back</a>\n"; if($size > $pos+$count) print "<a href=\"book.php?pos=".($pos+$count)."\">Next</a>\n"; ?> </div></body></html>Here it is the form_new.html code that it is called when the "write message" link is pressed: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://forums.xisto.com/no_longer_exists/;<head> <title>New</title> <link rel="stylesheet" type="text/css" href="./form.css"/> <script type="text/javascript"> <!-- function chkreply() { if(document.formular.name.value == "") { alert("Please enter a name!"); document.formular.name.focus(); return false; } if(document.formular.content.value == "") { alert("The content field is empty!"); document.formular.content.focus(); return false; } var chkZ = 1; for(i=0;i<document.formular.name.value.length;++i) if(document.formular.name.value.charAt(i) > "0" && document.formular.name.value.charAt(i) < "9") chkZ = -1; if(chkZ == -1) { alert("Numbers are not admited in the name field"); document.formular.name.focus(); return false; } if((document.formular.name.value.indexOf('@') != -1) || (document.formular.name.value.indexOf('>') != -1) || (document.formular.name.value.indexOf('<') != -1) || (document.formular.name.value.indexOf('.') != -1) || (document.formular.name.value.indexOf(':') != -1) || (document.formular.name.value.indexOf(';') != -1) || (document.formular.name.value.indexOf('/') != -1) || (document.formular.name.value.indexOf('\\') != -1)) { alert("The simbols (@ > < .; : /) are not allowed in the name field"); document.formular.name.focus(); return false; } if((document.formular.email.value.indexOf('>') != -1) || (document.formular.email.value.indexOf('<') != -1) || (document.formular.email.value.indexOf('/') != -1) || (document.formular.email.value.indexOf('\\') != -1)) { alert("The simbols (> < /) are not allowed in the email field"); document.formular.email.focus(); return false; } } //--> </script></head><body> <form name="formular" action="./action_new.php" method="post" onsubmit="return chkreply()"> <div> <table border="0\" cellpadding="3" cellspacing="0"> <tr> <td class="description">Name:</td> <td><input name="name" type="text" class="field" size="30" maxlength="30" /></td> </tr> <tr> <td class="description">*Email: </td> <td><input name="email" type="text" class="field" size="30" maxlength="30" /></td> </tr> <tr> <td class="description" valign="top">Content:</td> <td><textarea name="content" class="Area" rows="10" cols="50"></textarea></td> </tr> <tr> <td></td> <td> <input type="submit" class="Button" value="Submit" /> <input type="reset" class="Button" value="Erase" /> </td> </tr> </table> </div> </form></body></html> Next action_new.php insert the post into the database. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://forums.xisto.com/no_longer_exists/;<head> <title>Data Transfer</title></head><body> <div> <?php $sql_db = "Database_name"; $sql_user = "mysql_user"; $sql_pass = "mysql_pwd"; // We connect to the mysql and select the database $name = $_POST['name']; $email = $_POST['email']; $content = $_POST['content']; $link = mysql_connect("localhost",$sql_user,$sql_pass) or die("Could not connect<br/>"); mysql_select_db($sql_db) or die("Could not select database<br/>"); mysql_query("INSERT INTO guestbook VALUES (0, '$name', '$email', '$content')"); mysql_close(); ?> </div> Thanks for your contribution <a href="javascript:window.close()">close</a></body></html>[CODE]And to finish both CSS files:[CODE]body{ background: #2E466E; text-align : justify; font-size : 10pt; font-family : verdana, arial, helvetica, sans-serif; color : #DDDDDD; margin-right: 20%;}h1{ font-size : 18pt; font-family : verdana, arial, helvetica, sans-serif; text-align : center;}a:visited { background: #2E466E; text-decoration : none; color :#FFA500;}a:link { background: #2E466E; text-decoration : none; color :#FFA500;}a:hover { background: #2E466E; color :#FFA500; text-decoration : underline; }a:active { background: #2E466E; text-decoration : none; color :#FF8C00;}img{ border: none;}.separator { color: white; border-style: solid;}.center { text-align : center;}.field { width : 80px;}And form.css: form { padding:20px;}td, input, select, textarea { font-size:13px; font-family:Verdana,sans-serif; font-weight:bold;}input, select, textarea { color:#0000CC;}.Area, .field { background-color:#ffffff; width:300px; border:1px solid #003366;}.description { text-align:right;}.Radio { border:1px;}.title_name { font-size:16px; color:#0000CC;} If you want to see it working in the real life: La Ponderosa Guestbook If you have anydoubt do not heasite to ask. You are welcome
-
First of all thanks for your quickly answers guys!I have tried to install JDK in my computer but i have some doubts. I am using linux and what you download is a .bin file. I suppose i have to burn an CD with this image but i need also a .cue file. Right?. I read in internet that i can create an cue file easily in the next way: Create a file with extension cue with the next content:FILE bin_file_name BINARYTRACK 1 MODE1/2352INDEX 1 00:00:00I tried that i burn the file but not success. :-)Any helpful idea?
-
Hi, I am trying to install cocoon framework in my computer http://cocoon.apache.org/. It says i need to have installed previously the Java Development Kit installed on my machine. What is the Java Development Kit? How i install Java in my computer? Help about this questions (i am total newbye with Java) and links pointing information regarding the installation of Java 1.4 are really apreaciated. Thanks in advanced.
-
XML is a language to define another markup languages. Also SGML is a language used to define another markup languages. You have to consider XML and SGML in the same level. However XML is more simple. The specification is about 50 pages agains 250 of SGML and more powerful. HTML is a markup language (there are a lot more) defined from SGML and XHTML is a language defined from XML. XHTML brings to the Web more stability, clean clode and more portable applications. Also it is not difficult to move to XHTML if you are good with HTML. It will take you around an hour to get to know the differences. Also you do not have to learn XML. But not learning XML nowadays is like ignoring the Web 10 years ago. :-)
-
XML is a language to define another markup languages. SGML is a language used to define another markup languages. You have to consider XML and SGML in the same level. However XML is more simple. The specification is about 50 pages agains 250 of SGML and more powerful. HTML is a markup language defined from SGML and XHTML is a language defined from XML. XHTML brings to the Web more stability, clean clode and more portable applications. Also it is not difficult to lear if you are good with HTML. It will take you around an hour to get to know the differences. Also you do not have to learn XML. But not learning XML nowadays is like ignoring the Web 10 years ago. :-)
-
I suppose you want to install PHP/MySQL and Apache? If i am right, the easiest way is to visit: https://www.apachefriends.org/index.html
-
Yeap,Make a tar ball and send it to your collegue!
-
Spanish Fans? SerbiaM - Spain (qual. Germany 2006)
mizako replied to iGuest's topic in General Discussion
I was in small-maracana in Belgrade. I am Spanish. It was fun but the match was not that good. -
With Javascript i preload images with:if (document.images){ folderopen= new Image(16,16); folderopen.src="buttons/node_open.png"; folderclose= new Image(16,16); folderclose.src="buttons/node_close.png"; textimage = new Image(16,16); textimage.src="buttons/text.png"; arrowopen = new Image(16,16); arrowclose = new Image(16,16); arrowopen.src="buttons/arrow_open.png"; arrowclose.src="buttons/arrow_close.png";}Then for example if you want to change the image of an element into your Javascript code you write simply:foldericon=arrowclose.src
-
I have two linux and a XP OS in the same HDD and i have never had any problem.
-
"Blink" does not work in IE6. If you want my opinion i do not think blinking text is cool. :-(
-
Browsers And Css Differences in displaying CSS
mizako replied to theRealSheep's topic in Websites and Web Designing
With a bit of patience a good crossbrowser result can be achieved. I design in the next Way:- First i design for Firefox.- Validate Markup (XHTML code) and CSS with W3C validators.- Test the web-site with IE and Opera. Sure you will find some differences but with a fine adjustment of your CSS file you may achieve your desired effect.Adjust for your potential visitors. IE users are important since there are more!!!.As you can see i do not use browser detection but depending of the proyect importance maybe it is necessary in your case. -
Do you lose the 30 hosting credits when you become package 2?
-
Sorry both links were wrong: Here are some of my sites: Grazasmus La Ponderosa
-
What kind of effects? You mean flash Javascript, Flash aniamtion? I will try your suggestions but i was quite happy with the background colour. It does focus any attention. And that was my intention. I posted these sites sometime ago but since you joined Xisto one month ago maybe you did not see them. Here are some of my sites: Grazasmus La Ponderosa I would be also very happy to hear feeback about those two.
-
Please Review My Home Page. Ive changed it again.
mizako replied to Fun4TheMoney's topic in Websites and Web Designing
In my opinion there are too many colors. The page, it is a bit stressing for me. The blue links in the left do not seem to be part of the layout. Maybe it is a good idea to get rid of them and provide a multitab menu which will fit more in your layout. -
Hi,Currently i am working on a blog for my self using client-side scripting and minimalistic php scripts.
-
It still does not work
-
I am not sure if i understood you well. Do you want to create a list with background-images for each li. Each "li" element contains also text? <li id="home" >home</li><li id="about" >about us</li><li id="links" >links</li> In CSS file: #home { background: url(./images/image.gif) no-repeat;}...... . I hope it helps, Notice from becca: All coding must use a code tag. Thanks
-
Which Server Side Programming Language? Tell us what you like best
mizako replied to andrewsmithy's topic in Programming
You get me wrong. Of course there will be php scripts and server side technologies in the future. And of course the database manipulation would be still done in the server side and in a secure way. What i say is that the php scripts (or any other server side technlogy) will ask for information to the server. The server will send him just plain text (not again html tags) retrieved from a database, a file system or whatever. And all the interface processing will be done in the client side. Do you agree? -
Which Server Side Programming Language? Tell us what you like best
mizako replied to andrewsmithy's topic in Programming
PHP for sure but client-side scripting will be the future since the power of servers and clients it is now almost the same now. It does not make sense to have all the load in a Server and nothing in a client. -
Does anyone knows how can i do smooth movements with fifa2005? In previous versions you could just press "CTRL + a" or another combination and the player did fancy movement. In lasts versions it happens that sometimes the player make incredible controls but i do not know how to order a player to make that movements. I hope you understand what i mean and someone can help to enjoy the game a bit more.
-
The problem is that the concept of Xisto goes against quality forums. Forcing people to post decrease the quality of their contributions.