Archive for the Category »de photos «
04
Sep, 2010
Dealing with stepmothers can be a difficult situation. A lot depends on how the stepmother and biological mother get along. If the two mothers get along than the wedding can be planned however the couple wants. However, this is a rare thing. If there is some problem, the guidelines that follow can assist the stepmother in following correct etiquette for the wedding of her stepchild.
Begin by thinking about what the stepmother should wear. Usually, the stepmother should dress in the same way as other guests. The bride may want to include her stepmother in the preparations so it is proper wedding etiquette for her stepmother to wear similar styles and colors as the other mothers. However, it would not be proper for her to dress in a manner that will overshadow the bride or the biological mother.
The next question is, according to proper etiquette, where should the stepmother sit? The bride chooses this but usually the stepmother is seated behind the birth parents, about the third row back. Of course it will be awkward to have divorced or separated spouses sit on the same row but the wedding is not about who is the current wife of her father but rather a family oriented event. Stepmothers do not need to feel badly about their placement in the wedding because wedding etiquette has the birth mother sitting without her current husband if she has remarried.
There may be an etiquette problem when it comes to family photos. The majority of photographers will arrange different shots for the birth parents and stepparents. You will not usually see stepparents and birth parents in the same photo. If this does happen however, the mothers should be put on opposite ends of the picture. It is not strange for a stepmother to not be seen in any official wedding photos so do not take this personally if this occurs. It falls in the range of proper wedding etiquette for stepmothers.
During the reception, etiquette again requires that the stepmother take a back seat unless she and her husband are the hosts of the reception. If the birth mother hosted the wedding and the father hosts the reception, it is proper for the step mother to take a place in the receiving line if the mother is not present. However, if the birth mother is throwing the reception as well, it is best that the stepmother not attend. Remember that all of these little points are only a guideline so they can be changed and adjusted as long as it is best suited for the bride.
Lastly, what about the family dance? What does wedding etiquette say about this? Proper etiquette has the stepmother bowing out gracefully and allows the bride to share this day with her biological parents. The bride’s father would dance with her and the groom’s birth mother would dance with him. Sometimes if a family dance is provided, stepparents can dance with their own mates.
These stepmother etiquette hints will hopefully allow the stepmother to deal with wedding plans without making mistakes that could hurt or embarrass their stepchild.
Category: de photos
Leave a Comment
04
Sep, 2010
Self-Taught PHP/MYSQL: a simple Page Counter
This article is a short introduction to PHP and MySQL using the example of a simple page counter. I will illustrate creating the database in MySQL, connecting to the database from the PHP script, querying the database for information, displaying the information in a web page, and writing the information back to the database. As always, the fastest way to master the process is to jump right in with the code, look it over and use it. We’ll make a MySQL database to store the page names and the number of page views, and use PHP to increment and display the count on a web page. First here is all of the code, and then I’ll go over it in detail:
This goes into a file called “pagecounter.php”
You’ll no doubt have noticed that the script “includes” another, so without further delay here is the “connect.php” file:
The pagecounter.php script needs a database to operate on. Just briefly, here’s how to create it.
Creating the database:
Log in to MySQL at your Unix prompt (which might be #):
# mysql –uYourUserName –pYourPassword
At the MySQL prompt enter these commands:
mysql> create database pages;
mysql> use pages;
mysql> create table counter (pagename varchar(60),hits int, stamp timestamp);
mysql> quit;
Naturally you can create the database and table with utilities or web-based interfaces, but doesn’t it seem simpler to just enter three commands?
If you just wanted some code for a simple counter, this is all you need. Put this text into an SHTML web page, or this text into a php web page, copy the above two files into the same directory, and you’re done.
The first thing you’ll have noticed about the scripts are the dollar signs ($). All variables in PHP scripts start with a $. Anything starting with a $ is a variable. Instructions – statements and functions – end with a semicolon (;). starts the script and it ends with . When your script is hosed, look at these first.
Details about the pagecounter.php script
Line 1
include_once “connect.php”;
The first line in the script is just what it appears to be. It includes whatever is in the file “connect.php”. The “_once” means that it’s only included once, even if you had the line twice in the script. The reason I’ve separated it out is that it’s all the connection stuff to the database. All the php/Mysql scripts will need it, it’s always the same, so you can just put it by itself and use the include function.
Line 2
$pagename=$_SERVER["REQUEST_URI"];
The next line creates a variable called $pagename and sets the value to a special pre-defined variable $_SERVER["REQUEST_URI"]. The brackets [ ] are used by arrays in php. $_SERVER is a pre-defined array of headers and paths. This particular one is the name of the file that accesses the script, i.e., the name of the page that the counter is in.
Line 3
$result=mysql_query(“Select * from counter where pagename=’$pagename’”);
All the database work is done with mysql_query, which sends an SQL command string to MySQL, after you’ve already logged in and connected to the database with the connect.php script. “Select * from counter where pagename=’$pagename’” replaces $pagename with its value. But there’s a quirk here – the single quotes have to be inside the double quotes. If I had it the other way around, with the single quotes outside, the query would be for the text “$pagename” instead of the value. $result is the result set. It can be any name but in tutorial scripts it’s always $result, so it is here.
Line 4
if (mysql_num_rows($result)==0){
The fourth line is the php version of “if-then”. It simply checks whether there are any results from the query in line 3. The syntax is representative of php coding in general so it’s a good place to start. The curly brackets { } are used to group instructions. The curved brackets ( ) are used for the “if” condition. Everything inside the curly brackets will be executed if the “if” condition is true. PHP uses double equals == for comparison; if I had used only a single equal sign it would try to set mysql_num_rows to 0, which wouldn’t work for our purposes. A missing equal sign is the second thing to look for when your script is hosed and it’s not missing a $ or ;.
Line 5
mysql_query(“insert into counter (pagename,hits) values (‘$pagename’,'0′)”); }
Inside the brackets, which only happens when line 4 finds no records of the page we searched for, the instruction creates a new record with the page’s name and zero for the hit count. Although mysql_query is a function, it doesn’t necessarily need a variable $result= in front of it. That’s optional in PHP if you don’t care about the return value.
The closing curly bracket } from the “if” statement comes here, since we only needed one statement to create our record.
Line 6
$count=mysql_result($result, 0, “hits”);
mysql_result fetches the actual data from the result set. You specify the result set (from mysql_query), the row number (0), and the column name (“hits”). This is a little confusing at first since to get here took four steps: 1) log into MySQL, 2) connect to the database, 3) select data from the table, and 4) fetch a particular piece of the data. Putting the repetitive first two steps into an include file where you can more or less forget about them makes it more intuitive: use SQL to select data with mysql_query, and then retrieve data with mysql_result.
Line 7
$count=$count + 1;
Just adds one to the count variable. This is the count of the page views of the page requesting the script.
Line 8
mysql_query (“update counter set hits=$count where pagename=’$pagename’”);
As with Line 5 we send an SQL command directly to MySQL. This one updates the count for just the page matching the variable $pagename.
Line 9
echo “Page Count: “.$count;
The echo function writes text to a web page, in this case the text “Page Count: “ followed by whatever value is in $count. The period in between is the PHP concatenation operator: it simply adds the two strings together. Echo sees it as one string and outputs it.
Details about the connect.php script:
All this script does is connect to the MySQL server and select the Database.
Line 1
$host=”localhost”;$user=”YourUserName”;$password=”YourPassword”;$dbase=”pages”;
These are the inputs for the connect and select_db functions. Naturally you can insert the values into the functions on line 3 and 4 and eliminate this line, but it’s simpler to change later (when you re-use this code for example) if you just list them out at the top. The host and dbase won’t need to be changed in this example. The user and password are specific to your MySQL setup. As shown here you can put as many statements on one line as you want; PHP doesn’t care.
Line 2
// change the user and password to your MySQL user and password
The double slashes // denote a comment line that is ignored by php. Each comment line needs the slashes.
Line 3
$connect = mysql_connect($host,$user,$password);
You log into your MySQL with the mysql_connect command. You would change the host from “localhost” to the database server if you were accessing MySQL from another server, provided you’ve set up the access rights for the specified user/
Line 4
mysql_select_db($dbase,$connect);
Since we can have multiple databases in the MySQL server, we have to select one before sending SQL statements to it. As I mentioned earlier, this part is repetitive, and once it’s in this file and working you can forget about it.
In this tutorial we’ve examined a simple b
ut functional web page counter implemented with PHP/MySQL. We examined the basic syntax of PHP statements and variables, the PHP “include” function and “if” control function, and the fundamental PHP MySQL functions mysql_connect, mysql_select_db, mysql_query, mysql_num_rows, and mysql_result. For further reference the reader should bookmark http://dev.mysql.com/doc/refman/6.0/en/index.html and http://us.php.net/manual/en/funcref.php .
Bill Hamilton is a former Database Administrator for United News and Media, and VNU inc. He currently operates several php/mysql driven websites including Gemstones and Beads
Category: de photos
Leave a Comment
30
Jul, 2010
dans ces derniers temps, la plupart des organisations ont leurs propres sites Web business. Ces sites sont principalement conçus afin de répondre aux besoins des clients passionnants ainsi à promouvoir les produits d’entreprise aux clients potentiels. Cependant, seulement en possession d’un site Web vous ne prévoyez pas une bonne quantité de profit. Vous avez besoin maintenir ce site et assurez-vous toujours que vous mettez à jour le contenu et la conception de votre site Web sur une base régulière. Dans le cas contraire, personnes trouveront votre site Web pour être une obsolète et sera immédiatement cliquez hors de celle-ci. Par conséquent, il est toujours préférable d’affecter les concepteurs web professionnel pour votre projet de conception de site.
Qualité d’un site Web est jugée non seulement sur la base de sa bonne conception, c’est aussi dépendant de son contenu, optimisation du moteur de recherche et plusieurs autres facteurs. S’il est assez difficile pour une personne de s’occuper de tous ces facteurs, en suivant certains conseils qu’il peut certainement espérer développer un site beaucoup mieux. Certains des points qui doivent se rappeler pour le développement web sont les suivants: * ne jamais oublier que l’efficacité de n’importe quel site Web repose sur la taille de police, taille du texte, jeu de couleurs et dernier mais pas moins sur le système de navigation. Donc, toujours faire très attention à tous les collaborateurs.
* Par ailleurs, vous devez également prendre soin de temps de téléchargement de votre site. Ne jamais incorporer trop graphiques, bannières, flash annonces et des images. C’est parce que ; ces choses que seule la page lourd et il faut des charges de temps à ont été téléchargés. Dans la plupart du temps qu’il est considéré que les visiteurs préfèrent cliquez hors du site, qui prend trop de temps aux fins de téléchargement. Ainsi, utiliser toutes ces choses de manière contrôlée et tenter de gagner du temps de vos visiteurs.
* Make certain que la mise en page de votre site Web est organisée et pratique. Généralement une société de développement de site Web bien utiliser plusieurs techniques pour le développement d’une conception de site Web efficace. Ces méthodologies parmi rapide développement, programmation intense, le modèle de contrôleur et processus unifiés.
Par conséquent, suivez les conseils mentionnés ci-dessus et utiliser l’une de ces méthodologies pour donner un coup de pouce à votre entreprise en ligne.
Category: de photos
Leave a Comment
