Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

eternal403 on "how to invoke wordpress API from other existing PHP system"

$
0
0

I have an existing PHP site located on

/var/www/A
, now I want to add a blog module on
/var/www/A/wordpress
. I have installed wordpress below
/var/www/A
successfully. I can visit it via
http://localhost/mysite.com/www/wordpress
.

What I will to do next is : when a user regist on my site, at the same time create a new user in wordpress, so I need to invoke wordpress's API, and I found one wp_insert_user . I have a User.php and have a login function and I'll put the function wp_insert_user into it.

Fisrt, import API, I added these two lines on the head of my User.php.

define('WP_USE_THEMES', false);
require('/var/www/A/wordpress/wp-blog-header.php');

Then, visit my site via browser. Befor I include two lines, I can via

http://localhost/mysite.com/www/logon.php
to logon my site. But, after I added two lines, when I visit my site , the url are changed from
http://localhost/mysite.com/www/logon.php
to
http://localhost/mysite.com/www/logon.php/wp-admin/install.php

I notice that I have 'wp-admin/install.php' on my url, but I have been installed it and I can visit it via

http://localhost/mysite.com/www/wordpress

What a worese, all the style of my logon.php are completely different.
What should I do next ? Thanks in advance.


Viewing all articles
Browse latest Browse all 8245

Trending Articles