path to singlepage

Permalink
Hello.
I have dona single page that will contain a send mail form. The thing is when i submit the form i will need the path to the singlepage so that it can reload and send the mail.

example:
<form method='post' action='kontakt.php'>

kontakt.php is my single page.
is there something similar to this i can use:
$this->getThemePath(); to get the filepath right.

thanks for any help, im really stuck..
//Bjorn

 
okhayat replied on at Permalink Reply
okhayat
I guess you could use:
<?php $this->url('/kontakt'); ?>
bcorn replied on at Permalink Reply
i cant really figure it out because $this->url('/kontakt'); only gives me
/index.php/kontakt/ and i need the filepath i guess and not the url..

//Bjorne
okhayat replied on at Permalink Reply
okhayat
If you need to reference the page from the ACTION attribute, you need the URL and not the path. The path is used for images, CSS, JS, and so on.
robleyd replied on at Permalink Reply
I think what s/he is looking for is a built in way to get the equivalent of $_SERVER['PHP_SELF'] - I'd be interested in the same myself, as I have a block that needs to call itself; whilst PHP_SELF 'works' it produces an interesting URL prefixed by one or more /index.php/
okhayat replied on at Permalink Reply
okhayat
Maybe, but you have to be careful when using PHP_SELF. Google it to see why.
Instead I would use something like:
<?php
$url = BASE_URL."/".$this->url('/page');
?>
ryan replied on at Permalink Reply
ryan
<?php
// $b is a block object
$c = $b->getBlockCollectionObject();
?>
<a href="<?=View::url($c->getCollectionPath());?>">
  Link to the page the block is displayed on
</a>


If you're submitting a form from a block, you'd call:
<form method="post" action="<?=$this->action('controllerFunctionName')?>">
robleyd replied on at Permalink Reply
That has solved my minor problem. Thank you.
bcorn replied on at Permalink Reply
Thanks for your help okhayat, i got it to work.. /Bjorn