$_POST method and Concatenate URL

I have this code almost working. I’m assuming this is simple stuff for you guys but basically I’m trying to have the action of the form open a URL that has been concatenated with a string variable.

Basically the action should open the page http://www.myblog.com/wordpress/?p=868 (as an example), but instead it just opens to http://www.myblog/wordpress/?p=. If I change the code and assign the $test echo part of the action instead of the $Article it does open to http://www.myblog/wordpress/?p=900.

Here’s where I have the code so far. Any help is greatly appreciated. thx.

[code]<?php
$Article=$_POST[“Article”];
$test=900
?>

TEST Article Number:
[/code]

It is working fine. I just think its not doing what you want to achieve.

Try inputting 1 article number and then another. Because its stored in <?php echo $Article;?> from the previous form submission, it will goto that with a 1 page delay. (if that makes sense to you)

If you want it to goto an article that you input into the field, try this.

[code]

TEST Article Number:
[/code]

[test2.php]
[php]<?php header("Location: /wordpress/?p=".$_POST['Article'].""); ?>[/php]

Great advice. I figured I might be putting the cart before the horse. Having the action point to another link and then have that link use the variable definetly solved my problem…and it totally makes sense. Thx.

I’m building a search that will use Year/Month/Day/category that will allow my wordpress sites permalink structure sort out posts. The only issue I found is that posts that belong to multiple categories are not sorting properly. I’m now off to the WP forum :slight_smile:

thanks again for the quick response.

Rob

Sponsor our Newsletter | Privacy Policy | Terms of Service