nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Simple Image Browser PHP

This is a discussion on Simple Image Browser PHP within the Coding in General forums, part of the Development/Scripting category; hey all, i made this code bymyself and do not know what is wrong:S Code: <?php $i=1; $str=$i; $str .=".JPG"; ...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Linux answers from nixCraft.


Coding in General Discussion on PHP/Perl/Python/Ruby/GNU C or C++. MySQL, PgSQL and (X)HTML or any other programming languages you want.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-06-2009, 03:34 PM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Smile Simple Image Browser PHP

hey all,
i made this code bymyself and do not know what is wrong:S

Code:
<?php
$i=1;
$str=$i;
$str .=".JPG";
Function nextt(&$arg,&$lop)
{
$arg++;
$lop=$arg;
$lop .=".JPG";
}
Function previous(&$arg,&$lop)
{
$arg--;
$lop=$arg;
$lop .=".JPG";
}
print ("<form name=\"hmm\" action=\"index.php\" method=\"POST\">\n");
print ("<input type=\"button\" onclick=\"nextt($i,$str)\" value=\"next\">\n");
print ("<br>\n");
print ("<input type=\"button\" onclick=\"previous($i,$str)\" value=\"previous\">\n");
print ("<img src=\"$str\" WIDTH=\"90\" HEIGHT=\"90\"></img>\n");
print ("</form>");
?>

thanks.
Reply With Quote
  #2 (permalink)  
Old 14-06-2009, 07:18 AM
amitabh's Avatar
Contributors
User
 
Join Date: Jul 2008
Location: New Delhi
OS: FreeBSD
Posts: 99
Thanks: 0
Thanked 4 Times in 3 Posts
Rep Power: 4
amitabh has a spectacular aura about amitabh has a spectacular aura about amitabh has a spectacular aura about
Send a message via MSN to amitabh Send a message via Yahoo to amitabh Send a message via Skype™ to amitabh
Default

Quote:
Originally Posted by eawedat View Post
hey all,
i made this code bymyself and do not know what is wrong:S

Code:
<?php
$i=1;
$str=$i;
$str .=".JPG";
Function nextt(&$arg,&$lop)
{
$arg++;
$lop=$arg;
$lop .=".JPG";
}
Function previous(&$arg,&$lop)
{
$arg--;
$lop=$arg;
$lop .=".JPG";
}
print ("<form name=\"hmm\" action=\"index.php\" method=\"POST\">\n");
print ("<input type=\"button\" onclick=\"nextt($i,$str)\" value=\"next\">\n");
print ("<br>\n");
print ("<input type=\"button\" onclick=\"previous($i,$str)\" value=\"previous\">\n");
print ("<img src=\"$str\" WIDTH=\"90\" HEIGHT=\"90\"></img>\n");
print ("</form>");
?>
thanks.
Are u trying to mix client side scripting(JS) with server side script(php)...?
Reply With Quote
  #3 (permalink)  
Old 14-06-2009, 01:15 PM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Default

i am not sure if u meant about this call
onclick=\"nextt($i,$str)
so it uses JavaScript.

my functions are inside the <?php ?> tags so i think its not a JS
we still have the problem in the call onclick.

u have any idea about using php besides JS using the onclick option??

the important thing to me is to let this script work.
now am not sure if we can use JS with php or not but main thing let this thing work.

do u have fix for this script?
__________________
Be to be and not to pee
Reply With Quote
  #4 (permalink)  
Old 14-06-2009, 04:05 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Javascript only works on client side browser. This is more useful for input validation or calling other server side script without loading page again.


PHP on other hand works on server side. It is useful to store or retrieve the data and much more.


Do you wanna process or do something on server or client? Or tell us the purpose of your code.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 14-06-2009, 09:40 PM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Default

purpose of my code is to do image browser..

a form which has two buttons
1-next
2-previous

an initial directory(Current directory does not need to be mentitioned )
when press next increments the i and view the next image.
when press previous decrement i and view previous image.


<img src= i & ".JPG">

hope u got it.

thanks
__________________
Be to be and not to pee
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Simple active-passive clustering james bond CentOS / RHEL / Fedora 1 30-10-2008 07:40 AM
I have simple proplem with ubuntu QTrXP Ubuntu / Debian 1 14-04-2008 04:46 PM
Simple Xen API programming unixfoo XEN 0 28-12-2007 11:00 AM
Perl simple html mail chiku Coding in General 3 17-08-2007 07:59 PM
required help for running a shell script from browser vaishalichitale Shell scripting 1 27-06-2006 04:53 PM


All times are GMT +5.5. The time now is 01:38 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38