tags:

views:

14

answers:

2

This question was already asked in the Wordpress support forums (by me) and can be found here: http://wordpress.org/support/topic/423693?replies=1

But since their response time is unbelievably slow, I figured I'd ask it here as well.

Hi all,

I'm using WordPress 3.0 with a self-designed theme. I have a self-built contact form that I'm using, and basically it uses the mail() function to send out an email with the information that the client has filled out.

However, I can't seem to refer to the mail script. For example, in the

<form name="" action="mail.php">

how do I refer to mail.php? I can't use

<?php bloginfo('template_url'); ?>

for some reason. All I need to do is find a way to refer to that file which is located in the same place as all other files (like header.php, index.php, etc. etc.)

I have another question TOTALLY unrelated to forms but still in the same sort of arena.

I have a slideshow on the theme. The slideshow consists of <img /> elements. I made a separate file called slideshow.php with only the <img /> elements in it so that the user can simply open that file and add any images to it (meaning the page with the slideshow, in my case index.php, has a php include in it which refers to the slideshow.php file). However, again, in the slideshow.php file, I can't refer to the images with the following:

<?php bloginfo('template_url'); ?>/images/image1.gif

php bloginfo doesn't work from within another php file even though it gets implemented inside the index.php file. I'm so confused, how am I supposed to refer to correct file paths without a working php bloginfo????

Just so I didn't confuse u, my bloginfo('template_url') DOES work (as I link reset css files, javascript files, etc etc), except it doesn't work everywhere I want it to like in the external slideshow.php file and in the form action field.

Any help would be greatly appreciated!

Thanks, Amit

A: 

Have you tried:

<form method="post" name="" action="/wordpress/wp-content/themes/themname/mail.php" />

Or

<form method="post" name="" action="<?php bloginfo('template_url'); ?>/mail.php" />

And for the image.

<img src="<?php bloginfo('template_url'); ?>/images/image1.gif" alt="" />

Please note the "/" after the PHP.

You can also use get_bloginfo() elsewhere in your PHP.

http://codex.wordpress.org/Function_Reference/get_bloginfo

Nick Pyett
Thank you, I think this will work. Perfect answer!
Amit
A: 

or you can use bloginfo('url');

MrMaksimize