Home Forums Gamescan Chat42 About
* Login   * Register * FAQ    * Search
It is currently Tue 12-30-2025 3:16PM

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: graphic button do two things
PostPosted: Sun 02-12-2006 6:23PM 
Offline
Major
User avatar

Joined: Mon 08-16-2004 3:52PM
Posts: 289

Source: TJ South
Is this possible? I'd like to have a graphic run a function, in my case have it run the PHP mail() command, and also go to a website. I'm making a paypal button, but then they click it, I'd like it to send out an email and then go to the paypal site so they can pay. Does that make sence? Ideas? Thanks!

-gw


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Sun 02-12-2006 7:06PM 
Offline
Colonel
User avatar

Joined: Sun 09-12-2004 8:22PM
Posts: 657
Location: somewhere

Source: Kappa Sigma
try using the javascript command "onclick" to run the function and a hyperlink to change the page. Try this, it might work:
Code:
<a href="page.html"><img src="image.jpg" onclick="FunctionCall()"  height="100" width="100" border="0"/></a>

_________________
if you woke up as me everyday, you'd hate yourself too.


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Sun 02-12-2006 7:42PM 
Offline
Major
User avatar

Joined: Mon 08-16-2004 3:52PM
Posts: 289

Source: TJ South
hmm.. I'll try that. Also, is there a way to automaticly submit a form? for example, lets say a user fills out most of a form site, they click submit (which sends it to a processing.php) processing.php see's that all the inputs have not been filled out and sends the user to a page where they can finish filling out the form. in the processing.php I'd like to have a bunch of hidden inputs that have the values the user had entered previously. But I want processing.php to "submit" instead of redirect so that those hidden input values will be send to whatever page I want. does that make sense? Thanks

-gw


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Fri 03-03-2006 10:38AM 
Offline
Cookie Monster
Cookie Monster
User avatar

Joined: Mon 05-12-2003 6:27PM
Posts: 423
Location: Rolla

Source: Off Campus
What you need to do is this:

Code:
<head>
  <script lang...

  function submit_form()
  {
      //check input tag values before you submit
      document.myform.submit();
  }
...
<body>
...
   <form name="myform"...
   <input...

   <input type="button" OnClick="submit_form();">
...


Remember that javascript is a client side scripting language and php is a server side scripting language. I preffer to check values client side instead of server side. If I check them server side it is only because I am working with a database or something. You might look into the php function isset();

l8r


Top
 Profile  
    
 Post subject:
PostPosted: Fri 03-03-2006 12:36PM 
Offline
Major
User avatar

Joined: Mon 08-16-2004 3:52PM
Posts: 289

Source: Wilson Library
cool. i'll look into that as well. That seems like the user has to do something. a while back I found a way to automaticly run the javascript function. write all your javascript directly after you <HTLM> tag.
then once you have everything you need put in your body tag like this

<body onLoad=" run_this_function(<parameter>);" >

that way when it gets the the body tag it will run what ever function you want it to, or multiple if it's needed.

<body onLoad="function_1(); function_2(); function_3();">

very handy. At least I found it useful. I ment to post this earlier, but got caught up in the project I was using it for. Hope this helps someone else.

-gw


Top
 Profile E-mail  
    
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group