Jump to content


Photo

A simple example of php/mysql webpage using dreamweaver


  • Please log in to reply
13 replies to this topic

#1 web designer

web designer
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 06 July 2006 - 04:30 PM

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


#2 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 06 July 2006 - 05:37 PM

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.wsworksho...sql-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

#3 web designer

web designer
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 06 July 2006 - 06:51 PM


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


#4 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 06 July 2006 - 07:23 PM

Sara,
If you have any questions about anything feel free to PM me.

-Chris

#5 web designer

web designer
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 07 July 2006 - 01:50 AM


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.. !?  :-\



[attachment deleted by admin]

#6 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 07 July 2006 - 02:37 AM

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

#7 web designer

web designer
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 07 July 2006 - 03:18 PM


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


#8 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 07 July 2006 - 03:20 PM

Are you behind a router, or are you just directly connected to a modem?

#9 ummzee

ummzee
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 07 July 2006 - 03:56 PM

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

#10 web designer

web designer
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 07 July 2006 - 04:27 PM

Are you behind a router, or are you just directly connected to a modem?


hmmm  ::) it's Modem.. wireless !  :-X :)

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

Thanks Ummzee.. I'll look at your post, too.


#11 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 13 July 2006 - 03:17 PM

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.

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#12 web designer

web designer
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 26 July 2006 - 03:26 PM


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

form.php

	<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>

query.php

<?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); 
?>

Database:

|  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


#13 devvie

devvie
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 28 July 2006 - 07:13 PM

can go here no-ip.com to get your static ip for free

#14 web designer

web designer
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 01 August 2006 - 03:59 PM


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 ??  ::)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users