Hello. Im Matt and I am just discovering the world of PHP and of coarse just registered to this forum.
Although PHP is new to me, coding in general is not. I learned HTML on my own and in school took classes for QBasic. The language is not completely foreign to me. Although QBasic is ancient a lot of the code is very similar. This stuff comes naturally to me.
Im so glad I discovered what PHP is all about. It allows me to do all the things I never though I would be able to do.
Now that I introduce myself Ill get down to the problems Im having. I feel that the code I wrote is in proper syntax. I dont understand why it isnt working. Im sure it is spagetti code but Im still learning and experiment..
Im having trouble getting functions and $_GET to work properly or at all really...
<?php
function gofoward()
{ echo "NEXT"; }
function goback()
{ echo "BACK"; }
$action = $_GET['action'];
if ($action = "next")
{ gofoward(); }
elseif ($action = "back")
{ goback(); }
else {}
?>
<HTML>
<! -------HTML CODE-Website-Content----->
<a href="samepage.php?action=back">Back</a>
<a href="samepage.php?action=next">Next</a>
</HTML>
**The goal is to display a new image on the page by clicking "Next" or Back"
**But this is only test code to see if its working properly and its not.
**The page automatically displays "NEXT" from inside the function regardless of the value of
**the $action var which I do not believe is even being assigned its value from $_GET at all
-----------------------------------------------------------------------------------------------
**Another issue Im having and dealing with a 3 digit variable to correspond with my image gallery.
**EX: 000.jpg + 005.jpg + 010.jpg + 115.jpg
**I want to be able to add/subtract the number in a variable while always keeping it at 3 digits.
$dig1 = 0;
$dig2 = 0;
$dig3 = 0;
$img = $dig1. $dig2. $dig3;
**This was my solution but seams sloppy and unconventional.
**Is there a way to have a var = 000 and change it to 001 then 002 and so on?


