Image Scrolling using PHP

Reply

Join Date: Jun 2008
Posts: 3
Reputation: binukjames is an unknown quantity at this point 
Solved Threads: 0
binukjames's Avatar
binukjames binukjames is offline Offline
Newbie Poster

Image Scrolling using PHP

 
0
  #1
Jun 30th, 2008
I'm developing a WAP site using wml and PHP.
i want to display some images from database (mysql).
The problem is , how can i display more than one image in a single wml page ?
Is it possible to implement "Image Scrolling " using PHP ?
please help me .....
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,082
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Image Scrolling using PHP

 
0
  #2
Jul 1st, 2008
Originally Posted by binukjames View Post
I'm developing a WAP site using wml and PHP.
i want to display some images from database (mysql).
The problem is , how can i display more than one image in a single wml page ?
Is it possible to implement "Image Scrolling " using PHP ?
please help me .....

You can't implement image scrolling with PHP. The scrolling of the images would have to be invoked on the HTTP client, which in this case is the WAP enabled phone. The only way to do this is to have a script execute on the client, hence the use of JavaScript or VBScript for IE etc. I don't think a WAP phone would support JavaScript, but if it does, thats how you'd do it - not PHP.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 3
Reputation: binukjames is an unknown quantity at this point 
Solved Threads: 0
binukjames's Avatar
binukjames binukjames is offline Offline
Newbie Poster

Re: Image Scrolling using PHP

 
0
  #3
Jul 2nd, 2008
Index.php
=========

<?php

header('Content-type:text/vnd.wap.wml');

echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" \"http://www.wapforum.org/DTD/wml13.dtd\" >";

?>

<wml>

<card id="homepage" title="Mobile Coupons">

<p align="center">

<img src="show_image.php?id=1" width="34" height="37"/>

<anchor>Next

<go href="#image"/>

</anchor>

</p>

</card>

<card id="image" title="Mobile Coupons">

<p align="center">

<img src="show_image.php?id=2" width="78" height="84"/>

<anchor>

Back

<prev/>

</anchor>

</p>

</card>

</wml>



show_image.php
===============



<?php

function db_connect($user='root', $password='admin', $db='Mobile')

{

mysql_connect('localhost', $user, $password) or die('I cannot connect to db: ' . mysql_error());

mysql_select_db('Mobile);

}

db_connect();



$id = $_GET['id'];



$sql = "select Image1 from WAPdata where CId = '{$id}'";

$result = mysql_query("$sql");

while($row = mysql_fetch_assoc($result))

{

$bytes = $row['Image1'];

}

header("Content-type: image/jpeg");

echo $bytes;

exit ();

mysql_close();

?>
===============================================
This is my sample code that im trying....
here im loading 2 images by passing ids (id=1 , id =2 )
there r lot of images in the database. so this way is not possible.
can anybody tell me how to generalise it...?
if i click "next", the id should increment by one... like that .......
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC