Jump to content

[SOLVED] include .php-file with includes (array not working)


willdk

Recommended Posts

??? I have two php files.

 

index.php with an include:

<?php include "/web/site/domains/mydomain.tld/public_html/include-me.php"; ?>

 

include-me.php:

<?php

$arrPHP = array();
$arrPHP[] = '.$from = array("<a href=, ","spam");
$to = array("","");
$page = "/web/site/domains/mydomain.tld/public_html/files/test.php";
........
echo $result;.'

echo $arrPHP;
?>

 

Why is this not working? I want to execute the php script, using an include.

Link to comment
Share on other sites

Your code makes no sense. Why you putting PHP code within an array? PHP is not executed from within strings. You need to use eval in order for code within strings to execute.

 

Also as $arrPHP is an array, just echo'ing it on its own will result in Array being displayed,

Link to comment
Share on other sites

Your code makes no sense. Why you putting PHP code within an array? PHP is not executed from within strings. You need to use eval in order for code within strings to execute.

 

Also as $arrPHP is an array, just echo'ing it on its own will result in Array being displayed,

'eval' is new to me. Thank you :) I try to convert the code to work with this function.

Link to comment
Share on other sites

Why is your PHP code within an array in the first place?

I saw a script with php include in the array. So I thought I could make that script work in that way. Sometimes I think I now the basics of php, but then I realise I'm still a html-guy ;D

 

I'm still trying out that eval function. There goes my day  >:(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.