External PHP Application

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Roaster
Regular
Posts: 121
Joined: Tue Feb 22, 2005 9:04 pm

External PHP Application

Post by Roaster »

Hi,

how can I use the "External PHP Application" plugin? I've created a new directory called "php" inside the s9y directory and copied an index.php into it.

I've set:
Permalink: /index.php?/static/test.html
URL shorthand name: phpname
File to include /is/htdocs/60841/www.mydomain.de/blog//php/index.php

But nothing happens. How can I call this page?

cu,
Roaster
Roaster
Regular
Posts: 121
Joined: Tue Feb 22, 2005 9:04 pm

Post by Roaster »

Answering myself: I got this running.

I wanted to add a formmailer script which is running more or less perfect. I've got a simple problem:

Code: Select all

<form class="formular" action="index.php" method="post">
Using the action like above possibly detected errors within the form aren't displayed anymore. When using

Code: Select all

http://localhost/serendipity/index.php?serendipity[subpage]=contact
it works perfectly.

Now, how do I get rid of this long path in the last coding? I've tried to use

Code: Select all

<?php echo $PHP_SELF ; ?>
but the variable is empty!.

Any hints?
cu,
Roaster
Roaster
Regular
Posts: 121
Joined: Tue Feb 22, 2005 9:04 pm

Post by Roaster »

Answering meyself agin ;-)

I've checked the recommended way to get global vars using

Code: Select all

<h1><?php echo $_SERVER[PHP_SELF] ; ?></h1>
However I got back this path/file:

Code: Select all

/serendipity/index.php
My script is saved into "/serendipity/php/index.php". So the problem still exists: Is there a simple way to get the current loaded file?

cu,
Roaster
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Use

Code: Select all

$_SERVER['REQUEST_URI']
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Roaster
Regular
Posts: 121
Joined: Tue Feb 22, 2005 9:04 pm

Post by Roaster »

Thanks Garvin,

you won't believe it but I found the same solution :P

Thx,
Roaster
Post Reply