Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
andrej
Hangin' Around


Joined: Sep 10, 2005
Posts: 48

PostPosted: Wed Aug 02, 2006 12:21 pm Reply with quote

Hi !

I am using a kalendar.
When user submits an event with pressing "submit" button the data is inserted into the database. ( or deleted if admin chooses this in the drop down menu) I need to run another script everytime users press the submit button.

How can this be done ?
 
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Wed Aug 02, 2006 1:28 pm Reply with quote

Not sure which calendar you are using, but you'd need to edit it to run the other script. Depending on how the other script is designed, you may have to create a function that includes the mainline code in the script you want to call.

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Wed Aug 02, 2006 5:07 pm Reply with quote

Something like this?

Code:



<form name='f1' action="p1.php" method="post">
<input type="hidden" name="p1">
<input type="hidden" name="p2">
<!-- so on -->
</form>
 
<form name='f2' action="p2.php" method="post">
<input type="text" name="p1" value="[some text]">
<!-- other form fields -->
<input type="button" value="go" onClick="doSubmit()">
</form>

<sc  ript><!--
 function doSubmit()
 {
  document.f1.p1.value = "my_hidden_param1";
  document.f1.p1.value = "my_hidden_param2";
  document.f1.submit();
  document.f2.submit();
 }
//-->
</sc   ript>

 
View user's profile Send private message
andrej
PostPosted: Thu Aug 03, 2006 4:13 am Reply with quote

This is the code in the calendar.
How can i implement it in my case ?

Code:
    if ($event["op"] == "CalendarPreviewEvent" || $event["op"] == "CalendarEditEvent" || $event["op"] == "CalendarNewEvent" || $event["op"] == "CalendarPostEvent") {

        $actionfile = "admin.php?op=" . $event["op"];
        $hiddenfields = "<input type=\"hidden\" name=\"name\" value=\"" . CAL_MODULE_NAME . "\">\n";
        $hiddenfields .= "<input type=\"hidden\" name=\"file\" value=\"submit\">\n";
        $hiddenfields .= "<input type=\"hidden\" value=\"" . $event["posteddate"] . "\" name=\"posteddate\">";

        $submitoptions = "<option value=\"CalendarPreviewEvent\">" . _CALPREVIEWSTORY . "</option>\n";
        $submitoptions .= "<option value=\"CalendarPostEvent\" selected>" . _CALPOSTSTORY . " &raquo; " . _CALGOTOEDIT . "</option>\n";
        $submitoptions .= "<option value=\"CalendarPostEventGotoMain\">" . _CALPOSTSTORY . " &raquo; " . _CALGOTOADMIN . "</option>\n";
        $submitoptions .= "<option value=\"CalendarPostEventGotoCalendar\">" . _CALPOSTSTORY . " &raquo; " . _CALGOTOCALENDAR . "</option>\n";
        if (!empty($event["eid"])) $submitoptions .= "<option value=\"CalendarDeleteEvent\">" . _CALDELETESTORY . "</option>\n";

        $xactiv = (empty($event["activ"])) ? "<b> (neuer Termin)</b>" : "";
        $event["activ"] = (empty($event["activ"])) ? 1 : $event["activ"];
        $selactiv1 = ($event["activ"] == 1) ? "checked" : "";
        $selactiv2 = ($event["activ"] != 1) ? "checked" : "";
        if ($event["informant"] && $event["op"] != "CalendarNewEvent") {
            $userdata = calGetUserData($event["informant"]);
            $event["informant"] = $userdata["uname"]; // falls Username nicht mehr existiert, wird "" gesetzt
            if ($event["informant"]) {
                $namefield .= "&nbsp; <span class=\"tiny\">[ <a href=\"" . CAL_MOD_USERINFO . $event["informant"] . "\" target=\"_blank\">Userinfo</a> | <a href=\"mailto:" . $userdata["email"] . "\">Email User</a>";
                $namefield .= " ]</span>";
            }
        }
    } else {
        $actionfile = "modules.php?name=" . CAL_MODULE_NAME . "&amp;file=submit";
        $hiddenfields = "<input type=\"hidden\" name=\"name\" value=\"" . CAL_MODULE_NAME . "\">\n";
        $hiddenfields .= "<input type=\"hidden\" name=\"file\" value=\"submit\">\n";
        $hiddenfields .= "<input type=\"hidden\" value=\"" . $event["posteddate"] . "\" name=\"posteddate\">";
        $hiddenfields .= "<input type=\"hidden\" name=\"activ\" value=\"" . $autoactive . "\">\n";
        $submitoptions = "<option value=\"calNewEventPreview\" selected>" . _CALPREVIEW . "</option>\n";
        $submitoptions .= "<option value=\"calNewEventSubmit\">" . _CALOK . "</option>\n";
        $event["activ"] = 0;
    }
 
hitwalker
PostPosted: Thu Aug 03, 2006 5:59 am Reply with quote

i just gave a sample of how it can be used....
for complete modifications for this i suggest you post this in the for hire section...
or someone might be interested in doing this as they read this..
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Thu Aug 03, 2006 6:52 am Reply with quote

Sorry, very confused at what you are trying to accomplish. But you may want to read up on the INCLUDE statement in the PHP manual.

Can you explain more what you are needing this to do and why? It might help us help you better.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
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
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©