Forum Moderators: coopster
1st post here, hopefully I get to take part in many future discussions.
I have a question about something I want to do with a button.
Currently, I have a form setup that looks like this:
$fileurl = "<a href=\"index.php?q=file_download/quest/" . $fileid . "\">";
$cookie = explode("¦", $myCookie);
$fname = $cookie[0];
$lname = $cookie[1];
$deleteurl = "<a href=\"index.php?q=file_download/refresh/" . $fileid . "\">";
$output = "Thanks for your interest in XYZ<br><br> ";
$output .= "If you are ";
$output .= $fname;
$output .= " ";
$output .= $lname;
$output .= " ";
$output .= "please click on the following link to have the document delivered to your mailbox";
$output .= " ";
$output .= $fileurl;
$output .= "send document</a>.";
$output .= " ";
$output .= "otherwise,";
$output .= " ";
$output .= $deleteurl;
$output .= "click here</a>.";
As you can see people can click on either 'send document' or 'click here'..
But instead of text links inside the actual paragraph,
I wanted to know if it's possible to create a 'Send' Button which leads to the same link but have this button below the paragraph, and 'Edit Info' which leads to the other link also below the paragraph.
Thanks guys,
Mike
Therefore, when the script that is loaded from the forms action tag after a submit button is clicked, it should test for which button was clicked (which button ID is set in POST for e.g.), then either redirect to the appropriate page, or include a file or call a function based on the users click.
Hope that makes sense and helps your thought process..
$deleteurl = "<a href=\"index.php?q=file_download/refresh/" . $fileid . "\">";
and then specify $deleteurl in the code i have after that.
But how would I do this with trying to put in "img_src"?
Here is what i'm trying to do. I want the "Edit Info" and "Send" links in the code below to be buttons of some sort...whether image or form buttons doesn't matter. So how would i make these buttons with the format i have?
$deleteurl = "<a href=\"index.php?q=file_download/refresh/" . $fileid . "\">";
$output = "Please click Send to receive requested item at $email <br><br>";
$output .= "To change your information please click Edit Info.<br><br>";
$output .= " ";
$output .= $fileurl;
$output .= "send document</a>.";
$output .= " ";
$output .= "otherwise,";
$output .= " ";
$output .= $deleteurl;
$output .= "click here</a>.";
$output .= $img_src;
$output .= "click here</a>.";
Thanks
Just as cameraman posted ( IMG tag within A tag)
$deleteurl = "<a href=\"index.php?q=file_download/refresh/" . $fileid . "\">";
$img_src= "<a href=\"some_other_url.php"\"><img src=\"your_image.gif\" border=\"0\">";
Of course you could also use an onclick on the img tag (I prefer to do this when making links that are not text myself).
It's a pretty good idea to separate your code from your presentation as cameraman also did for ya in his example. Quite often in your clients (or your) sites someone else may need to work on it. If you separate things nicely for them it won't be a horrible mess of code to try to review / fix. (When I come across that I usually trash old code completely because it's faster to write from scratch ;) )