Jump to content

Recommended Posts

Hello everyone..

 

i am new to the forum but i'm sure i will be staying here a long time since i've just started with php and i find it really wonderfull!

 

Anyway, i want to first pardon my english but i am an italian user, then i will like to submit you all my issue..

 

i have this webpage.. let's say its the index.php page (even thought its not) where i have about 400lines written.. i was trying to modulate a bit the code so that i could separate parts of it into some smaller php files and then simply include them into the mainpage..

 

this is the setup: index.php contains about 400lines of code and at the very beggining, right after <body> i have 2 functions i wrote which are:

 

// Function to change user powers

if(isset($_GET['valore']) && isset($_GET['id']))

if(($_SESSION['permessi'])==3)

{

$valore = $_GET['valore'];

$id = $_GET['id'];

$change_powers = "UPDATE table_name SET powers = '".$valore."' WHERE id = '".$id."'";

mysql_query($change_powers) or die('Errore Inserimento dati!!');

header("location: linkpage");

}

 

// Function to cancel user

if(isset($_GET['del']) && isset($_GET['id']))

if((($_SESSION['permessi'])==3)||(($_SESSION['permessi'])==2))

{

$id = $_GET['id'];

$del_account = "DELETE FROM table_name WHERE id = '".$id."'";

mysql_query($del_account) or die('Errore Cancellazione Utente!!');

header("location: linkpage");

}

 

if i keep all this functions in the mainpage e dont get any error back.. if i keep both functions together in another php file and i include them in the mainpage i dont get any error aswell.. but when i make 2 different php files where i write into 1 the first function and in the 2° the other i receive this warning error but the page loads anyway..

 

Warning: include(include/solo2) [function.include]: failed to open stream: No such file or directory in /home/.../public_html/page.php on line 20

 

Warning: include() [function.include]: Failed opening 'include/solo2' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/.../public_html/page.php on line 20

 

i would like to understand what difference there is in having 1 files with both functions included into the mainpage and having 2 files for every single functions included into the mainpage?

 

functions are written in the other files with <? ?> at the start and end of the functions while in the mainpage are included like this:

<?

include 'function1.php';

include 'function2.php';

?>

 

using PHP4 btw..

 

thanks for any help!

Simone

 

Link to comment
https://forums.phpfreaks.com/topic/175512-problem-modulating-a-php-file/
Share on other sites

Warning: include(include/solo2) [function.include]: failed to open stream: No such file or directory in /home/.../public_html/page.php on line 20

 

that error means that whatever page you are trying to include could not be found at the path specified. Make sure that your file name and file path are correct

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.