WordPress question....
am 23.10.2007 17:16:16 von Maya
hi expert php'ers.....;)
is it ok to ask WordPress questions here? I mean if you don't get a
response to your quetion in WP forums where else can you go??
I have WP 2.3 installed on my own hosting server..
I'm tying to do something that should be quite simple yet I can't get it
to work...
I want to do my own form, w/o having to use a plugin.. I tried a contact
plugin, but you can't specify what address to send email to, which
renders the plugin pretty useless.. in readme file for the plugin is
url to a forum for plugin (www.linksback.org/forums) in this forum I
found question on how to change 'to' email address, this is the answer:
"It is set to go to the default wordpress email. [oh really? what
address exactly???] I will include an option to change that in the next
version" (a joke, if you ask me..) I found a variable for "to" email
address among the code, and changed it there, but it still didn't work..
I have my own php-code for sending email, that works fine if the form
submitting is OUTSIDE WP-installation; but if the form is INSIDE the
installation, no info gets passed to my ThankYou.php page, which I have
put outside WP-installation and in 'action' attr inside form tag put an
absolute link to it..
this is my email code, which, again, works fine if form is outside
WP-installation:
$sendername = $_POST['name'];
// echo "name of sender: $sendername
";
$email = $_POST['email'];
// echo "email of sender: $email
";
$headers = "From: $sendername <$email>" . "\r\n";
$msg = $_POST['msg'];
$msg = wordwrap($msg, 70);
// echo "msg: $msg";
$subj = "feedback from blog";
$to = "";
mail($to,$subj,$msg,$headers);
I have used this code on numerous occasions, with two different
php-hostings.. does anybody know WHY it doesn't it work with Word Press
(i.e., if form/info comes from inside WP-installation)?? folks in
WP-formus keep pointing me to this and that other plug-in, but I'd
rather use my own code than having to go to an interface to configure
someone else's code... I mean look at all the stuff you have to do for
this one, for example, http://green-beast.com/blog/?page_id=136.. it's
just crazy.. why won't 'normal' php code ;) work with a form that's
inside WP-installation?? I mean if I can't use my own code for stuff
for something simple like this then what is the point of open-source???? ;)
I hope it's ok to ask this here, this is getting a bit frustrating at
this point (reason I want to use form rather than use 'mailto' link is
that I don't want my email address on the site, as one way spammers
gather email addresses is they harvest them to 'mailto' links, AND: and
I really need to specify 'to' address, since this is an address that is
not even in blog-domain (i.e., email address is something like
"me@mydomain.com, mydomain not being domain for the blog (I don't want
to have to check more addresses than necessary, and this is just a
personal blog, I will probably get very little email..)
thank you very much..
Re: WordPress question....
am 23.10.2007 18:42:40 von Jerry Stuckle
maya wrote:
> hi expert php'ers.....;)
>
> is it ok to ask WordPress questions here? I mean if you don't get a
> response to your quetion in WP forums where else can you go??
> I have WP 2.3 installed on my own hosting server..
> I'm tying to do something that should be quite simple yet I can't get it
> to work...
>
You can ask. But you probably won't get any answers here. The
WordPress forums are still your best best for help.
Very few here have used WordPress, whereas everyone on their forum uses it.
And there must be a reason why they recommend plug-ins. You might ask
them why.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: WordPress question....
am 23.10.2007 18:52:36 von Maya
Jerry Stuckle wrote:
> maya wrote:
>> hi expert php'ers.....;)
>>
>> is it ok to ask WordPress questions here? I mean if you don't get a
>> response to your quetion in WP forums where else can you go??
>> I have WP 2.3 installed on my own hosting server..
>> I'm tying to do something that should be quite simple yet I can't get
>> it to work...
>>
>
> You can ask. But you probably won't get any answers here. The
> WordPress forums are still your best best for help.
>
> Very few here have used WordPress, whereas everyone on their forum uses it.
>
> And there must be a reason why they recommend plug-ins. You might ask
> them why.
>
oh brother.. ok, if I can't do my thing like I want to w/my own code
but only w/a "plugin", then it means this thing is not REALLY open
source.. ok, I tried.. thank you for your response...
Re: WordPress question....
am 23.10.2007 21:28:10 von Captain Dondo
maya wrote:
>
> oh brother.. ok, if I can't do my thing like I want to w/my own code
> but only w/a "plugin", then it means this thing is not REALLY open
> source.. ok, I tried.. thank you for your response...
>
Huh???? You are free to modify the the WordPress code any way you want.
That's open source. There are good ways and bad to do things; doing
something the bad way has nothing to do with open source.
I have email forms that I wrote and they work just fine. I don't even
think they work via a plugin, but it's been so long that I don't remember.
Don't bitch about it, just do it.
Re: WordPress question....
am 24.10.2007 03:36:30 von Jerry Stuckle
maya wrote:
> Jerry Stuckle wrote:
>> maya wrote:
>>
>> And there must be a reason why they recommend plug-ins. You might ask
>> them why.
>>
>
> oh brother.. ok, if I can't do my thing like I want to w/my own code
> but only w/a "plugin", then it means this thing is not REALLY open
> source.. ok, I tried.. thank you for your response...
>
>
That's not what open source means. Open source means you have full
access to their source code. You still must abide by any restrictions
placed by their system.
So - find out why it takes a plugin - and see what you need to do to
make your code compatible.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: WordPress question....
am 24.10.2007 07:09:05 von nc
On Oct 23, 8:16 am, maya wrote:
>
> I want to do my own form, w/o having to use a plugin..
There is a reason plugins are used in WordPress. If you modify
WordPress codebase, the results will impact every page and/or post
generated by WordPress. If you want your form to appear only on
certain page(s), you need to implement it within a plugin.
> I tried a contact plugin, but you can't specify what
> address to send email to, which renders the plugin
> pretty useless..
So try another one... This one seems to be OK:
http://wordpress.org/extend/plugins/cforms/
> It is set to go to the default wordpress email. [oh really?
> what address exactly???]
The one that's associated with the user whose name is "admin" and
whose ID number is 1.
> I have my own php-code for sending email, that works fine
> if the form submitting is OUTSIDE WP-installation;
So wrap it into a plugin, and your problem is solved...
> I have used this code on numerous occasions, with two
> different php-hostings.. does anybody know WHY it doesn't
> it work with Word Press
Because you are putting it in the wrong place, perhaps? :)
> I mean if I can't use my own code for stuff for something
> simple like this then what is the point of open-source???? ;)
Open source or not, you need to understand the inner workings of the
system you are trying to extend...
Cheers,
NC
Re: WordPress question....
am 26.10.2007 15:21:58 von Maya
thank you all for your responses.. all points well taken..
I guess I will have no choice but to try the plugin, but I still don't
understand why I can't use my own code to send email.. there are other
things I don't understand about this WordPress installation, like if I
add one php file where all other files are for my blog (I mean where
main index.php is) I get a 404 on that php file if I try to load it on
the browser.. this doesn't make too much sense.. call it 'open
source', call it whatever you want, it should be more flexible than that..
thank you very much..
NC wrote:
> On Oct 23, 8:16 am, maya wrote:
>> I want to do my own form, w/o having to use a plugin..
>
> There is a reason plugins are used in WordPress. If you modify
> WordPress codebase, the results will impact every page and/or post
> generated by WordPress. If you want your form to appear only on
> certain page(s), you need to implement it within a plugin.
>
>> I tried a contact plugin, but you can't specify what
>> address to send email to, which renders the plugin
>> pretty useless..
>
> So try another one... This one seems to be OK:
>
> http://wordpress.org/extend/plugins/cforms/
>
>> It is set to go to the default wordpress email. [oh really?
>> what address exactly???]
>
> The one that's associated with the user whose name is "admin" and
> whose ID number is 1.
>
>> I have my own php-code for sending email, that works fine
>> if the form submitting is OUTSIDE WP-installation;
>
> So wrap it into a plugin, and your problem is solved...
>
>> I have used this code on numerous occasions, with two
>> different php-hostings.. does anybody know WHY it doesn't
>> it work with Word Press
>
> Because you are putting it in the wrong place, perhaps? :)
>
>> I mean if I can't use my own code for stuff for something
>> simple like this then what is the point of open-source???? ;)
>
> Open source or not, you need to understand the inner workings of the
> system you are trying to extend...
>
> Cheers,
> NC
>
Re: WordPress question....
am 26.10.2007 19:22:06 von nc
On Oct 26, 6:21 am, maya wrote:
>
> I guess I will have no choice but to try the plugin,
> but I still don't understand why I can't use my own
> code to send email..
You can; you just need to organize it into a plugin.
> if I add one php file where all other files are for my
> blog (I mean where main index.php is) I get a 404 on
> that php file if I try to load it on the browser..
This, in all likelihood, has nothing to do with WordPress; I often add
a simple phpinfo() file to WordPress' main directory to test system
environment during development or deployment, and I am yet to see the
error you describe.
For starters, check the program you used to upload your files. Some
have a "convert file names to lower case" setting, so your
ThankYou.php might have been inadvertently uploaded as thankyou.php.
> this doesn't make too much sense.. call it 'open
> source', call it whatever you want, it should be more
> flexible than that..
No. YOU should be more flexible than that. Extending an existing
system requires an understanding of how it works and what extension
mechanisms it provides.
Let's say you were an automotive engineer and designed some
performance parts for BMW M3. You wouldn't insist that those parts
should fit into Porsche Carrera or Mercedes SL550 or Audi TT without
any modification, would you? Same logic applies to software;
extensions must fit with the rest of the system.
Cheers,
NC