Wordpress/PHP question

Wordpress/PHP question

am 22.03.2010 17:47:50 von John Tamm-Buckle

--0016e64ed2ea2b1a7a0482667537
Content-Type: text/plain; charset=ISO-8859-1

Hi all,

I'm storing generated data as a post in wordpress using the wp_insert_post
function, which works great. Users click a "submit" button and the things
are saved, hurrah!

However, on clicking the submit button I want to automatically navigate to
the post. This has been less successful. I've tried using:

header('Location: /?p=' . $postId);

In this case, where $postId = wp_insert_post($generated_text), and
$generated_text is the object that saves the output to a post.

Now when I try to save I get the following error:

Cannot modify header information - headers already sent by (output started
at /Users/sv/source/wpm/public_html/wp-content/themes/mystique/ header.php:6)
in */Users/sv/source/wpm/public_html/wp-content/plugins/wpm/wpm .php* on
line *64*

Line 64 contains the "header('Location: /?p=' . $postId);" line.

Thanks!

John


--
Out now:
Kvist 002 - Raglani - Web of Light - 12"
Kvist 003 - EOD - untitled - 12"
Kvist 004 - JD Emmanuel - Solid Dawn - CD
Kvist 005 - Guillaume Gargaud - Here - CD

Coming soon:
Kvist 006 - Tom Hamilton - Pieces for Kohn/Formal & Informal Music - CD

www.kvistrecords.com

--0016e64ed2ea2b1a7a0482667537--

Re: Wordpress/PHP question

am 22.03.2010 17:59:08 von Robert Cummings

John Tamm-Buckle wrote:
> Hi all,
>
> I'm storing generated data as a post in wordpress using the wp_insert_post
> function, which works great. Users click a "submit" button and the things
> are saved, hurrah!
>
> However, on clicking the submit button I want to automatically navigate to
> the post. This has been less successful. I've tried using:
>
> header('Location: /?p=' . $postId);
>
> In this case, where $postId = wp_insert_post($generated_text), and
> $generated_text is the object that saves the output to a post.
>
> Now when I try to save I get the following error:
>
> Cannot modify header information - headers already sent by (output started
> at /Users/sv/source/wpm/public_html/wp-content/themes/mystique/ header.php:6)
> in */Users/sv/source/wpm/public_html/wp-content/plugins/wpm/wpm .php* on
> line *64*
>
> Line 64 contains the "header('Location: /?p=' . $postId);" line.


You have a space someplace... most like left after some anal coder
decided it was a good idea to close all their think about trailing space in the files >:)

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Wordpress/PHP question

am 22.03.2010 18:38:14 von Piero Steinger

On 22.03.2010 17:47, John Tamm-Buckle wrote:
> Hi all,
>
> I'm storing generated data as a post in wordpress using the wp_insert_post
> function, which works great. Users click a "submit" button and the things
> are saved, hurrah!
>
> However, on clicking the submit button I want to automatically navigate to
> the post. This has been less successful. I've tried using:
>
> header('Location: /?p=' . $postId);
>
> In this case, where $postId = wp_insert_post($generated_text), and
> $generated_text is the object that saves the output to a post.
>
> Now when I try to save I get the following error:
>
> Cannot modify header information - headers already sent by (output started
> at /Users/sv/source/wpm/public_html/wp-content/themes/mystique/ header.php:6)
> in */Users/sv/source/wpm/public_html/wp-content/plugins/wpm/wpm .php* on
> line *64*
>
> Line 64 contains the "header('Location: /?p=' . $postId);" line.
>
> Thanks!
>
> John
>
>
>

Hi

What's on line 6 from file
/Users/sv/source/wpm/public_html/wp-content/themes/mystique/ header.php?


--Piero

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Wordpress/PHP question

am 22.03.2010 18:52:05 von TedD

At 12:59 PM -0400 3/22/10, Robert Cummings wrote:
>You have a space someplace... most like left after some anal coder
>decided it was a good idea to close all their >think about trailing space in the files >:)
>
>Cheers,
>Rob.

That may be, but I always add fiber to my coding.

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Wordpress/PHP question

am 22.03.2010 21:55:42 von Piero Steinger

--------------080508040702040505000900
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 22.03.2010 18:45, John Tamm-Buckle wrote:
> Line 6 is:
>
> > //language_attributes('xhtml'); ?>>
>
> Thanks,
>
> John
>
> On Mon, Mar 22, 2010 at 12:38 PM, Piero Steinger > > wrote:
>
> On 22.03.2010 17:47, John Tamm-Buckle wrote:
>
> Hi all,
>
> I'm storing generated data as a post in wordpress using the
> wp_insert_post
> function, which works great. Users click a "submit" button
> and the things
> are saved, hurrah!
>
> However, on clicking the submit button I want to automatically
> navigate to
> the post. This has been less successful. I've tried using:
>
> header('Location: /?p=' . $postId);
>
> In this case, where $postId = wp_insert_post($generated_text), and
> $generated_text is the object that saves the output to a post.
>
> Now when I try to save I get the following error:
>
> Cannot modify header information - headers already sent by
> (output started
> at
> /Users/sv/source/wpm/public_html/wp-content/themes/mystique/ header.php:6)
> in
> */Users/sv/source/wpm/public_html/wp-content/plugins/wpm/wpm .php*
> on
> line *64*
>
> Line 64 contains the "header('Location: /?p=' . $postId);" line.
>
> Thanks!
>
> John
>
>
>
>
> Hi
>
> What's on line 6 from file
> /Users/sv/source/wpm/public_html/wp-content/themes/mystique/ header.php?
>
>
> --Piero
>
>
>
>
> --
> Out now:
> Kvist 002 - Raglani - Web of Light - 12"
> Kvist 003 - EOD - untitled - 12"
> Kvist 004 - JD Emmanuel - Solid Dawn - CD
> Kvist 005 - Guillaume Gargaud - Here - CD
>
> Coming soon:
> Kvist 006 - Tom Hamilton - Pieces for Kohn/Formal & Informal Music - CD
>
> www.kvistrecords.com

You have to execute the plugin first, if possible. Alternatively you can
put a JavaScript redirect in the file wpm.php instead of a HTTP redirect.

--------------080508040702040505000900--