How do I include my php

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
crenshawdesignz
Posts: 38
Joined: Tue 7. Mar 2006, 20:23
Location: Chicago
Contact:

How do I include my php

Post by crenshawdesignz »

I have searched the forums after trying

[PHP]
<?php require_once('Connections/connLogin.php'); ?>
<?php
mysql_select_db($database_connLogin, $connLogin);
$query_rsTest = "SELECT username, email FROM users";
$rsTest = mysql_query($query_rsTest, $connLogin) or die(mysql_error());
$row_rsTest = mysql_fetch_assoc($rsTest);
$totalRows_rsTest = mysql_num_rows($rsTest);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test List</title>
</head>

<body>
<?php echo $row_rsTest['username']; ?>&nbsp;<?php echo $row_rsTest['email']; ?>
</body>
</html>
<?php
mysql_free_result($rsTest);
?>
[/PHP]

It did not work. Then I tried...

{php: test.php}

It did not work. It did not work when I tried to include the file externally.

What can I do? Do I need to make adjustments in my config file?
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

Hi

how should this work ? Different doc type, after headers sent ... ?

This might work with phpwcms database only, but not inside the system.

Look at the doctype of your normal sites .. therefore you might need a pretty much deeper hack ;)
[PHP]
<?php require_once('Connections/connLogin.php'); ?>
<?php


is to much ... opening tags are send by reptags [PHP]

Juergen
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: How do I include my php

Post by DeXXus »

Remove all instances of

Code: Select all

<?php
and

Code: Select all

?>
when using [PHP] [/PHP]
-----------------------------------------------------------
crenshawdesignz wrote: It did not work. Then I tried...

{php: test.php}

It did not work.
No space after colon and full path is best
{PHP:/path/to/test.php}
-----------------------------------------------------------
crenshawdesignz wrote:Do I need to make adjustments in my config file?

Code: Select all

$phpwcms["allow_remote_URL"]  = 1;        //0 = no remote URL in {PHP:...} replacement tag allowed, 1 = allowed

$phpwcms["allow_cntPHP_rt"]   = 1; //(0 = no) allow PHP replacement tags and includes in content parts
crenshawdesignz
Posts: 38
Joined: Tue 7. Mar 2006, 20:23
Location: Chicago
Contact:

Thank you.

Post by crenshawdesignz »

I have made the changes and as soon as I transfer files between my test server and production server I will tweak some more and report back.

Your help is appreciated.

While I was working with my config file I enabled gt_Mod and phpmyadmin on the backend.

Man I love this forum.
crenshawdesignz
Posts: 38
Joined: Tue 7. Mar 2006, 20:23
Location: Chicago
Contact:

Extended thank you.

Post by crenshawdesignz »

I meant to thank both of you for your assistance. Please forgive the oversight, it was not intentional. I am using a DW extension which is why the <?php connection... is listed.

I just made a very simple file but I am sure that if I get the
{PHP:tag.php} to work, I will be satisfied.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: Thank you.

Post by DeXXus »

crenshawdesignz wrote:Your help is appreciated.

While I was working with my config file I enabled gt_Mod and phpmyadmin on the backend.

Man I love this forum.
You will have to install and configure phpMyAdmin to the correct directory (/include/inc_ext/phpMyAdmin) in order for that feature (admin link to phpMyAdmin) to work! :wink:

Or modify source code of "/phpwcms.php" to point link to ~your~ installation:

Code: Select all

	if($phpwcms["phpmyadmin"]) {
			$subnav .= subnavtextext('phpMyAdmin', 'include/inc_ext/phpMyAdmin/', '_blank', 0);
Post Reply