Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
Doulos
Life Cycles Becoming CPU Cycles



Joined: Jun 06, 2005
Posts: 652

PostPosted: Thu Mar 14, 2019 11:58 am Reply with quote

Why would I need to do that? Public write access to .htaccess? I don't get these warnings on my main site (PHP5.4). All error reporting settings are the same, and file permissions are 644.

Please explain.
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1510

PostPosted: Fri Mar 15, 2019 12:32 am Reply with quote

CHMOD 666 is not a public write access, it allows only the owner of the file to write into it. My guess was that the specific user settings are incorrect or maybe the file is located on a restricted area, where the apache can not read it. Did you checked, if the path to this file is correct? Is it a local installation on XAMPP, WAMP etc?

_________________
Github: RavenNuke 
View user's profile Send private message
Doulos







PostPosted: Fri Mar 15, 2019 2:41 am Reply with quote

This is a domain on a VPS using WHM/cPanel with PHP 7.0.33. Files are in public_html just as they are in my PHP 5.4.45 install on the same server. I have never had this problem before, though this is the only domain I have tried RN with PHP7.
 
Doulos







PostPosted: Tue Mar 19, 2019 4:19 am Reply with quote

I'm an idiot - I had the path to .ftaccess wrong.
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6404

PostPosted: Tue Mar 19, 2019 9:26 am Reply with quote

I've done that many times...glad you found it!

_________________
I google, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Doulos







PostPosted: Wed May 01, 2019 4:50 am Reply with quote

I have been slowly working my way through my custom modules and updating them for PHP7, but I am stuck with this one. I thought I had this module working fine in php5.4, but I just checked my PHP5.4 version of the same website and am getting the same error.
Code:
Parse error: syntax error, unexpected 'OpenTable' (T_STRING), expecting ',' or ';' in /home/php7user/public_html/modules/Contact_Form/index.php on line 79



Here is the module:
Code:
<?php

/************************************************************************/
/* PHP-NUKE: NUKE4GAMERS Clan Join Form */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org & http://www.nuke4gamers.com */
/* */
/* Optimized for RN25x by neralex (c)2014 http://www.media.soefm.de */
/* */
/* This program is free software. You can redistribute it */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* Need help with the block then drop by http://www.nuke4gamers.com */
/************************************************************************/
 
if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
global $sitename, $user;
 
$index = 0;
if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE === true) {
$index = 1; // auto set right blocks for pre patch 3.1 compatibility
}
 
$subject = $sitename . ' ' . _JOINUS;
 
# set here your email-adresses
$sendfrom_email = 'webmaster@****.com';
$receiver_email = '*****@****.net';
 
if(!defined('_YOURAGE')) define('_YOURAGE','Age');
if(!defined('_YOURGENDER')) define('_YOURGENDER','Gender');
if(!defined('_YOURLOCATION')) define('_YOURLOCATION','Location');
if(!defined('_TELLUSMORE')) define('_TELLUSMORE','Anything else you want to tell us?');
 
if (!isset($op)) $op = '';
if (!isset($age)) $age = '';
if (!isset($gender)) $gender = '';
if (!isset($address)) $address = '';
if (!isset($city)) $city = '';
if (!isset($state)) $state = '';
if (!isset($message)) $message = '';
if (!isset($phone)) $phone = '';
if (!isset($first_name)) $first_name = '';
if (!isset($last_name)) $last_name = '';
if (!isset($other_email)) $other_email = '';
if (!isset($country)) $country = '';
if (!isset($gaming_name)) $gaming_name = '';
 
if (is_user($user)) {
$userinfo = getusrinfo($user);
$sender_name = $userinfo['username'];
$sender_email = $userinfo['user_email'];
} else {
$userinfo = false;
$sender_name = '';
$sender_email = '';
}
 
switch($op) {
 
case 'sendform':
csrf_check();
sendform($sender_name, $sender_email, $other_email, $first_name, $last_name, $address, $city, $state, $zip, $country, $phone, $age, $message);
break;
 
default:
index();
break;
 
}
 
function index() {
global $sitename, $module_name, $sender_name, $sender_email;
include_once 'header.php';
echo '<div class="display-none">', PHP_EOL # hide content, when colorbox is not open
    ,'<div id="cbox-test" class="text-center">HELLO WORLD!</div>', PHP_EOL #content of colorbox
   ,'</div>', PHP_EOL;
$cbox_test = '<script type="text/javascript">' . PHP_EOL
    . '    $.colorbox({ open:true, inline:true, href:"#cbox-test", width:"600px", height:"300px" });' . PHP_EOL
    . '</script>' . PHP_EOL;
addJSToBody($cbox_test,'inline');
OpenTable();
echo '<div class="text-center thick">' , PHP_EOL
, '<span style="font-size:20px;">' , $sitename , '</span>' , PHP_EOL
, '<br />' , PHP_EOL
, '<span style="font-size:14px;">' , _JUSTITLE , '</span>' , PHP_EOL
, '<br /><br />' , PHP_EOL
, '<span style="font-size:14px;">' , _JUSNOTE , '</span>' , PHP_EOL
, '<br /><span style="font-size:14px;">' , _JUSNOTE2 , '</span>' , PHP_EOL
, '</div>' , PHP_EOL
, '<br />' , PHP_EOL
, '<form method="post" action="modules.php?name=' , $module_name , '">' , PHP_EOL
, '<div class="">' , PHP_EOL
, '<table width="100%"><tr><td width="25%"></td><td sytle="padding-left:30px"><span class="thick">' , _YOURNAME , ':</span>&nbsp&nbsp';
if ($sender_name != '') {
echo'<span style="font-size:12px; text-decoration:bold;">' , $sender_name , '</span>';
} else {
echo '<input type="text" name="sender_name" value="" />';
}
echo '</p>' , PHP_EOL
, '<p><span class="thick">' , _YOUREMAIL , ':</span>&nbsp&nbsp';
if ($sender_email != '') {
echo'<span style="font-size:12px; text-decoration:bold;">' , $sender_email , '</span>';
} else {
echo '<input type="text" name="sender_email" value="" />';
}
echo '</p>' , PHP_EOL
, '<p><span class="thick"> Other Email :</span>&nbsp&nbsp;<input type="text" name="other_email" value="" size="40" /><br />' , PHP_EOL
, '<span class="thick"> First Name :</span>&nbsp&nbsp;<input type="text" name="first_name" value="" size="20" required /><br />' , PHP_EOL
, '<span class="thick"> Last Name :</span>&nbsp&nbsp;<input type="text" name="last_name" value="" size="20" required /><br />' , PHP_EOL
, '<span class="thick"> Address :</span>&nbsp&nbsp;<input type="text" name="address" value="" size="60" required /><br />' , PHP_EOL
, '<span class="thick"> City :</span>&nbsp&nbsp;<input type="text" name="city" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> State :</span>&nbsp&nbsp;<input type="text" name="state" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Zip Code :</span>&nbsp&nbsp;<input type="text" name="zip" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Country :</span>&nbsp&nbsp;<input type="text" name="country" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Phone # :</span>&nbsp&nbsp;<input type="text" name="phone" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Age :</span>&nbsp&nbsp;<input type="text" name="age" value="" size="3" required /><br />' , PHP_EOL
, '<tr>' , PHP_EOL
, '<td colspan="2">&nbsp;</td>' , PHP_EOL
, '</tr>' , PHP_EOL
, '</td></tr></table></div>' , PHP_EOL
, '<div class="text-center">' , PHP_EOL
, '<span class="thick">' , _TELLUSMORE , '</span>:' , PHP_EOL
, '<br />' , PHP_EOL
, '<textarea name="message" cols="70" rows="15"></textarea>' , PHP_EOL
, '</div>' , PHP_EOL
, '<br />' , PHP_EOL
, '<center>' , PHP_EOL
, '<input type="hidden" name="op" value="sendform" />' , PHP_EOL
, '<input type="submit" name="submit" value="' , _SEND , '" />' , PHP_EOL
, '</center>' , PHP_EOL
, '</div>' , PHP_EOL
, '<br />' , PHP_EOL
, '</form>' , PHP_EOL;
CloseTable();
include_once 'footer.php';
}
 
function sendform($sender_name, $sender_email, $other_email, $first_name, $last_name, $address, $city, $state, $zip, $country, $phone, $age, $message) {
global $sitename, $module_name, $op, $send, $subject, $sendfrom_email, $receiver_email;

if ($send == 'no') {

} else {
$sender_name = htmlspecialchars_decode(check_html(trim($sender_name), 'nohtml'), ENT_QUOTES);
$sender_email = htmlspecialchars_decode(check_html(trim($sender_email), 'nohtml'), ENT_QUOTES);
$location = htmlspecialchars_decode(check_html($location, 'nohtml'), ENT_QUOTES);
$message = htmlspecialchars_decode(check_html($message, 'nohtml'), ENT_QUOTES);
 
$msg = $sitename . "- Member Contact Info\r\n";
$msg .=  " " . "\r\n";
$msg .= "Forum User Name: " . $sender_name . "\r\n";
$msg .= "Registered Email: "  . $sender_email . "\r\n";
$msg .= "Name: " . $first_name . " " . $last_name ."\r\n";
$msg .= "Address: " . $address . "\r\n";
$msg .= "         " . $city . ", " . $state . " " . $zip . ", " . $country . "\r\n";
$msg .= "Phone #: " . $phone . "\r\n";
$msg .= "Age: " . $age . "\r\n";
$msg .=  " " . "\r\n";
$msg .= "Message: ". $message . "\r\n\r\n";
 
$header = 'From: ' . $sendfrom_email . "\r\n";
$header .= 'Reply-To: ' . $sender_email. "\r\n";
$header .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
$header .= 'MIME-Version: 1.0' . "\n";
$header .= 'Content-type: text/plain; charset=utf-8' . "\r\n";
 
if (@mail($receiver_email, $subject, $msg, $header)) {
include_once 'header.php';
OpenTable();
echo '<div class="text-center">' , PHP_EOL
, '<p>' , _JUSMAILSENT , '</p>' , PHP_EOL
, '<p>' , _JUSTHANKSFORCONTACT , '</p>' , PHP_EOL
, '</div>' , PHP_EOL;
CloseTable();
include_once 'footer.php';
}
}
}
?>


Any suggestions?


Last edited by Doulos on Sat May 18, 2019 10:34 pm; edited 1 time in total 
neralex







PostPosted: Wed May 01, 2019 12:23 pm Reply with quote

Just a typo at the end of a echo-string:

find:
php Code:
include_once 'header.php';echo '<div class="display-none">', PHP_EOL # hide content, when colorbox is not open    ,'<div id="cbox-test" class="text-center">HELLO WORLD!</div>', PHP_EOL #content of colorbox    ,'</div>', PHP_EOL;$cbox_test = '<script type="text/javascript">' . PHP_EOL    . '    $.colorbox({ open:true, inline:true, href:"#cbox-test", width:"600px", height:"300px" });' . PHP_EOL    . '</script>' . PHP_EOL;addJSToBody($cbox_test,'inline');


change it to:

php Code:
include_once 'header.php';

echo '<div class="display-none">', PHP_EOL # hide content, when colorbox is not open
,'<div id="cbox-test" class="text-center">HELLO WORLD!</div>', PHP_EOL #content of colorbox
,'</div>', PHP_EOL;
$cbox_test = '<script type="text/javascript">' . PHP_EOL
. ' $.colorbox({ open:true, inline:true, href:"#cbox-test", width:"600px", height:"300px" });' . PHP_EOL
. '</script>' . PHP_EOL;
addJSToBody($cbox_test,'inline');


Wink
 
Doulos







PostPosted: Wed May 01, 2019 1:11 pm Reply with quote

Thanks ... again.
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1008
Location: Netherland

PostPosted: Tue May 07, 2019 6:15 am Reply with quote

Code:
      // BB code [b]word[/b] [i]word[/i] [u]word[/u]

      if ((eregi("[b]", $comment)) AND (eregi("[/b]", $comment)) AND (substr_count("$comment","[b]") == substr_count("$comment","[/b]"))) {
         $comment = eregi_replace("\[b\]","<span style=\"font-weight: bold\">","$comment");
         $comment = eregi_replace("\[\/b\]","</span>","$comment");
      }
      if ((eregi("[i]", $comment)) AND (eregi("[/i]", $comment)) AND (substr_count("$comment","[i]") == substr_count("$comment","[/i]"))) {
         $comment = eregi_replace("\[i\]","<span style=\"font-style: italic\">","$comment");
         $comment = eregi_replace("\[\/i\]","</span>","$comment");
      }
      if ((eregi("[u]", $comment)) AND (eregi("[/u]", $comment)) AND (substr_count("$comment","[u]") == substr_count("$comment","[/u]"))) {
         $comment = eregi_replace("\[u\]","<span style=\"text-decoration: underline\">","$comment");
         $comment = eregi_replace("\[\/u\]","</span>","$comment");
      }

Guys,I am getting this error

Fatal error: Uncaught Error: Call to undefined function eregi() in:

Should I use preg_match() (with the i (PCRE_CASELESS) modifier)?
 
View user's profile Send private message Visit poster's website
neralex







PostPosted: Tue May 07, 2019 10:30 am Reply with quote

As the error message says, there is anymore a function eregi - it is deprecated and you can't use it anymore. You have to find another way.

Without to know how the content of the variable: $comment is builded, I would replace eregi(...) with preg_match(...) and eregi_replace(...) with str_replace(...)
 
hicuxunicorniobestbuildpc







PostPosted: Fri May 10, 2019 8:12 am Reply with quote

Code:
    $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` ORDER BY `id` DESC LIMIT ".$offset1.",".$aCount['aCount'];

   $nameresult = $db->sql_query($sql);
   $x = 1;
   while ($shout = $db->sql_fetchrow($nameresult)) {
      $comment = str_replace('src=', 'src="', $shout['comment']);
      $comment = str_replace('.gif>', '.gif" alt="" />', $comment);
      $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment);
      $comment = str_replace('.png>', '.png" alt="" />', $comment);
      $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment);
      $comment = str_replace("http:", "".$sbURL."http:", $comment);
      $comment = str_replace("ftp:", "".$sbURL."ftp:", $comment);

      // BB code [b]word[/b] [i]word[/i] [u]word[/u]
      if ((preg_match("[b]", $comment)) AND (preg_match("[/b]", $comment)) AND (substr_count("$comment","[b]") == substr_count("$comment","[/b]"))) {
         $comment = str_replace("\[b\]","<span style=\"font-weight: bold\">","$comment");
         $comment = str_replace("\[\/b\]","</span>","$comment");
      }
      if ((preg_match("[i]", $comment)) AND (preg_match("[/i]", $comment)) AND (substr_count("$comment","[i]") == substr_count("$comment","[/i]"))) {
         $comment = str_replace("/\[i\]/i","<span style=\"font-style: italic\">","$comment");
         $comment = str_replace("/\[\/i\]/i","</span>","$comment");
      }
      if ((preg_match("[u]", $comment)) AND (preg_match("[/u]", $comment)) AND (substr_count("$comment","[u]") == substr_count("$comment","[/u]"))) {
         $comment = str_replace("\[u\]i","<span style=\"text-decoration: underline\">","$comment");
         $comment = str_replace("\[\/u\]i","</span>","$comment");
      }
 
hicuxunicorniobestbuildpc







PostPosted: Fri May 10, 2019 8:12 am Reply with quote

I am not getting more errors but I guess something is wrong.
 
neralex







PostPosted: Fri May 10, 2019 11:34 pm Reply with quote

ZIP or RAR this script with all related files and send a download link via PM. I will check it.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©