Page 1 of 1

using post, how do i get the path

Posted: Thu Nov 11, 2010 3:51 am
by twuncher
i know you can use this (isset($this->request->get['path'])) to get the path on a get()

but what if its a post, how would i parse on the url?

thanks

twun

Re: using post, how do i get the path

Posted: Thu Nov 11, 2010 4:10 am
by Qphoria
change
$this->request->get['path']
to
$this->request->post['path']

Re: using post, how do i get the path

Posted: Fri Nov 12, 2010 1:33 am
by twuncher
that simple hey :) i did try that but didnt get the result i was looking for il give it another go :)

Re: using post, how do i get the path

Posted: Fri Nov 12, 2010 1:45 am
by twuncher
just doing some testing,

if (isset($this->request->post['post'])) {
$path = $this->request->post['post'];

echo "TEST";
echo $path;
}

i get no echo :(

do i need to do something on the sending side attach the path to the post?

Re: using post, how do i get the path

Posted: Fri Nov 12, 2010 4:40 am
by billyggla
Try this

Code: Select all

if (isset($REQUEST_['path'])) {
                $path = $REQUEST_['path'];
                
                echo "TEST";
                echo $path;
              }  
 

Re: using post, how do i get the path

Posted: Fri Nov 12, 2010 6:54 am
by Qphoria
billyggla wrote:Try this

Code: Select all

if (isset($REQUEST_['path'])) {
                $path = $REQUEST_['path'];
                
                echo "TEST";
                echo $path;
              }  
 
You got your underscore in the wrong spot..
should be $_REQUEST['path']

But still, the original code was fine, you just aren't passing "path" as a POST variable so you will never see the echo

Re: using post, how do i get the path

Posted: Fri Nov 12, 2010 6:08 pm
by billyggla
Ok.. no more posts after 8:00pm for me... :-[

Re: using post, how do i get the path

Posted: Wed Nov 17, 2010 9:25 pm
by d_koev
Hey guys,

I have a similar question. I am using

Code: Select all

<?php if (isset($_GET['path'])) { ?>
Unfortunately after SEO URL option is enabled, there is no more 'path'. How can I check if it is a category and which specific category it is?

Thanks in advance.

Re: using post, how do i get the path

Posted: Wed Nov 17, 2010 10:30 pm
by Qphoria
d_koev wrote:Hey guys,

I have a similar question. I am using

Code: Select all

<?php if (isset($_GET['path'])) { ?>
Unfortunately after SEO URL option is enabled, there is no more 'path'. How can I check if it is a category and which specific category it is?

Thanks in advance.
At that point $_GET is no longer used. The seo_url controller then sets its values using $this->request. So use:

Code: Select all

$this->request->get['path'] 

Re: using post, how do i get the path

Posted: Wed Nov 17, 2010 11:12 pm
by d_koev
Thanks, Qphoria!

You made my day! ;)

Everything is fine now. :)

Re: using post, how do i get the path

Posted: Sun Jan 02, 2011 5:17 am
by d_koev
Hey guys, it is me again. :)

I have similar problem again. I want the slider to appear only on home page. I am using this construction:

Code: Select all

 <?php if (isset($_GET['route'])) { ?>
    <?php $id = $_GET['route']; ?>
    <?php } ?>
    <?php if ($id == "common/home") { ?>
    
        <div id="slider"></div> 

<?php } else { ?>
      
    <?php echo "" ?>
     	 	
 <?php } ?>
The problem is that when you first reach the index page 'route' is still not set. Any advice would be highly appreciated. How can I made the silder to appear only when it is home page, even if 'route' is not set yet?

Thanks in advance

Dimitar

Re: using post, how do i get the path

Posted: Sun Jan 02, 2011 5:25 am
by Qphoria
Corrected & Simplified:

Code: Select all

<?php if (!isset($this->request->get['route']) || (isset($this->request->get['route']) && $this->request->get['route'] == 'common/home')) { ?>
<div id="slider"></div> 
<?php } ?>

Re: using post, how do i get the path

Posted: Sun Jan 02, 2011 6:10 am
by d_koev
Thank you Qphoria. You're great help in this community.

Re: using post, how do i get the path

Posted: Fri Oct 21, 2011 5:46 pm
by adyled
Hey how could I use the path /category to segregate the products? Well I wish to segregate the products according to category. Could anyone enlighten me on how to do this? Thank you.

Re: using post, how do i get the path

Posted: Mon Jun 11, 2012 4:02 pm
by WCNZ
Thanks Qphoria - your solution was exactly what I was looking for, and I really appreciate the tip. Cheers! :)

Re: using post, how do i get the path

Posted: Wed Jan 30, 2013 12:28 pm
by morktron
Thanks Qphoria, this helped me out too! :)