Jump to content

Functions


networkthis

Recommended Posts

Ooops.........Accidentaly hit enter and it posted before I was done.....

 

Is it possible to call a function as a link in a php document.

 

Example: 

 

------------------------------------------------------------------

MyFunction() {

 

Do something;  }

 

<a href="<?php MyFunction() ?>"> Link on page </a>

 

---------------------------------------------------------------

 

Will something like that work and perform the function at that point?

Link to comment
https://forums.phpfreaks.com/topic/110154-functions/#findComment-565304
Share on other sites

Awesome thank you......now that I am finally getting comfortable with php for the most part-maybe I should start learning ajax...Sounds like I'm going to need it.  All these pages are becoming more and more complex.  Guess learning ajax can only help.

 

Ajax is basically Javascript.  It stands for Asynchronous Javascript and XML.  Tell me what you're trying to do so we can tell you of an alternative "just PHP" way to do it. =P

Link to comment
https://forums.phpfreaks.com/topic/110154-functions/#findComment-565324
Share on other sites

I have created a file browser system which is becoming more of a file management system.  I have a simple setup right now that will allow me to delete each file individually by clicking on a delete icon which is printed by each file.  There is also a save icon that is printed by each file.  Right now I have to delete each file individually and save each file individually from the file browser. 

 

I have now written it so that each file will print out a check box by the file name so that the files can be deleted when checked.  along with the save and delete icons for individual file transfer.  However, the only way I can figure out to do it is by placing everything inside a form and then sending the values to another page where my delete selected files sciript is run.

 

I was trying to keep from having to use the form buttons on the page.  I would like to be able to keep the page looking nice with either icons or by placing the actions in divs with links or so on.

 

I just thought that maybe by there was another way to utilize functions.  Just trying to be creative....and kind of tired!!!   

 

Thanks for the input so far.

Link to comment
https://forums.phpfreaks.com/topic/110154-functions/#findComment-565386
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.