Jump to content

Archived

This topic is now archived and is closed to further replies.

web designer

A simple example of php/mysql webpage using dreamweaver

Recommended Posts

[color=brown][size=11pt]Hi..  :)

I really liked this forum.. it's all about PHP  8)

can anyone from the nice people write a simple webpage that includes a clickable map, random photographs browser and a small database with one query..

I need to understand the connection between all of these.. then discuss that with you people  :D

I need to see the code and the result page.. after that I can easily connect ideas in my mind  :-\

I have a good knowledge of HTML CSS .. .. .. etc..  ;)

but ! .. it's my first time to use the dynamic programing ( php with mysql )  ???

I usually use dreamweaver..  it's lovely ::)

I appreciate your kindness in helping me..

thanks,

Sara[/size][/color]

Share this post


Link to post
Share on other sites
Hey Sara,

There are tons of tutorials online to show you how to make a simple database website. All you need to know is how to connect to the database and output some text.

There are also lots of "random" tutorials and scripts out there as well as image manipulation.

try: http://www.wsworkshop.com/php/php-mysql-weblog.html or just typing in php mysql tutorials in google or something. If you are looking for some pre-made scripts there are some on this site and on www.hotscripts.com sometimes it's easier to learn when you have something in front of you that works.

you will also have to set up a testing server for dreamweaver if you haven't already here is a good site: http://apachemysqlphp.com/

hope this helped you out a little  ;D

Share this post


Link to post
Share on other sites
[size=11pt][color=brown]
Thank you very much Chris.. That was helpful..  :D

I'll try my best.. and if I have any questions, I'll get back to this lovely forum..  ;D

---------------------------

if anyone have any more detials/information wants to add.. please do so..  :)

---------------------------

Thanks again,

Sara[/color][/size]

Share this post


Link to post
Share on other sites
Sara,
If you have any questions about anything feel free to PM me.

-Chris

Share this post


Link to post
Share on other sites
[size=11pt][color=brown]
Thanks Chris.. I appreciate that..  :)

I hope you are not going to be tired from the huge number of questions.. lol  ;D just  8) kidding :D

Ooops :o, here is the first problem ! ..  :-[

assuming that I have no server.. no domain.. just trying to test the php files using dreamweaver..

what should I fill these empty boxes  ::) ! in the picture below.. !?  :-\

[/color][/size]

[attachment deleted by admin]

Share this post


Link to post
Share on other sites
First you should set up your computer so that it has a static ip address. once you have that you can type that ip address into the first text field. type "localhost" for the second, and your e-mail address into the last one...your e-mail address doesn't really matter too much if it just on your pc

Share this post


Link to post
Share on other sites
[size=11pt][color=brown]
O.oh  :o ... Static ip address !!!  :-\

can you please provide for me  :) .. some steps I should follow to get the static ip address set on my PC  ??? !!


please  ;D ,

Sara[/color][/size]

Share this post


Link to post
Share on other sites
Are you behind a router, or are you just directly connected to a modem?

Share this post


Link to post
Share on other sites
Hello Sara,
I am new to this also and have received wonderful help from this forum. If you look at my post (it is long), many of your qestions may be answered. Look at the, "Newbie - for real! Just getting started!" posting.

I just today got to the point where I can see my .php pages on my computer. Editing them is another story however, I am sure I will get help with that also.

Ummzee

Share this post


Link to post
Share on other sites
[quote author=cmgmyr link=topic=99676.msg393135#msg393135 date=1152285657]
Are you behind a router, or are you just directly connected to a modem?
[/quote]

[size=11pt][color=brown]hmmm  ::) it's Modem.. wireless !  :-X :)

---------------------------------------------------------------

Thanks Ummzee.. I'll look at your post, too.[/color][/size]

Share this post


Link to post
Share on other sites
If you want to test on your computer without having to be connected to the internet, you can install WAMP which will put PHP, Apache, MySQL, and PHPmyAdmin, and SQLite on your computer. Then, when you try to preview in browser your PHP code something will pop up and say "The page you are looking at contains server side code, would you like to select..." and then you say yes and fill out the form with the information.

Share this post


Link to post
Share on other sites
[color=brown]
Everything is fine..  ;D with connecting to the servers throw my computer..

_____________________________________________________________________

but I got another problem !..

I have two files.. form.php  -  query.php

[b]form.php[/b]
[/color]
[code]
<form action="http://localhost/queries/query.php" method="post" name="form">

Searching for players which play these games...
<br />
<br />
<input name="football" type="checkbox" value="x">Football
<br />
<input name="basketball" type="checkbox" value="x">Basketball
<br />
<br />
<input name="reset" type="reset" value="Reset"/>
<input name="submit" type="submit" value="Submit"/>

</form>
[/code]
[color=brown]
[b]query.php[/b]
[/color]
[code]
<?php
$page=$_GET["page"];
if(!isset($page))
{
$page=1;
$pageNo = $page +1;
}

$pageNo = $page;
echo "Page Number:&nbsp<b>$pageNo</b>";

$page=$page-1;

//connecting to my database.. and for sure it's working..(hidden for now)
//....
//....
//....

$football = $_POST['football'];
$basketball = $_POST['basketball'];

$preQuery="select * from Macrofossiles where (football = '$football') || (basketball= '$basketball')";
$preResult=mysql_query($preQuery,$server) or die("Could not execute preQuery...");
$numRows=mysql_num_rows($preResult);
$numPages=$numRows/1;

$query = "select * from Macrofossiles where (football = '$football') || (basketball= '$basketball') limit $page, 1";
$result = mysql_query($query,$server) or die("Could not execute query...");

while($row = mysql_fetch_array($result))
{
    echo
'<table bordercolor="#CC7722" align="center">' .
"<tr><td>Player Number:</td><td>{$row['Player_No']}</td></tr>" .
"<tr><td>Hockey:</td><td>{$row['Hockey']}</td></tr>" .
"<tr><td>Volleyball:</td><td>{$row['volleyball']}</td></tr>" .
"<tr><td>Tennis:</td><td>{$row['tennis']}</td></tr>" .
"<tr><td>Football:</td><td>{$row['football']}</td></tr>" .
       "<tr><td>Basketball:</td><td>{$row['Basketball']}</td></tr>" .
"</table>";
}    
   echo "<b>Page:</b>&nbsp;&nbsp";
   
   $num=1;    
   for($i=1;$i<$numPages;$i++)
   {
if($num==$pageNo)
{
$font="<b>";
$unfont="</b>";
}
else
{
$font="";
$unfont="";
}
    echo "<a href='query.php?page=$num'>$font $num $unfont</a>&nbsp";
    $num = $num + 1;
  }

mysql_close($server);
?>
[/code]
[color=brown]
[b]Database:[/b]

|  Player_No  |  Hockey  |  Volleyball  |  Tennis  |  Football  |  basketball  |
|       1        |       x      |       x       |             |      x       |                 |
|       2        |              |       x       |      x      |              |        x        |
|       3        |       x      |               |      x      |      x       |                 |
|       4        |              |       x       |      x      |              |        x        |
|       5        |       x      |       x       |             |      x       |        x        |
|       6        |       x      |       x       |             |      x       |                 |
|       7        |              |       x       |      x      |              |        x        |
|       8        |       x      |               |      x      |      x       |                 |
|       9        |              |       x       |      x      |              |        x        |
. . . etc

I hope someone can help..

Oops.. I didn't tell you guys what is the problem I'm sufferring from in these codes..

here is it..

when I check the two checkboxes... and click submit..

the query.php open and everything seems okey.. the results are perfect.. and exact..

but !! .. when I click number 2 or 3 or any number after the first click, everything is changed !! ..

it geves me the result of this query
"select * from Macrofossiles where (football = '') || (basketball= '')"

I mean it gives me the result when football is empty and basketball is empty..

that means this query-->"select * from Macrofossiles" all the resutls will show up ..  :(


any help !  ::)  :D[/color]

Share this post


Link to post
Share on other sites
[color=brown]
guys.. no one answer me  :( ...


I think what I need is a session..

but how can I implement it to my code..

what should I write.. and where in my code ??  ::)[/color]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.