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.

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,

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.

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  >:(

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.