<?xml version="1.0"?>
<rss version="2.0"><channel><title>Scripting Talk Latest Topics</title><link>https://forums.totalchoicehosting.com/forum/64-scripting-talk/</link><description>Scripting Talk Latest Topics</description><language>en</language><item><title>php mail () has me banging my head off the wall</title><link>https://forums.totalchoicehosting.com/topic/48042-php-mail-has-me-banging-my-head-off-the-wall/</link><description><![CDATA[<p>
	Hi All,
</p>

<p>
	I'm fairly new to this, and trying to get a action.php to process a form and send an email to the user.  
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">//$EmailAddress is set by a form input
//$sendFrom is set by the refering form
//$body is build by form inputs and other information
//$subject is build by refering page
$headers = "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: " . $sendFrom ."\n";
$headers .= "Reply-to:" . $sendFrom ."\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-Mailer: PHP4\n";
if (mail($EmailAddress, $subject, $body, $headers)){
print "</span><span class="tag">&lt;a</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">'login.php'</span><span class="tag">&gt;</span><span class="pln">Login</span><span class="tag">&lt;/a&gt;&lt;br&gt;</span><span class="pln">";
	 print "Your password was emailed to you. Please check your email within a few minutes.";

 }
 else{
	 print "Your password could not be emailed.. Please contact your system admin or try again.";
	 exit;
 }</span></pre>

<p>
	With the if statement in, all it does is spin with no email sent.  When I comment out the if block, the form works.  
</p>

<p>
	Any suggestions on how to fix this?
</p>
]]></description><guid isPermaLink="false">48042</guid><pubDate>Sun, 26 Jan 2025 01:48:05 +0000</pubDate></item><item><title>Python on Shared Hosting</title><link>https://forums.totalchoicehosting.com/topic/47912-python-on-shared-hosting/</link><description><![CDATA[<p>
	Hi, firstly can I use Python on shared hosting?  I don't see it installed on the software section of Cpanel.  Reading through the forums I saw it was an option at one time, and I'd like to know if that's still the case. 
</p>

<p>
	I have two Python files installed in my cgi-bin, permissions were set to 755 when I initially sent out a help ticket earlier today, however I noticed now that permissions are set to 644 after speaking with the technician.  One file is saved as .cgi and one is .py, both contain the same script.
</p>

<p>
	My skill level is beginner and I'm trying my best to connect a mailing list form to a mysql database.  My database is setup, and according to the technician my credentials supplied were working and there was a successful connection when he attempted using them with a php script.
</p>

<p>
	Here is my script, with placeholders for the actual credentials.
</p>

<p>
	from flask import Flask, request, jsonify<br />
	import mysql.connector
</p>

<p>
	app = Flask(__name__)
</p>

<p>
	# MySQL database connection<br />
	db = mysql.connector.connect(<br />
	    host="/home/xxxxxxx",<br />
	    user="xxxxxxx_test",<br />
	    password="xxxxxxx123",<br />
	    database="xxxxxxx_newsletter_list"<br />
	)<br />
	cursor = db.cursor()
</p>

<p>
	@app.route('/subscribe', methods=['POST'])<br />
	def subscribe():<br />
	    data = request.json<br />
	    first_name = data['firstName']<br />
	    email = data['email']
</p>

<p>
	    # Insert data into the database<br />
	    cursor.execute("INSERT INTO subscribers (first_name, email) VALUES (%s, %s)", (first_name, email))<br />
	    db.commit()
</p>

<p>
	    return jsonify({"message": "Subscription successful!"})
</p>

<p>
	if __name__ == '__main__':<br />
	    app.run(debug=False)
</p>

<p>
	<br />
	I would like to use environment variables, however firstly it would be nice to see if I can make the basic newsletter signup form function.  Doing some research, I also discovered maybe there should be a shebang line used, i.e. #!/usr/bin/env python3, and at this point I'm not even smart enough to know if that shebang line should be altered with my credentials where the usr segment is located.  Any thoughts appreciated.
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">47912</guid><pubDate>Sun, 03 Dec 2023 22:53:53 +0000</pubDate></item><item><title>Anyone Use ConcreteCMS? I have an issue, you may have an issue also.</title><link>https://forums.totalchoicehosting.com/topic/47721-anyone-use-concretecms-i-have-an-issue-you-may-have-an-issue-also/</link><description><![CDATA[<p>
	Wondering if there is anyone else at <abbr title="TotalChoice Hosting">TCH</abbr> using concreteCMS?
</p>

<p>
	I have used concrete for years, though I am far from an expert. Suddenly an issue has come up where ModSecurity is blocking some page edits. <strong>I can not edit a block using an inline CSS style. When I try to save, a "403 Forbidden" error is returned.</strong> <abbr title="TotalChoice Hosting">TCH</abbr> and my testing show that ModSecurity is the issue. I have been advised to ask <abbr title="TotalChoice Hosting">TCH</abbr> to modify ModSecurity rules to allow but <abbr title="TotalChoice Hosting">TCH</abbr> says they can not do such a thing due to security issues. I can turn ModSecurity off and the edits will work, but that does not seem like the proper thing to do.
</p>

<p>
	This issue exists with a fresh install of the newest version, 9.1.1 installed today via softaculous, an install that used 8.5.6, the same 8.5.6 upgraded to 9.1.1, and a 5.6.4.0 version, every install I have at <abbr title="TotalChoice Hosting">TCH</abbr> (all on the same shared server). I don't have access to another host company at the moment so can not test off of <abbr title="TotalChoice Hosting">TCH</abbr> servers. 
</p>

<p>
	<strong>Does anyone else have this issue?</strong>
</p>

<p>
	It appears to me that this issue makes concreteCMS useless on a <abbr title="TotalChoice Hosting">TCH</abbr> server.
</p>

<p>
	Thank you for any replies.
</p>
]]></description><guid isPermaLink="false">47721</guid><pubDate>Sat, 11 Jun 2022 21:51:45 +0000</pubDate></item><item><title>Can I run Python/Selenium on TCH?</title><link>https://forums.totalchoicehosting.com/topic/47524-can-i-run-pythonselenium-on-tch/</link><description><![CDATA[<p>
	I have developed a Python/Selenium script to automate some web operations that I need to do. I have this successfully running on my local PC. Can I upload this to <abbr title="TotalChoice Hosting">TCH</abbr> and run it there, so that I can then give other users access to it? This would seem to require a browser (I'm currently using Chrome) to be running on <abbr title="TotalChoice Hosting">TCH</abbr> (maybe headlessly) so that Selenium can send commands to it. Can this be done? How?
</p>

<p>
	Thanks - Rowan
</p>
]]></description><guid isPermaLink="false">47524</guid><pubDate>Thu, 01 Oct 2020 14:24:02 +0000</pubDate></item><item><title>Imagecolortransparent Not Working</title><link>https://forums.totalchoicehosting.com/topic/29752-imagecolortransparent-not-working/</link><description><![CDATA[
<p>Anyone know why imagecolortransparent doesn't seem to work on TC servers? I'm working on new CAPTCHA for Lazarus and the image works fine on my test server but after uploading it to my web space the transparency stopped working as can be seen at <a href="http://carbonize.co.uk/Lazarus/captchatest.php" rel="external">http://carbonize.co.uk/Lazarus/captchatest.php</a></p>
<p>According to php.net this function has been supported since PHP 3.</p>
<p> </p>
<p></p>
<pre class="ipsCode">&gt;// create an image with width 120px, height 20px
$image = imagecreatetruecolor(200, 40);

// Assign a background colour
$background = imagecolorallocate($image, 190,190,190);

// Fill it in with the background colour
imagefilledrectangle($image, 0, 0, 199, 39, $background);

// Make the background transparent
imagecolortransparent($image, $background);</pre>
<div></div>
<p></p>
]]></description><guid isPermaLink="false">29752</guid><pubDate>Fri, 06 Oct 2006 17:17:55 +0000</pubDate></item><item><title>Sessions getting lost</title><link>https://forums.totalchoicehosting.com/topic/47434-sessions-getting-lost/</link><description><![CDATA[
<p>
	I'm having a problem on a website that I develop. It seems that sometimes when I call session_start(), it fails to find a previously opened session, and opens a new one, which means that I lose all my session variables. Here's a section of log:
</p>

<p>
	[27-Feb-2020 17:39:43.496 GMT 0] on localhost,  L_TRACE MemberId 18 attempted to login with PasswordStatus = 4                           at line 169   in file: /home/sylvest/public_html/swchoir/do_login.php<br />
	<strong>[27-Feb-2020 17:39:43.497 GMT 0] on localhost,  L_TRACE Session ID = qdgs4obtlicrlcgnp6tc179e87, $_SESSION = {"breadcrumbs":[{"shortname":"Login", "filename":"index.php"}], "request_index":2, "test_mode":0, "username_entered":"sasb", "login_member":null, "login_memberid":"18", "login_name":"Sue<br />
	Sylvester-Bradley", "auth_level":0, "return_page":"\/swchoir\/do_login.php", "edit_member_msg":"Your password has expired,  and you need to choose a new one before you can access these pages. Please<br />
	do that now.", "edit_memberid":"18", "edit_member_mode":"change_password"} at line 319 in file: /home/sylvest/public_html/swchoir/do_login.php</strong><br />
	[27-Feb-2020 17:39:43.497 GMT 0] on localhost,  L_TRACE Send cookie username_entered:sasb succeeded                                      at line 334   in file: /home/sylvest/public_html/swchoir/do_login.php<br />
	[27-Feb-2020 17:39:43.497 GMT 0] on localhost,  L_TRACE $to_page = edit_member.php?v=1582819873                                          at line 1200  in file: /home/sylvest/include/functions.php<br />
	    Called from redirect(edit_member.php?v=1582819873) at line 339 in file /home/sylvest/public_html/swchoir/do_login.php<br />
	[27-Feb-2020 17:39:43.497 GMT 0] on localhost,  L_TRACE Redirecting to Location: https://sylvesterbradley.org/swchoir/edit_member.php?v=1582819873 using header at line 1201 in file: /home/sylvest/include/functions.php<br />
	    Called from redirect(edit_member.php?v=1582819873) at line 339 in file /home/sylvest/public_html/swchoir/do_login.php<br />
	[27-Feb-2020 17:39:43.817 GMT 0] on  L_TRACE Started file                                                                                at line 37    in file: /home/sylvest/public_html/swchoir/edit_member.php<br />
	[27-Feb-2020 17:39:43.817 GMT 0] on  L_TRACE Started file                                                                                at line 5     in file: /home/sylvest/include/basic_init.php<br />
	[27-Feb-2020 17:39:43.817 GMT 0] on  L_TRACE Started file                                                                                at line 4     in file: /home/sylvest/include/functions.php<br />
	[27-Feb-2020 17:39:43.817 GMT 0] on  L_TRACE Started file                                                                                at line 13    in file: /home/sylvest/include/log_functions.php<br />
	[27-Feb-2020 17:39:43.818 GMT 0] on ,  L_TRACE Resumed file                                                                              at line 9     in file: /home/sylvest/include/functions.php<br />
	    Called from require_once(/home/sylvest/include/functions.php) at line 129 in file /home/sylvest/include/basic_init.php<br />
	    Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php<br />
	[27-Feb-2020 17:39:43.818 GMT 0] on ,  L_TRACE Resumed file                                                                              at line 140   in file: /home/sylvest/include/basic_init.php<br />
	    Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php<br />
	<strong>[27-Feb-2020 17:39:43.818 GMT 0] on ,  L_TRACE session_status() = PHP_SESSION_NONE                                                       at line 782   in file: /home/sylvest/include/functions.php<br />
	    Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php<br />
	    Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php</strong><br />
	[27-Feb-2020 17:39:43.818 GMT 0] on ,  L_TRACE No session is active                                                                      at line 789   in file: /home/sylvest/include/functions.php<br />
	    Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php<br />
	    Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php<br />
	<strong>[27-Feb-2020 17:39:43.819 GMT 0] on ,  L_TRACE Session ID 5ks74rcukqqbkjdhchiru310q3 is now active, RemoteIp = 90.251.34.221             at line 804   in file: /home/sylvest/include/functions.php<br />
	    Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php<br />
	    Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php</strong><br />
	[27-Feb-2020 17:39:43.819 GMT 0] on ,  L_TRACE Session ID = 5ks74rcukqqbkjdhchiru310q3, $_SESSION = []                                   at line 805   in file: /home/sylvest/include/functions.php<br />
	    Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php<br />
	    Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php
</p>

<p>
	In the first bolded section, you can see that session ID qdgs4obtlicrlcgnp6tc179e87 is active, and that there are all sorts of session variables set.
</p>

<p>
	In the second bolded session, session_status() returned PHP_SESSION_NONE, so when I called session_start() it created a new session 5ks74rcukqqbkjdhchiru310q3 and all my session variables have gone.   
</p>

<p>
	What am I doing that is causing the session to be lost? How do I make sure that when I call session_start() it retrieves any previous session if there is one, and does not create a new one? Can I implement my own version of session_start() and thus see exactly what it is doing and put in logic to prevent this error? What exactly does session_start() do?
</p>

<p>
	Thank you - Rowan                                          ,
</p>
]]></description><guid isPermaLink="false">47434</guid><pubDate>Thu, 27 Feb 2020 17:54:03 +0000</pubDate></item><item><title>How to enable rewrite logging on TCH</title><link>https://forums.totalchoicehosting.com/topic/47303-how-to-enable-rewrite-logging-on-tch/</link><description><![CDATA[
<p>
	I'm trying to debug some rewrite rules, without much success currently. If I could see the log, showing what text was used to match conditions in Rewrite Cond and Rewrite Rule statements, and what the result was, I would be more likely to be able to find the error. I have tried enabling logging in the .htaccess file and it says  "ErrorLog not allowed here". How do I enable rewrite logging on <abbr title="TotalChoice Hosting">TCH</abbr>? If I can't, how do I debug my rules?
</p>

<p>
	Thanks - Rowan
</p>
]]></description><guid isPermaLink="false">47303</guid><pubDate>Fri, 07 Jun 2019 17:41:58 +0000</pubDate></item><item><title>Still using old SQL query</title><link>https://forums.totalchoicehosting.com/topic/47249-still-using-old-sql-query/</link><description><![CDATA[
<p>
	In my web application, I am trying to execute the SQL query:
</p>

<p>
	SELECT b.BuildNum,c.MenuName FROM `Members$BuildClasses` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = " . $_SESSION['login_memberid'] . " AND b.Status &gt; '0' AND mc.Status &gt; '0' ORDER BY BuildNum
</p>

<p>
	by executing the statement:
</p>

<p>
	$result = mysqli_query($dbh, $sql); on line 444 in file: /home/sylvest/include/functions.php (where $sql is equal to the above string)
</p>

<p>
	When I do this I'm getting this error:
</p>

<p>
	[26-Feb-2019 12:40:23.516 GMT 0] on localhost, L_ERROR Failed to query database, \$result is False, SQL = {SELECT b.BuildNum,c.MenuName FROM `Members` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = 4 AND b.Status &gt; '0' AND mc.Status &gt; '0' ORDER BY BuildNum}, Errno: 1054 Error: Unknown column 'mc.BuildClassId' in 'on clause' at line 444 in file: /home/sylvest/include/functions.php Called from checked_query(SELECT b.BuildNum,c.MenuName FROM `Members` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = 4 AND b.Status &gt; '0' AND mc.Status &gt; '0' ORDER BY BuildNumbuilds that this user may access) at line 254 in file /home/sylvest/include/header.php Called from require(/home/sylvest/include/header.php) at line 65 in file /home/sylvest/public_html/swchoir/welcome.php 
</p>

<p>
	From this it seems that MySQL is executing the query on the table `Members` instead of `Members$BuildClasses`, which is why it can't find the 'mc.BuildClassId' field. An earlier version of the code DID request the table `Members` but I changed it several days ago.
</p>

<p>
	Why is it still using the old version of the code?
</p>

<p>
	Is there any caching system in place for this type of code? If so, what exactly is cached, and where? How do I force it to update the cache?
</p>

<p>
	Or what other reason might there be for this error?
</p>

<p>
	Thanks - Rowan
</p>
]]></description><guid isPermaLink="false">47249</guid><pubDate>Tue, 26 Feb 2019 18:23:59 +0000</pubDate></item><item><title>Loading PHP modules in CPanel</title><link>https://forums.totalchoicehosting.com/topic/47247-loading-php-modules-in-cpanel/</link><description><![CDATA[
<p>
	My site uses the function json_encode(). Previously I had my own php.ini file that included the line "extension = json.so". Everything used to work fine. But for a different reason I had to stop using my PHP.INI file and start using one generated by CPanel. Now I'm getting the error "<b style="color:#000000;font-size:medium;">Fatal error</b><span style="color:#000000;font-size:medium;">: Call to undefined function json_encode() in<span> </span></span><b style="color:#000000;font-size:medium;">/home/sylvest/include/var_dump_ret.php</b><span style="color:#000000;font-size:medium;"><span> </span>on line<span> </span></span><b style="color:#000000;font-size:medium;">16". The CPanel generated INI file does not contain the line </b>"extension = json.so" and I guess that this is why it's stopped working. So my question is, how either using CPanel or within my PHP code do I load the module JSON? Web searches say there should be a command Select PHP Version within CPanel that allows this to be done, but <abbr title="TotalChoice Hosting">TCH</abbr>'s version doesn't seem to have this. I guess <abbr title="TotalChoice Hosting">TCH</abbr> did not include this in their configuration. So how do I add any modules that I need?
</p>

<p>
	Thanks - Rowan
</p>
]]></description><guid isPermaLink="false">47247</guid><pubDate>Thu, 21 Feb 2019 12:59:43 +0000</pubDate></item><item><title>Best way to send files to client</title><link>https://forums.totalchoicehosting.com/topic/47073-best-way-to-send-files-to-client/</link><description><![CDATA[
<p>
	I have a requirement for my PHP pages sometimes to send files (e.g. images, CSS files, JS files, fonts) to the client. The normal way to do this seems to be to use the readfile() function, but I understand that this reads the whole file into memory and then sends it to the client, which will cause problems if it is a very large file. I understand that there is an Apache module <font face="Verdana, Arial, Helvetica" size="2"><font color="#222222" face="Verdana, Arial, Helvetica" size="2">mod_xsendfile which does a better job, but Support tell me that this is not available on my shared server. So my question is, what is the best/most efficient way of sending files to the client in PHP, without mod_xsendfile? Do I have to write a loop that reads the file a few K at a time and sends each chunk to the client before reading the next?</font></font>
</p>

<p>
	<font face="Verdana, Arial, Helvetica" size="2"><font color="#222222" face="Verdana, Arial, Helvetica" size="2">If so, has anyone got this code already working that they would be happy to share with me, to save a bit of time?</font></font>
</p>

<p>
	<font face="Verdana, Arial, Helvetica" size="2"><font color="#222222" face="Verdana, Arial, Helvetica" size="2">Thanks - Rowan</font></font>
</p>
]]></description><guid isPermaLink="false">47073</guid><pubDate>Mon, 21 May 2018 13:36:58 +0000</pubDate></item><item><title>Too Many Inputs In Html Form</title><link>https://forums.totalchoicehosting.com/topic/46924-too-many-inputs-in-html-form/</link><description><![CDATA[
<p>Hi,</p>
<p> </p>
<p>I have an HTML form with a large number of inputs on it. Most of them are &lt;select&gt; elements each with 6 options. There are currently 1295 of these selects, plus a few other inputs, but the number is not constant, since the form is generated dynamically, and it depends on the number of rows and the number of columns for the currently selected period. In the $_POST array it seems that I am only receiving 1000 values, which means that some of the ones I need I am not receiving. I have tried changing the value of max_input_vars in /home/myaccount/public_html/php.ini from 1000 to 10000, but this does not seem to have improved anything. Do I have to do anything (e.g. restart the server) for it to read this file? Or is this the wrong way of changing this limit? Or do I need to reduce the number of inputs in some way (it's not easy to see a way to do this without a lot of Javascript, which I have been trying to avoid).</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">46924</guid><pubDate>Sat, 06 Jan 2018 17:13:34 +0000</pubDate></item><item><title>Error_Log Started Appearing In All Sub-Folders With Php Scripts Oct 3 </title><link>https://forums.totalchoicehosting.com/topic/46471-error_log-started-appearing-in-all-sub-folders-with-php-scripts-oct-3/</link><description><![CDATA[
<p>This is the problem I've encountered, and I'm wondering if anyone else here is seeing the same thing. I program PHP/MySQL sites, and since my TCH server was migrated to the new cPanel &amp; PHP versions in February, I have been using the cPanel MultiPHP INI Editor (as I was told this was the new way of doing it after all my sites broke) to set my PHP version and configure specific PHP variables I needed for my site - like file_uploads, upload_max_filesize and a custom error_log so I can have one central file stored outside the public_html to collect any scripting errors. All was fine until last night around 9:20pm. Suddenly, in all sub-folders containing PHP scripts of all the sites I have on the server, I'm getting a generated "error_log" file with an error generated on every single script execution:</p>
<p> </p>
<p>[03-Oct-2017 21:21:38 America/Detroit] PHP Warning:  Module 'imagick' already loaded in Unknown on line 0<br /> </p>
<p>I contacted support about this, and was able to resolve it on one site, but the solution isn't ideal as it means changing the setup of every site I have. They suggested to bypass the cPanel MultiPHP INI Editor of the site by modifying my .htaccess file to reference a custom php.ini file using suPHP_ConfigPath, then upload a full php.ini file with the modifications I need. Yes, this seems to solve the problem, but now I have to convert all my sites back to the method that was in place *before* the server upgrade in February. Yet everything was peachy until last night - so I'm thinking this is relating to a cPanel software update and not due to a coding change on my part since it is even occurring on sites I haven't edited in weeks.</p>
<p> </p>
<p>Is this happening to anyone else? Does anyone know why, or how to stop the deluge of error_log files popping up in every sub-folder? I'm just trying to figure out what is the best approach to this before I spend the time converting all my sites back to custom php.ini files.</p>
]]></description><guid isPermaLink="false">46471</guid><pubDate>Thu, 05 Oct 2017 00:23:59 +0000</pubDate></item><item><title>Mysql Syntax Being Rejected</title><link>https://forums.totalchoicehosting.com/topic/46142-mysql-syntax-being-rejected/</link><description><![CDATA[
<p>I have the following SQL being executed by a mysqli_query() statement in my PHP code:</p>
<p> </p>
<p>DROP TEMPORARY TABLE IF EXISTS tmptable; CREATE TEMPORARY TABLE tmptable SELECT * FROM Members WHERE MemberId = '105' AND Status &gt; '0'; UPDATE tmptable SET RecordId = '', Status = '0', ChangedBy = '4', ChangedOn = '2017-05-21 19:03:39'; UPDATE Members SET Status = '0' WHERE MemberId = '105' AND Status &gt; '0'; INSERT INTO Members SELECT * FROM tmptable;</p>
<p> </p>
<p>It is being rejected with the following error:</p>
<p> </p>
<p>Errno: 1064 Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TEMPORARY TABLE tmptable SELECT * FROM Members WHERE MemberId = '105' AND' at line 1 at line 952 in file: /home/sylvest/public_html/swchoir/edit_member.php</p>
<p> </p>
<p>If I put the same SQL into the SQL tab in phpMyAdmin, it works fine.</p>
<p> </p>
<p>What do I have to do to make this work in my PHP code?</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">46142</guid><pubDate>Sun, 21 May 2017 18:50:13 +0000</pubDate></item><item><title>Trouble With Header() Redirect On My Php Page</title><link>https://forums.totalchoicehosting.com/topic/45989-trouble-with-header-redirect-on-my-php-page/</link><description><![CDATA[
<p>I have a web page which under certain conditions forwards to another one using the statement:</p>
<p> </p>
<p>header($next_page);</p>
<p> </p>
<p>where $next_page == "Location: <a href="http://www.sylvesterbradley.org/swchoir/index.php?v=1493894983" rel="external">http://www.sylvesterbradley.org/swchoir/index.php?v=1493894983"</a></p>
<p> </p>
<p>This causes a 500 error.</p>
<p> </p>
<p>I am reasonably sure that I have sent no output at all (other than to a log file) before the header statement. In any case, on other occasions where I have done this I seem to get a warning, which in this case is not happening.</p>
<p> </p>
<p>I see nothing in any error_log files that I am aware of (that is /home/sylvest/error_log and /home/sylvest/pubic_html/swchoir/error_log) nor do I see anything relevant in the cPanel Errors list.</p>
<p> </p>
<p>What am I doing wrong? How can I debug what is happening? I have a log statement early in the redirected-to file (index.php) and this does not seem to be being triggered, so I don't think it is ever executing this file.</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">45989</guid><pubDate>Thu, 04 May 2017 11:53:07 +0000</pubDate></item><item><title>Why Am I Getting "class 'passwordhash' Not Found" In P</title><link>https://forums.totalchoicehosting.com/topic/45945-why-am-i-getting-class-passwordhash-not-found-in-p/</link><description><![CDATA[
<p>I am trying to use the PHP password hashing module in my code, but the following line:</p>
<p>$hasher = new PasswordHash(8, false);</p>
<p>is giving me the error:</p>
<p><b>Fatal error</b>: Class 'PasswordHash' not found in <b>/home/myaccount/public_html/directory/edit_member.php</b> on line <b>124</b></p>
<p> </p>
<p>I am running PHP version 5.6.30. I thought that all versions from 5.5.0 onwards had this module? What do I have to do to enable me to use this?</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">45945</guid><pubDate>Thu, 27 Apr 2017 17:53:42 +0000</pubDate></item><item><title>Running Php File From Cron Job</title><link>https://forums.totalchoicehosting.com/topic/45851-running-php-file-from-cron-job/</link><description><![CDATA[<p> Is it possible to run a PHP program from a cron job? I am trying to do this, and have set up a cron job to run<br />       /home/myaccount/include/do_email.php<br /> once per day at 3am. It attempts to do it, but fails as follows:<br />      [06-Apr-2017 20:49:33 America/Detroit] PHP Warning: require_once(basic_init.php): failed to open stream: No such file or directory in /home/xxxx/public_html/swchoir/index.php on line 2<br />      [06-Apr-2017 20:49:33 America/Detroit] PHP Fatal error: require_once(): Failed opening required 'basic_init.php' (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /home/xxxx/public_html/swchoir/index.php on line 2<br /><br /> My first question is, why is it trying to run index.php, which is my default page, but is not involved in do-email.php at all, as far as I can see.<br /><br /> The second question is why is the include path set to '.:/opt/cpanel/ea-php56/root/usr/share/pear'?<br /><br /> I have the following in my php.ini file:<br /> include_path = ".:/home/myaccount/include:/usr/lib/php:/usr/local/lib/php"<br /><br /> Which works fine when running the PHP files as part of web pages, but it seems that this is not working in a cron job.<br /><br /> I hope you can help me put my finger on why this is not working.<br /><br /> Thank you - Rowan<br /><br /> </p>]]></description><guid isPermaLink="false">45851</guid><pubDate>Mon, 10 Apr 2017 10:34:36 +0000</pubDate></item><item><title>Getting Mod_Rewrite To Work</title><link>https://forums.totalchoicehosting.com/topic/45910-getting-mod_rewrite-to-work/</link><description><![CDATA[
<p>I am trying to come up with a way of redirecting all requests for files in the directory <a href="http://mydomain/swchoir/" rel="external">http://mydomain/swchoir/</a>&lt;filename&gt; to the file with the same name (and the same GET parameters if present) in the directory /home/myaccount/build00001/public_html/swchoir/&lt;filename&gt;. <br /><br />My end objective is to allow the server to contain several different builds and for people who have the necesary permissions to be able to choose which one they want to look at, so for example I could have one build that is on public release, another that is in QA, and a third which is in development. Ordinary users would only be able to see the public release one. QA people would be  able to see either the public release or the QA build. And developers would be able to see all of them.<br /><br />As a step towards this, I am trying to develop some rewrite rules that will send _all_ users to build00001. The lines I have added to the .htaccess file in /home/sylvest/public_html are:</p>
<pre class="ipsCode prettyprint">
SetEnvIfExpr True build_num=00001
Rewrite Rule ^swchoir/([0-9a-z/\.?&amp;_=-]+)$ /home/myaccount/buildbuild_num/public_html/swchoir/$1 [NC, L]
php_value include_path ".:/home/myaccount/buildbuild_num/include"
</pre>
<p>Now when I try to access a page I get an internal server error.<br /><br />Please can you suggest what is wrong with my rule, or how to best get this to do what I want? In particular I'm not sure how to use the Environmental Variable build_num that I have tried to define. I'm not sure whether "SetEnvIfExpr True" is valid, and I'm not sure whether "sylvest/buildbuild_num/public_html" is a valid way of using the variable. Seems unlikely, but I'm not sure whether it needs some kind of quotes to indicate that it is a variable name, and if so, what kind.<br /><br />If you know a better way of doing the whole job, please tell me that too. It seems odd to me that something like this doesn't already exist somewhere, since it surely must be a commmon need.<br /><br />Thanks - Rowan<br /><br /><br /> </p>
]]></description><guid isPermaLink="false">45910</guid><pubDate>Thu, 20 Apr 2017 18:21:18 +0000</pubDate></item><item><title>Times Reported By Server In Php Don't Recognise Dst</title><link>https://forums.totalchoicehosting.com/topic/45839-times-reported-by-server-in-php-dont-recognise-dst/</link><description><![CDATA[<p>Hi,<br /><br />The web pages that I am currently writing (in PHP) report errors including a timestamp to the file /home/xxxxxxx/logs/main.log. The times reported are UTC. I have the following in my PHP:<br />date_default_timezone_set("Europe/London");<br />which I believe should set it to use the stated timezone throughout my site, which should (I think) recognise DST, so should now report UTC +01:00. It is not doing so.<br />I thave changed the PHP code that writes to the log file to this:<br />$logmsg = gmdate("[d-M-Y H:i:s e I P T] ") . "on " . $hostname . " " ....<br />and it is now outputting:<br />[06-Apr-2017 16:19:50 UTC 0 +00:00 GMT] on localhost L_TRACE  at line 96 ....<br /><br />from which you can see that it thinks it is outputting UTC. I think the problem is that it is just not switching to the timezone I have requested.<br /><br />Please can you suggest why it is not outputting GMT/DST, i.e. UTC +01:00, or what I need to do to find out what is causing this problem?<br /><br />Thank you - Rowan<br /> </p>]]></description><guid isPermaLink="false">45839</guid><pubDate>Thu, 06 Apr 2017 16:42:02 +0000</pubDate></item><item><title>Access A Different Session's $_Session Variables</title><link>https://forums.totalchoicehosting.com/topic/45699-access-a-different-sessions-_session-variables/</link><description><![CDATA[
<p>Does anyone know how to access the session variables of a different session, in PHP?. The reason I need to do this is that I am accessing most pages on my website via a domain name, such as <a href="http://www.mydomain.com/login.php" rel="external">http://www.****/login.php</a>. However, the form on the login.php page where the username and password are entered uses <a href="https://hostname.tchmachines.com/~username/do_loginphp" rel="external">https://hostname.tchmachines.com/~username/do_loginphp</a> as its Action page because I must use SSL for this to ensure that my usernames and passwords are not sent over the net in open text. This means that do_login.php is running in a different session from login.php, so I can't use the $_SESSION array to pass values from one to the other. If I pass the PHPSESSIONID of the original unencrypted session to the do_login.php page via a GET or POST variable, what I am trying to find out is, how would I then read and write values from/to the original $SESSION array?</p>
<p> </p>
<p>Thank you - Rowan</p>
]]></description><guid isPermaLink="false">45699</guid><pubDate>Thu, 02 Mar 2017 09:54:17 +0000</pubDate></item><item><title>Debugging "too Many Open Files" Error</title><link>https://forums.totalchoicehosting.com/topic/45557-debugging-too-many-open-files-error/</link><description><![CDATA[
<p>I'm getting an error where my web page fails to do an fopen() function with the error message "too many open files". I suspect that the problem is that I am not closing some files that I should be, or that my program is getting stuck in a loop, opening files ad infinitum. But to debug this I would like to see a list of all the open files, so I can work out where they are being opened and where they ought to be closed. I understand that the shell command lsof is supposed to do this. I'm trying to call lsof, and am getting a "command not found" error. This is the code I'm using to call lsof:</p>
<p>    $output = shell_exec("lsof 2&gt;&amp;1");</p>
<p>    print_r($output);</p>
<p> </p>
<p>This is giving me the "command not found" error. I have tried using exec too, but couldn't work out how to capture the output.</p>
<p> </p>
<p>1. What is the best way of finding out where files are being opened, and where they are not being closed, or getting a list of all the currently open files?</p>
<p>2. Should lsof exist on Total Choice Hosting servers?</p>
<p>3. If so, how do I call it successfully, and capture the output generated?</p>
<p>4. If not, how do I find out what all the open files are?</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">45557</guid><pubDate>Wed, 11 Jan 2017 17:55:18 +0000</pubDate></item><item><title>How Do I Force Use Of Https For My Login Page?</title><link>https://forums.totalchoicehosting.com/topic/45526-how-do-i-force-use-of-https-for-my-login-page/</link><description><![CDATA[
<p>I submitted a ticket, but the help desk said that some of my questions were outside of their scope. The remaining questions are:</p>
<p> </p>
<p>1. Can I use a shared secure URL to access a subdomain on my site, i.e. the web pages I'm developing are in swchoir.sylvesterbradley.org, the files that this subdomain refers to are in /home/sylvest/swchoir (i.e. not within public_html).</p>
<p> </p>
<p>2. I have a login page on my website called index.php. Presumably I don't need to encrypt this since it contains no confidential information. I need to encrypt the response to this, which is a URL like swchoir.sylvesterbradley.org/do_login.php. Can I get this encrypted by simply setting my form action property to "<a rel="">https://swchoir.sylv.../do_login.php".</a></p>
<p> </p>
<p>3. Do I have to do anything else to enable the encryption, or does the use of the https protocol enable all the necessary encryption on the client and decryption on the server?</p>
<p> </p>
<p>4. How do I prevent people from accessing this page by using the URL <a href="/do_login.php?" rel="">http://swchoir.sylve...rg/do_login.php?</a></p>
<p> </p>
<p>5. Does it matter whether I use method GET or POST for the login form?</p>
<p> </p>
<p>Thanks for your help.<br />Rowan<br /> </p>
<p><a href="https://forums.totalchoicehosting.com/applications/core/interface/file/attachment.php?id=2891" data-fileid="2891" rel="">Using_Https.rtf</a></p>
]]></description><guid isPermaLink="false">45526</guid><pubDate>Wed, 04 Jan 2017 17:30:54 +0000</pubDate></item><item><title>Line Numbers Reported In Error Messages Are Not Correct</title><link>https://forums.totalchoicehosting.com/topic/45530-line-numbers-reported-in-error-messages-are-not-correct/</link><description><![CDATA[

<p>Hi,</p>
<p> </p>
<p>I'm having trouble tracking down a bug in my PHP.</p>
<p> </p>
<p>The first attachment shows the error I'm getting (I would have pasted it in if the paste function worked, but it doesn't).</p>
<p> </p>
<p>The second attachment shows the code, with line numbers. I again I would have included this in the message, if I could have done without retyping it.</p>
<p> </p>
<p>My question is, why is it reporting that the error concerning the parameter of mysqli_num_rows() occurs in line 20? Line 20 is a comment. Even if it were not a comment, it does not contain a call to mysqli_num_rows(). I suppose it must be objecting to line 28, since that's where the call to the function is, but why is it not reporting the right line number? This just makes debugging extremely difficult...</p>
<p> </p>
<p>Thanks - Rowan</p>
<p><a class="ipsAttachLink ipsAttachLink_image" href="https://forums.totalchoicehosting.com/uploads/monthly_01_2017/post-7932-0-25265700-1483621635.png" data-fileid="2889" rel=""><img src="https://forums.totalchoicehosting.com/applications/core/interface/js/spacer.png" data-fileid="2889" class="ipsImage ipsImage_thumbnailed" alt="post-7932-0-25265700-1483621635_thumb.png" data-src="https://forums.totalchoicehosting.com/uploads/monthly_01_2017/post-7932-0-25265700-1483621635_thumb.png" width="125" data-ratio="72.80"></a></p>
<p><a class="ipsAttachLink ipsAttachLink_image" href="https://forums.totalchoicehosting.com/uploads/monthly_01_2017/post-7932-0-37055100-1483623050.png" data-fileid="2890" rel=""><img src="https://forums.totalchoicehosting.com/applications/core/interface/js/spacer.png" data-fileid="2890" class="ipsImage ipsImage_thumbnailed" alt="post-7932-0-37055100-1483623050_thumb.png" data-src="https://forums.totalchoicehosting.com/uploads/monthly_01_2017/post-7932-0-37055100-1483623050_thumb.png" width="125" data-ratio="79.20"></a></p>

]]></description><guid isPermaLink="false">45530</guid><pubDate>Thu, 05 Jan 2017 13:29:53 +0000</pubDate></item><item><title>Php Not Saving Log Messages</title><link>https://forums.totalchoicehosting.com/topic/45531-php-not-saving-log-messages/</link><description><![CDATA[
<p>I have a logmsg function in my PHP which is meant to record in a log file any errors that occur, with the time and date, the error's severity, and the line number and file name where they occurred (using __LINE__ and __FILE__). It sometimes works, but not always. Sometimes I get nothing added to the log file. Could this be to do with how PHP terminates? What happens if the logfile is not closed properly (which it won't be if there is a fatal error)? Or does some text get stuck in a buffer somewhere and never get written to the file? What can I do to make sure that any such buffers are flushed?</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">45531</guid><pubDate>Thu, 05 Jan 2017 13:53:37 +0000</pubDate></item><item><title>Available Scripting Languages?</title><link>https://forums.totalchoicehosting.com/topic/45198-available-scripting-languages/</link><description><![CDATA[
<p>Where would I find a list of scripting languages available on my shared hosting account (where can I find info on the types of scripts that I can run in cgi-bin)?  The TCH website lists php and perl, and I know that python is available.  Are there others?  What about bash?</p>
<p> </p>
<p>Thanks.</p>
]]></description><guid isPermaLink="false">45198</guid><pubDate>Wed, 31 Aug 2016 09:33:47 +0000</pubDate></item><item><title>Attn.: Php Experts</title><link>https://forums.totalchoicehosting.com/topic/44834-attn-php-experts/</link><description><![CDATA[
<p>I've downloaded and installed a full-text site search engine which, despite some limitations, seems to serve my needs. However, I'd like to modify it to paginate the results.</p>
<p> </p>
<p>Here's the existing code:</p>
<pre class="ipsCode prettyprint">
&lt;?php

/* Easy Real Time Full Text Search © 2012 Christer Svensson

---------------------------------------------- Instructions -------------------------------------------------------------------------------------------

 If the name of this file not is easy.php then rename it to easy.php

 Upload it to the directory (folder) on your homepage server that you want to search through.

 The PHP-script in this file performs a real time full text search of every htm, html, asp,
 and php file in the directory (folder) and all subdirectories (subfolders). The search is
 not case sensitive.

 The text displayed in the browser window is searched. For that reason, in the html code, all
 text in tags are omitted and also text between the tag and the end tag for head, script, noscript
 and iframe.

 You may translate the text (string values) in this file to your native language without the
 author's permission. If you do so, please send a copy to postbox@christersvensson.com and it
 will be published on the homepage of this script.

 You may also use another CSS style and you may include the script as a natural part at pages at
 your site.

*/

// You may translate the string values here under to your native languages. 

$buttonvalue = "Search";
$search_at = "A search for";
$search_result = "returned these results";
$pages = "Number of pages with hits";
$to_small = "At least two characters are required";
$recursive = true;  // Change to false if no searching should be done in subdirectories.

//---------------------------- Do not change anything below this line -------------------------------------------------------------------------------

$html = &lt;&lt;&lt;HTML
&lt;form name="form" action=""&gt;
&lt;fieldset&gt;
&lt;legend&gt;Search Moralintelligence.net&lt;/legend&gt;
&lt;input type="text" name="search" size="50"&gt;
&lt;input type="button" value="$buttonvalue"
 onclick='window.location.assign(document.URL.substring(0,document.URL.indexOf("?")) + "?search=" + document.form.search.value.replace(/ /g,"%20"))'&gt;&lt;br&gt;
&lt;!-- Please do not remove or change this link to the application's site. Others might like it too. --&gt;
&lt;small&gt;Powered by &lt;a href="http://www.christersvensson.com/easy/"&gt;Easy Real Time Full Text Search&lt;/a&gt;&lt;/small&gt;&lt;br&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
HTML;

echo $html;

function textpart($body, $search) {
// Displays the text after the title
  $length = 100;
  $text = substr($body, max(stripos($body,$search) - $length, 0), strripos($body,$search) - stripos($body,$search) + strlen($search) + 2 * $length);
  if (strripos($text, " ") &lt; strripos($text,$search)) {
    $text = $text . " ";
  }
  if (stripos($text, " ") != strripos($text, " ")) {
    $text = substr($text, stripos($text, " "), strripos($text, " ") - stripos($text, " "));
  }
  $temp = $text;
  $stop = substr($text, strripos($text, $search) + strlen($search));
  if (strlen($stop) &gt; $length) {
    $stop = substr($text, strripos($text, $search) + strlen($search), $length);
    $stop = substr($stop, 0, strripos($stop, " "));
  }
  $text = "... ";
  while (stripos($temp,$search)) {
    $temp = substr_replace($temp, "&lt;b&gt;", stripos($temp, $search), 0);
    $temp = substr_replace($temp, "&lt;/b&gt;", stripos($temp, $search) + strlen($search), 0);
    $text = $text . substr($temp, 0, stripos($temp, "&lt;/b&gt;") + 4);
    $temp = substr($temp, stripos($temp, "&lt;/b&gt;") + 4);
    if(stripos($temp, $search) &gt; (2 * $length)) {
       $text = $text . substr($temp, 0, $length);
       $text = substr($text, 0, strripos($text, " ")) . " ... ";
       $temp = substr($temp, stripos($temp, $search) - $length);
       $temp = substr($temp, stripos($temp, " "));
    }
  }
  $text = $text . $stop . " ... ";
  echo $text; 
  return;
}

function compress($string, $first, $last) {
// Removes everything in $string from $first to $last including $first and $last
  while(stripos($string,$first) &amp;&amp; stripos($string,$last)) {
    $string = substr_replace($string, "", stripos($string,$first), stripos($string,$last) - stripos($string,$first) + strlen($last));
  }
  return $string;  
}

function directoryToArray($directory, $recursive) {
// This function by XoloX was downloaded from http://snippets.dzone.com/user/XoloX
  $array_items = array();
  if ($handle = opendir($directory)) {
    while (false !== ($file = readdir($handle))) {
      if ($file != "." &amp;&amp; $file != "..") {
        if (is_dir($directory. "/" . $file)) {
          if($recursive) {
            $array_items = array_merge($array_items, directoryToArray($directory. "/" . $file, $recursive));
          }
        } else {
          $file = $directory . "/" . $file;
          $array_items[] = preg_replace("/\/\//si", "/", $file);
        }
      }
    }
    closedir($handle);
  }
  return $array_items;
}

function filewalk($file, $search, $counter, $webpath) {
// Selects and treats files with the extension .htm and .html and .asp and .php
  if (strtolower(substr($file, stripos($file, ".htm"))) == ".htm"
      || strtolower(substr($file, stripos($file, ".html"))) == ".html"
      || strtolower(substr($file, stripos($file, ".asp"))) == ".asp"
      || strtolower(substr($file, stripos($file, ".php"))) == ".php") {
    $all = file_get_contents($file);
    $body = substr($all, stripos($all,"&lt;body"),stripos($all,"&lt;/body&gt;") - stripos($all,"&lt;body"));
    $body = preg_replace('/&lt;br \/&gt;/i', ' ', $body);
    $body = preg_replace('/&lt;br&gt;/i', ' ', $body);
    $body = compress($body,"&lt;noscript","&lt;/noscript&gt;");
    $body = compress($body,"&lt;script","&lt;/script&gt;");
    $body = compress($body,"&lt;iframe","&lt;/iframe&gt;");
    $body = compress($body,"&lt;noframe","&lt;/noframe&gt;");
    $body = strip_tags($body);
    $body = html_entity_decode($body, ENT_QUOTES);
    $body = preg_replace('/\s+/', ' ', $body);
    // Scans and displays the results
    if (stripos($body, $search)) {
      $title = substr($all, stripos($all,"&lt;title&gt;") + 7,stripos($all,"&lt;/title&gt;") - stripos($all,"&lt;title&gt;") - 7);
      $title = html_entity_decode($title, ENT_QUOTES);
      $title = preg_replace('/\s+/', ' ', $title); 
      echo '&lt;p&gt;&lt;a href="' . $file . '"&gt;' . $title . '&lt;/a&gt;&lt;/br&gt;';
      echo '&lt;span id="webpath"&gt;' . $webpath . substr($file, stripos($file, "/")) . '&lt;/span&gt;&lt;br /&gt;';
      echo textpart($body, $search) . '&lt;/p&gt;';
      $counter = $counter + 1;
    }
  }
  return $counter;
}

// Reads the search text from the page's URL
$url = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
$url .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"] : $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

if (stripos($url,"?search=")) $search = $_GET['search'];

$webpath = dirname($url);

// Starts searching
if (strlen($search) &lt; 2 &amp;&amp; trim($search) &lt;&gt; "") {
  echo '&lt;p&gt;' . $to_small . '!&lt;/p&gt;';
  $search = "";
}

if (trim($search) &lt;&gt; "") {
  echo "&lt;h3&gt;" . $search_at . " “&lt;b&gt;" . $search . "&lt;/b&gt;” " . $search_result . ":&lt;/h3&gt;";
  $counter = 0;
  // Path to the folder containing this file
  $curdir = getcwd();
  // Opens the folder and read its contents
  if ($dir = opendir($curdir)) {
    $files = directoryToArray("./", $recursive);
    foreach ($files as $file) {
      $counter = filewalk($file, $search, $counter, $webpath);
    }
    closedir($dir);
  }
  echo "&lt;p&gt;" . $pages . ": " . $counter . "&lt;/p&gt;";
}
?&gt;</pre>
<p>As you can see here (<a href="http://www.moralintelligence.net/easy.php?search=future" rel="external">http://www.moralintelligence.net/easy.php?search=future</a>), by default, this displays all the results on one page, which in some cases can be rather long. </p>
<p> </p>
<p>1) I'd like to have the results divided into pages, with up to 25 results per page. Ideally, at the bottom of each page should be links to the previous and next pages (if applicable).</p>
<p> </p>
<p>2) I'd also like to have the total number of pages incorporated into the &lt;h3&gt; appearing over the results. This would be taken from "$counter" in the script, but so far I haven't been able to plug in that variable.</p>
<p> </p>
<p>Can anyone suggest appropriate PHP to add to this script in order to implement these enhancements?</p>
]]></description><guid isPermaLink="false">44834</guid><pubDate>Mon, 01 Jun 2015 11:47:25 +0000</pubDate></item><item><title>Getting Site Search Script To Work</title><link>https://forums.totalchoicehosting.com/topic/44826-getting-site-search-script-to-work/</link><description><![CDATA[
<p>I downloaded a nifty little search script (you can see it at <a href="http://www.christersvensson.com/easy/" rel="external">http://www.christersvensson.com/easy/</a>) for my site and installed it as directed. </p>
<p> </p>
<p>The search pages themselves work fine, but I also wanted to add a search box to each page so visitors can search directly from the pages. To set this up, I added the following code:</p>
<pre class="ipsCode prettyprint">
&lt;!-- Search area --&gt;

&lt;div id="search_area"&gt;

&lt;?php

/* Easy Real Time Full Text Search © 2012 Christer Svensson

---------------------------------------------- Instructions -------------------------------------------------------------------------------------------

 If the name of this file not is easy.php then rename it to easy.php

 Upload it to the directory (folder) on your homepage server that you want to search through.

 The PHP-script in this file performs a real time full text search of every htm, html, asp,
 and php file in the directory (folder) and all subdirectories (subfolders). The search is
 not case sensitive.

 The text displayed in the browser window is searched. For that reason, in the html code, all
 text in tags are omitted and also text between the tag and the end tag for head, script, noscript
 and iframe.

 You may translate the text (string values) in this file to your native language without the
 author's permission. If you do so, please send a copy to postbox@christersvensson.com and it
 will be published on the homepage of this script.

 You may also use another CSS style and you may include the script as a natural part at pages at
 your site.

*/

// You may translate the string values here under to your native languages. 

$buttonvalue = "Search";
$search_at = "A search for";
$search_result = "returned these results";
$pages = "Number of pages with hits";
$to_small = "At least two characters are required";
$recursive = true;  // Change to false if no searching should be done in subdirectories.

//---------------------------- Do not change anything below this line -------------------------------------------------------------------------------

$html = &lt;&lt;&lt;HTML
&lt;form name="form" method="get" action="http://www.moralintelligence.net/easy.php"&gt;
&lt;fieldset&gt;
&lt;legend&gt;Search Moralintelligence.net&lt;/legend&gt;
&lt;input type="text" value="Out of order. Click button. --&gt;" name="search" size="30"&gt;
&lt;a href="http://www.moralintelligence.net/easy.php"&gt;&lt;input type="button" value="$buttonvalue" 
 onclick='window.location.assign(document.URL.substring(0,document.URL.indexOf("?")) + "?search=" + document.form.search.value.replace(/ /g,"%20"))'&gt;&lt;/a&gt;&lt;br&gt;
&lt;!-- Please do not remove or change this link to the application's site. Others might like it too. --&gt;
&lt;small&gt;Powered by &lt;a href="http://www.christersvensson.com/easy/"&gt;Easy Real Time Full Text Search&lt;/a&gt;&lt;/small&gt;&lt;br&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
HTML;

echo $html;

?&gt;

&lt;/div&gt;

&lt;!-- End search area --&gt;
</pre>
<p>What I *want* this box to do is get the search query from the text entered by the user and then open a search page with the results (ideally in a different tab).</p>
<p> </p>
<p>Here's what it *does* do, as tested in four modern browsers, using Windows 7:</p>
<p> </p>
<p>1) Internet Explorer 11: No matter what text user enters, clicking "Search" causes the browser to reload the page with the search term added to the URL in the address bar. Nothing else happens.</p>
<p> </p>
<p>2) Firefox 38: On first click, does as IE does. On second click, opens search page, but text area is blank, so user must re-enter search query.</p>
<p> </p>
<p>3) Safari 5.1.7: Opens search page on first click, but user must re-enter search query.</p>
<p> </p>
<p>4) Chrome 43: Does exactly as Safari does.</p>
<p> </p>
<p>---</p>
<p> </p>
<p>I *think* I'm not very far away from my intended result, but something seems to be missing or improperly configured, and I don't know enough about PHP to see what it is.</p>
<p> </p>
<p>Please point me in the right direction.</p>
]]></description><guid isPermaLink="false">44826</guid><pubDate>Thu, 28 May 2015 12:30:53 +0000</pubDate></item><item><title>Creating Database In Php With Names Address And Phone Numbers</title><link>https://forums.totalchoicehosting.com/topic/44235-creating-database-in-php-with-names-address-and-phone-numbers/</link><description><![CDATA[<p>I would like to create a database that includes peoples names, addresses, and phone numbers. Is that something that I can be done on TotalChoice?</p>]]></description><guid isPermaLink="false">44235</guid><pubDate>Fri, 10 Oct 2014 19:10:27 +0000</pubDate></item><item><title>Besides Amember?</title><link>https://forums.totalchoicehosting.com/topic/8684-besides-amember/</link><description><![CDATA[
<p>I was wondering what other scripts or packages exist that allow you to have a login members only section on a website?</p>
<p> </p>
<p>Also, what if this was for an organization where only paid members could log into the site? One of the sites I designed is a Music Organization where members sign up using acteva or a mail in form and then they get a membership package sent to them. We were thinking of putting up a members only section on the website for a forum and other things but I wouldn't want just anyone to be able to sign in and use that section without first having paid the annual membership fee.</p>
<p> </p>
<p>I hope I explained that clearly enough. If not let me know and I can clarify.</p>
<p> </p>
<p>With Amember it seems that anyone could sign up and log in.</p>
<p> </p>
<p>Thanks for any help you can give.</p>
<p> </p>
<p>Nat</p>
]]></description><guid isPermaLink="false">8684</guid><pubDate>Fri, 19 Mar 2004 20:41:58 +0000</pubDate></item><item><title>Perl Scripts Stopped Functioning</title><link>https://forums.totalchoicehosting.com/topic/44142-perl-scripts-stopped-functioning/</link><description><![CDATA[
<p>Hi! I've had my website, flyingmoose.org, on R2D2 at TCH since 2008. Most of my pages have a Server-Side Include embedded near the bottom, and these call Perl scripts in my public_html/cgi-bin directory - usually to do simple things like keep count of page accesses, but a few of the scripts are more complex (such as an Error 404 page-generator).</p>
<p> </p>
<p>I noticed recently that the page-counters weren't showing any progress, and today realized that's because all the CGI scripts have stopped working. In place of the Perl script's output, all I have now is the message "[an error occurred while processing this directive]".</p>
<p> </p>
<p>Today I replaced one of the more common scripts in my cgi-bin with a simple script which does nothing but print a line of output, and gave it very broad permissions. It gave the same error.</p>
<p> </p>
<p>Nothing else has changed on my end, and an e-mail sent by one of the scripts shows they were working as recently as 25 July. Has there been a configuration change on R2D2 which would explain this? In any event, any suggestions for how to fix it?</p>
<p> </p>
<p>Thanks!</p>
<p> </p>
]]></description><guid isPermaLink="false">44142</guid><pubDate>Sun, 31 Aug 2014 01:55:23 +0000</pubDate></item><item><title>What Is Nginx! ?  It Comes Up All The Time.</title><link>https://forums.totalchoicehosting.com/topic/41150-what-is-nginx-it-comes-up-all-the-time/</link><description><![CDATA[
<p>Hello.</p>
<p> </p>
<p>What is "nginx"? Does anyone know?  "404 page not found"  "Welcome to nginx!!!"</p>
<p>This page blocks web pages I am looking for.</p>
<p> </p>
<p>What is this?  Should I start to become paranoid that our internet is being overtaken?</p>
<p>Sounds silly.  This page comes up randomly on different sites.  I do not believe it is</p>
<p>my computer because it is not consistent enough.  But maybe it is.</p>
<p> </p>
<p>Any insight on this would be much appreciated.</p>
<p> </p>
<p>Thanks,</p>
<p>queenpictoria</p>
]]></description><guid isPermaLink="false">41150</guid><pubDate>Wed, 12 Jan 2011 21:36:34 +0000</pubDate></item><item><title>.htaccess Problems... .php Code Showing In Html</title><link>https://forums.totalchoicehosting.com/topic/43092-htaccess-problems-php-code-showing-in-html/</link><description><![CDATA[
<p>Hi</p>
<p> </p>
<p>I'm doing some maintenance on an old site of mine and I have noticed that PHP code that I have had in some .htm/.html pages is showing through to browser. I checked the .htaccess in the www directory of my cpanel and it shows that I have the following:</p>
<p> </p>
<p></p>
<pre class="ipsCode">&gt;#AddHandler application/x-httpd-php .htm .html
#AddHandler application/x-httpd-php5 .php .html .htm
AddType application/x-httpd-php52 .php</pre>
<div></div>
<p></p>
<p> </p>
<p>I updated the .htaccess with</p>
<p></p>
<pre class="ipsCode">&gt;AddType application/x-httpd-php .htm</pre>
<div></div>
<p></p>
<p> </p>
<p>But that does not correct the problem.</p>
<p> </p>
<p>Any ideas on what I need to do?</p>
<p> </p>
<p>Thanks!</p>
]]></description><guid isPermaLink="false">43092</guid><pubDate>Wed, 05 Sep 2012 02:03:57 +0000</pubDate></item><item><title>How To Install Command Line Utility</title><link>https://forums.totalchoicehosting.com/topic/43049-how-to-install-command-line-utility/</link><description><![CDATA[
<p>Can someone explain to me what sort of programs (if any) can be installed on TCH servers and called in CRON jobs, or using exec() or passthru() in PHP?</p>
<p> </p>
<p>I want to be able to use PDFTK, a command line program which will merge an FDF file (form field values) with a PDF file (blank form) and flatten the result (into a new PDF file for a completed form) which I then want to present to the user.</p>
<p> </p>
<p>Or is there some other way of doing this?</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">43049</guid><pubDate>Tue, 17 Jul 2012 18:12:16 +0000</pubDate></item><item><title>Flatten / Merge Fdf Files In Php</title><link>https://forums.totalchoicehosting.com/topic/33201-flatten-merge-fdf-files-in-php/</link><description><![CDATA[
<p>I'm stuck so I'm back again -  <img src="https://forums.totalchoicehosting.com/applications/core/interface/js/spacer.png" alt=":wallbash:" data-emoticon="" data-src="https://forums.totalchoicehosting.com/uploads/emoticons/default_wallbash.gif"> </p>
<p> </p>
<p>I'm trying to find a way to dynamically create a PDF with form inputs filled out.</p>
<p> </p>
<p>There are a TON of ways to do this by creating a FDF file which fills in the PDF template. The trouble I'm having is that I don't want to pass the FDF file to the user, I want them to view a PDF file.</p>
<p> </p>
<p>I think my best bet to to find a way to do this by creating the FDF file (which I can do) than somehow flattening or merging the FDF with the original PDf to create a 'new' PDF file.</p>
<p> </p>
<p>The only way I found to do this is using a program called PDF Toolkit (PDFTK) which is a server side app. that doesn't seem to be on my hosted server. So that's pretty much out of the question.</p>
<p> </p>
<p>Any ideas or help you can offer would be much appreciated.</p>
<p> </p>
<p>Thanks,</p>
<p>Steve</p>
]]></description><guid isPermaLink="false">33201</guid><pubDate>Fri, 28 Sep 2007 17:27:47 +0000</pubDate></item><item><title>Upload_max_filesize .htaccess</title><link>https://forums.totalchoicehosting.com/topic/19285-upload_max_filesize-htaccess/</link><description><![CDATA[
<p>I have a webpage where I need to allow customers to upload large ( up to 50MB) files to a folder on the server.  FTP is not an option for some of these users so it needs to be a web page.  Right now files that are about 8MB's or lower work fine but larger ones fail.  I have tried changing the .htaccess page with the following code snipets...</p>
<p> </p>
<p>1.</p>
<p>upload_max_filesize</p>
<p>php_value post_max_size 22M</p>
<p>php_value upload_max_filesize 10M</p>
<p> </p>
<p> </p>
<p>2.</p>
<p>&lt;IfModule mod_php4.c&gt;</p>
<p>     php_value upload_max_filesize 50M</p>
<p>&lt;/IfModule&gt; </p>
<p> </p>
<p>I have read that the php.ini file needs to be changed but I do not have access to do that.  The above 2 code snipets supposedly should work but they dont allow for very large files.</p>
<p> </p>
<p>Any help would be appreciated.</p>
<p> </p>
<p>Thanks,</p>
<p> </p>
<p>Mark</p>
]]></description><guid isPermaLink="false">19285</guid><pubDate>Wed, 04 May 2005 02:43:28 +0000</pubDate></item><item><title>Formmail Php</title><link>https://forums.totalchoicehosting.com/topic/42807-formmail-php/</link><description><![CDATA[
<p>I just started using formmail.php for a simple form on my site, which I will also be using on client sites.</p>
<p> </p>
<p>However, the recipient is setup to my email, yet I am also getting another email at my TCH username from the server -- blahblahblah@picard.tchmachines.com</p>
<p> </p>
<p>How do I stop getting email from the server? I know my clients (also with sites hosted here on TCH) will find this to be a problem too, so how do I stop it?</p>
<p> </p>
<p>I'm using the free code from <a href="http://www.tectite.com" rel="external">http://www.tectite.com</a></p>
<p> </p>
<p> </p>
<p>Thanks in advance.</p>
]]></description><guid isPermaLink="false">42807</guid><pubDate>Tue, 27 Mar 2012 20:20:37 +0000</pubDate></item><item><title>How To Embed Comments Section On Pages?</title><link>https://forums.totalchoicehosting.com/topic/42725-how-to-embed-comments-section-on-pages/</link><description><![CDATA[<p>I'd like to create a box on each of my pages so readers can leave comments, preferably with a Captcha system to filter spambots and some means for me to delete comments from human spammers. Can anyone suggest a solution for this that will work well with CPanel and the software pre-installed on TCH's servers?</p>]]></description><guid isPermaLink="false">42725</guid><pubDate>Sat, 18 Feb 2012 07:29:12 +0000</pubDate></item><item><title>Sub Domain Mapping Url</title><link>https://forums.totalchoicehosting.com/topic/42653-sub-domain-mapping-url/</link><description><![CDATA[
<p>I know that when I define a sub-domain, I define what directory I am directed to. IOW: Going X.domain is the same as going to www.domain/directory. My question is if I can define it so that in lieu of it being www.domain/directory, it will map to something like "www.domain/directory/script.php?a=x&amp;b=y"? When I try it screams about not liking the ? (and maybe some of the other characters). Can I get the result I want by using %xx in lieu of the banned symbols?</p>
<p> </p>
<p>Thank you.</p>
]]></description><guid isPermaLink="false">42653</guid><pubDate>Thu, 12 Jan 2012 20:31:32 +0000</pubDate></item><item><title>Cpanel Perl Module Installation Error Msg</title><link>https://forums.totalchoicehosting.com/topic/42636-cpanel-perl-module-installation-error-msg/</link><description><![CDATA[
<p>Greetings, I'm trying to install the File::spec perl module onto my server on dagobah (the server, not the planet), but when I use the cPanel installation script, I get the following:</p>
<p> </p>
<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="42636" data-ipsquote-contentclass="forums_Topic"><div>
<p>Testing connection speed...(using fast method)...Done</p>
<p>Ping:1 (ticks) Testing connection speed to cpan.mirrors.tds.net using pureperl...(20566.67 bytes/s)...Done</p>
<p>Ping:1 (ticks) Testing connection speed to mirror.team-cymru.org using pureperl...(29500.00 bytes/s)...Done</p>
<p>Ping:1 (ticks) Testing connection speed to mirrors.servercentral.net using pureperl...(28050.00 bytes/s)...Done</p>
<p>Ping:2 (ticks) Testing connection speed to mirror.cogentco.com using pureperl...(20200.00 bytes/s)...Done</p>
<p>Ping:1 (ticks) Testing connection speed to ftp.wayne.edu using pureperl...(19500.00 bytes/s)...Done</p>
<p>Five usable mirrors located</p>
<p>Ping:1 (ticks) Testing connection speed to 216.104.43.138 using pureperl...(28950.00 bytes/s)...Done</p>
<p>Ping:1 (ticks) Testing connection speed to 74.200.212.130 using pureperl...(28950.00 bytes/s)...Done</p>
<p>Ping:1 (ticks) Testing connection speed to 216.246.55.158 using pureperl...(28950.00 bytes/s)...Done</p>
<p>Three usable fallback mirrors located</p>
<p>Fetching <a href="http://mirror.team-cymru.org/CPAN/index.html" rel="external">http://mirror.team-c...CPAN/index.html</a> (connected:0).......(request attempt 1/12)...Resolving mirror.team-cymru.org...(resolve attempt 1/65)......connecting to 38.229.66.100...@38.229.66.100......connected......receiving...100%......request success......Done</p>
<p>Mirror Check passed for mirror.team-cymru.org (/index.html)</p>
<p>Checking C compiler....Could not locate an executable "cc" binary....Done</p>
<p>** Unrecoverable Error **</p>
<p>The C compiler is not functional and auto repair failed.</p>
<p>Perl module installs require a working C compiler.</p>
<p>Please repair the C compiler and try again.</p>
<p>**************************</p>
<p></p>
</div></blockquote>
<p> </p>
<p>Am I doing something wrong? This is a server-side issue, yes?</p>
]]></description><guid isPermaLink="false">42636</guid><pubDate>Tue, 03 Jan 2012 00:51:53 +0000</pubDate></item><item><title>Exit() Does Not Work</title><link>https://forums.totalchoicehosting.com/topic/42589-exit-does-not-work/</link><description><![CDATA[
<p>I am using the exit() command in one of my scripts and it is being ignored. Any idea why this would be?</p>
<p> </p>
<p>The exit() is within a function which is attempting to grab a value out of an array as follows:</p>
<p> </p>
<p></p>
<pre class="ipsCode">&gt;
function get_setup_fee($prod_id, $M_PRODS, $M_SETUP ) {

//figure out the location of the product_id in the array and get it's key
$keyz = array_search($prod_id,$M_PRODS);

// now we have the key we the use the same key against the setup fees to find the matching one
$setup_fee = $M_SETUP[$keyz];

echo "The keyz is: " . $keyz;
echo "The prod_id is: " . $prod_id;
echo "M_PRODS is: " . $M_PRODS;
echo "The setup_fee is: " . $setup_fee;
exit();

return $setup_fee;
}
</pre>
<div></div>
<p></p>
<p> </p>
<p>The $setup_fee value being returned is wrong so I want to echo the values to the screen so I can figure out the issue with the code. However the script continues to run so I can't see what the values are. Any idea why this would be?</p>
<p> </p>
<p>I read on another forum that in shared hosting it may be "something with either safe_mode being enabled, output buffering being enabled, or error_reporting being enabled.". Anyone know anything about that?</p>
<p> </p>
<p>Thanks for the help!</p>
<p> </p>
<p> <img src="https://forums.totalchoicehosting.com/applications/core/interface/js/spacer.png" alt=":)" data-emoticon="" srcset="https://forums.totalchoicehosting.com/uploads/emoticons/smile@2x.png 2x" width="20" height="20" data-src="https://forums.totalchoicehosting.com/uploads/emoticons/default_smile.png"></p>
<p> </p>
<p><span style="font-size:10px;">Hi! I am the guy behind NetChimp, a web design company.</span></p>
<p> </p>
<p><span style="font-size:10px;">NetChimp offers </span><a href="http://www.netchimp.co.uk/webdesign/web-design-york/" rel="external"><span style="font-size:10px;"><strong>Web Design York</strong></span></a><span style="font-size:10px;"> and </span><a href="http://www.netchimp.co.uk/webdesign/web-design-aberdeen/" rel="external"><span style="font-size:10px;"><strong>Web Design Aberdeen</strong></span></a><span style="font-size:10px;"> plus </span><a href="http://www.netchimp.co.uk/webdesign/seo-york/" rel="external"><span style="font-size:10px;"><strong>SEO York</strong></span></a><span style="font-size:10px;"> and are known as a good </span><a href="http://www.netchimp.co.uk/webdesign/" rel="external"><span style="font-size:10px;"><strong>Small Business Web Designer</strong></span></a><span style="font-size:10px;"> with a website packed with </span><a href="http://www.netchimp.co.uk/webdesign/portfolio/good-web-design-examples/" rel="external"><span style="font-size:10px;"><strong>Good Web Design Examples</strong></span></a><span style="font-size:10px;">.</span></p>
]]></description><guid isPermaLink="false">42589</guid><pubDate>Tue, 13 Dec 2011 11:12:30 +0000</pubDate></item><item><title>Use Of .htpasswd File</title><link>https://forums.totalchoicehosting.com/topic/42522-use-of-htpasswd-file/</link><description><![CDATA[
<p>Hi I have a website which I want to test restricting access with an .htpasswd file.  The setup seems simple enough - just create the file, use a password generator to populate the contents of the htpasswd file, then set up your htaccess file and you're good to go.  I've done everything correct (I think), but I get 'Internal Server Error 500' on my site when I try it out.  I'm thinking possibly the path to the .htpasswd is not correct?</p>
<p> </p>
<p>What I have in .htaccess is:</p>
<p> </p>
<p>AuthUserFile /xyz/.htpasswd</p>
<p>AuthType Basic</p>
<p>AuthName "Login Details"</p>
<p>Require valid-user</p>
<p> </p>
<p>The directory /xyz is in the /public_html folder.  Would this path be correct? Or is there another path I should use here?  Thanks for any help.</p>
]]></description><guid isPermaLink="false">42522</guid><pubDate>Mon, 28 Nov 2011 20:12:50 +0000</pubDate></item><item><title>Accessing Folders Outside My Web-Root</title><link>https://forums.totalchoicehosting.com/topic/42484-accessing-folders-outside-my-web-root/</link><description><![CDATA[
<p>Hi,</p>
<p> </p>
<p>When I want to access a folder outside my web root in a PHP file (e.g. because I want to include a file but I don't want internet users to have access to the raw file) I use something like the following:</p>
<p>include $_SERVER["DOCUMENT_ROOT"] . "/../phpinclude/template3.php";</p>
<p>I.e. find the web root, go "up" one directory (on TCH servers this is my account home directory) then select the directory phpinclude (which because it's not under the web root is not accessible to anyone from the web) and include something.</p>
<p> </p>
<p>This is the most general way I've beed able to find that does this job. I want this to work on other (non-TCH) servers too, including Windows/IIS servers, if at all possible.</p>
<p> </p>
<p>This normally works fine,  but I've just set up a new TCH account and it doesn't work. I think the reason is that when I am accessing my account using <a href="http://myhost.tchmachines.com/~username/" rel="external">http://myhost.tchmachines.com/~username/</a> instead of ***** (because the account is new and has not yet been fully set up), $_SERVER["DOCUMENT_ROOT"] is equal to /usr/local/apache/htdocs/, not /home/username/public_html/.</p>
<p> </p>
<p>Is there a better way of finding my home directory's physical path on the server (<span style="text-decoration:underline;">not</span> my web root, the one above that), which works in this scenario?</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">42484</guid><pubDate>Fri, 18 Nov 2011 17:32:14 +0000</pubDate></item><item><title>Mediawiki Maintenance Scripts</title><link>https://forums.totalchoicehosting.com/topic/42216-mediawiki-maintenance-scripts/</link><description><![CDATA[
<p>I am running Mediawiki 1.14</p>
<p> </p>
<p>I want to run some of the <a href="http://www.mediawiki.org/wiki/Manual:Maintenance_scripts" rel="external">Maintenance scripts</a> which perform certain important administrative tasks. I would also like to run the update script to update to the most recent version of Mediawiki. But the Mediawiki manual says all these scripts should be run from the command line, which we can't do in a TCH environment.</p>
<p> </p>
<p>Does anyone know the best way to run maintenance scripts in the TCH environment? I particularly wish to run dumpBackup.php, refreshLinks.php and runJobs.php on a regular basis, calling them when needed. These scripts take a long time to run, so can't be called directly by PHP or they will time out.</p>
<p> </p>
<p>I know it should be possible to set up a Cron job to call the scripts on a schedule, but I am unfamiliar with Cron so don't know the exact commands to use. Also how do I call a one-off job like the update script? Any advice or a link to a tutorial would be most welcome.</p>
]]></description><guid isPermaLink="false">42216</guid><pubDate>Sun, 11 Sep 2011 12:42:16 +0000</pubDate></item><item><title>File Uploads Via Form Are Failing</title><link>https://forums.totalchoicehosting.com/topic/42105-file-uploads-via-form-are-failing/</link><description><![CDATA[
<p>Hi,</p>
<p> </p>
<p>Visitors submit photo files on my site by uploading them via an HTML form so that they are emailed to me.  They do not upload files directly to the public_html web space.  To accomplish this, I have used Ultimate Form Mail for many years, which had been recommended for use on TCH.</p>
<p> </p>
<p>With more and more frequency, the uploaded files are failing.  For example, someone may upload three photos, which is the maximum number on the input form.  I'll receive the resulting email and perhaps get only one of the three files, although Ultimate Form Mail lists in the email all three files.  That's how I know that two are missing.  I had a case today where someone uploaded only two files, and neither came through.  Thankfully, the person was willing to email the files to me so that I could know the file sizes that failed.  One of the files was 2.1 MB.  The other file was only 58 KB.  Neither file came through attached to the email via Ultimate Form Mail.</p>
<p> </p>
<p>It's very frustrating for the submitted files to be lost this way and it's happening more and more often now.  Without a fix for this, the only thing I can do is contact the submitter and request that they email the lost files.  They usually find this annoying as it is an inconvenience for both them and me.</p>
<p> </p>
<p>I have asked if they've received any error message during the upload.  They all have reported that there was no error message.  The uploads always appear to complete successfully.  This led me to believe that the uploads could be timing out on larger file sizes.  I've made adjustments to override default PHP settings in my .htaccess.  So far, nothing has worked to fix the problem.  I made a further change last night, after reading other threads.  But still today, we have the case of the 2.1 MB and 58 KB files combined upload failing.</p>
<p> </p>
<p>Here is what I now have in .htaccess in the public_html directory (Ultimate Form Mail, however is in a subdirectory -- should there be an .htaccess file in its directory with these statements?):</p>
<p> </p>
<p>&lt;IfModule php_config&gt;</p>
<p>#php_flag register_globals off</p>
<p>php_value max_input_time 2400</p>
<p>php_value max_execution_time 2400</p>
<p>php_value memory_limit 40M</p>
<p>php_value post_max_size 14M</p>
<p>php_value upload_max_filesize 14M</p>
<p>&lt;/IfModule&gt;</p>
<p> </p>
<p>Any assistance in solving this mystery would be greatly appreciated!</p>
<p> </p>
<p>Steven</p>
]]></description><guid isPermaLink="false">42105</guid><pubDate>Tue, 09 Aug 2011 00:14:01 +0000</pubDate></item><item><title>How Can I Add A Directory To Php Includes</title><link>https://forums.totalchoicehosting.com/topic/41245-how-can-i-add-a-directory-to-php-includes/</link><description><![CDATA[
<p>I would like to add a directory (e.g. /home/myusername/include) to the PHP include search path. Is there a way to do this globally for the whole of my site? I want to do this in a way that works whichever directory or sub-directory my PHP files are in (i.e. I don't want to have to change my include statement in each web page to give the relative path from where the page is to where my include files are). I would also like to do it in a way that's independent of the account being used or the file structure of the hosting system (i.e. I don't want to have to include an absolute path from / each time because this would have to be changed to work on a different site, or on a different hosting system). I've tried adding a .htaccess file in my public_html directory containing the line</p>
<p>php_value include_path ".:/home/myusername/include:/usr/lib/php:/usr/local/lib/php"</p>
<p>but this gives a 500 error.</p>
<p>Is there a way of making this work?</p>
<p>Or can I add a PHP.ini file somewhere?</p>
<p>Or is there a way of referring to the location of my home directory (_not_ my web root, since I'd like to keep my include files secure) in a PHP include statement?</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">41245</guid><pubDate>Mon, 31 Jan 2011 12:02:15 +0000</pubDate></item><item><title>Cannot Load Content With Initial Page Load</title><link>https://forums.totalchoicehosting.com/topic/41896-cannot-load-content-with-initial-page-load/</link><description><![CDATA[
<p>Request: I need some help understanding how to trouble shoot the following problem.</p>
<p> </p>
<p><strong>Symptoms:</strong> I load a feedback form with each page of my blog, the form is loaded using Javascript.  However, on the home page the first time you visit the SITE the form will not load. HOWEVER, if you enter the site by going to a different page then the form loads and if you then return to the home page, using the menu, the form loads as expected. So this condition occurs on entry to the site and, as far as I can detect, only occurs on the home page.</p>
<p>Using firebug I see a reported internal error 500.  After some researching I found that I needed to look in the server error log so I went to the C-panel and reviewed the log. If I  load the home page to create the error again there is no mention of it in the server error log (I assume I'm looking in the right place, in the C panel under Logs?).</p>
<p> </p>
<p><strong>Questions</strong></p>
<p></p>
<ul>
<li>Should the '500' error show in the error log<br />
</li>
<li>If '500' errors should be in the log what is the reason mine is not appearing<br />
</li>
<li>Any suggestions on how to troubleshoot this type of problem. <br />
</li>
</ul>
<p></p>
<p> </p>
<p><strong>Other Thoughts:</strong></p>
<p>I suspect that the problem is that the file containing the form is not being found for the home page on the initial request. However, I'm baffled as to how this could occur. Since the form is loaded via a script the same process is used for every page so how could one page cause the file to be not found. If the form never loaded on the home page that might give some clue but once its loaded on another page then it will load on the home page. </p>
<p> </p>
<p>I don't believe that this is a scripting problem per se but this still seemed to be the best place to ask the question.</p>
<p> </p>
<p>I'd appreciate any answers to my questions above and any guidance on how I might troubleshoot to find the source of my problem.</p>
<p> </p>
<p>Thanks</p>
]]></description><guid isPermaLink="false">41896</guid><pubDate>Thu, 23 Jun 2011 19:48:17 +0000</pubDate></item><item><title>Get List Of Apache Modules Installed</title><link>https://forums.totalchoicehosting.com/topic/41886-get-list-of-apache-modules-installed/</link><description><![CDATA[
<p>How do I get a list of all the Apache modules installed on my server? This has to be done in a web page since I have no command line access. There is supposed to be a PHP function apache_get_modules() but on my host (byss) this fails with an undefined function error.</p>
<p> </p>
<p>Hope someone can help...</p>
<p> </p>
<p>Thanks - Rowan</p>
]]></description><guid isPermaLink="false">41886</guid><pubDate>Tue, 21 Jun 2011 16:00:32 +0000</pubDate></item><item><title>Cannot Delete Files At Root Directory</title><link>https://forums.totalchoicehosting.com/topic/41777-cannot-delete-files-at-root-directory/</link><description><![CDATA[
<p>I have just finished successfully upgrading from Gallery2 to Gallery3.</p>
<p> </p>
<p>Cleaning up the unneeded Gallery2 files, I find that I am unable to delete the "g2data" directory...or any of its contents...from my /home/[user]/ directory. I am unable to change the permissions on that directory and its contents as well.</p>
<p> </p>
<p>The operation cannot be executed with cpanel or with FTP. Am I missing something?</p>
]]></description><guid isPermaLink="false">41777</guid><pubDate>Thu, 26 May 2011 21:36:39 +0000</pubDate></item><item><title>Gallery2 No Longer Working</title><link>https://forums.totalchoicehosting.com/topic/41772-gallery2-no-longer-working/</link><description><![CDATA[
<p>My installation of Gallery2 has stopped working.</p>
<p> </p>
<p>The error I receive:</p>
<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="41772" data-ipsquote-contentclass="forums_Topic"><div>[Error (ERROR_PLATFORM_FAILURE) :<p>in modules/core/classes/GalleryTemplate.class at line 251 (GalleryCoreApi::error)</p>
<p>in modules/core/classes/GalleryTemplate.class at line 180 (GalleryTemplate::_initCompiledTemplateDir)</p>
<p>in main.php at line 486 (GalleryTemplate::fetch)</p>
<p>in main.php at line 94</p>
<p>in main.php at line 83</p>
</div></blockquote>
<p> </p>
<p> </p>
<p>According to Gallery2's user forums, the solution might with permission settings. Unfortunately, trying to change the directories to the recommended permissions to being prevented...cpanel, FTP and Gallery's own admin pages are all prevented from making the change.</p>
<p> </p>
<p>Solution page in Gallery2 forum:</p>
<p><a href="http://gallery.menalto.com/node/98050" rel="external">http://gallery.menalto.com/node/98050</a></p>
<p> </p>
<p>The error I get from my FTP program when attempting the change:</p>
<blockquote data-ipsquote="" class="ipsQuote" data-ipsquote-contentapp="forums" data-ipsquote-contenttype="forums" data-ipsquote-contentid="41772" data-ipsquote-contentclass="forums_Topic"><div>550 Could not change perms on cache: Operation not permitted<p>Fetch could not set permissions for “cache” because the FTP server sent an unexpected response. (Check the Fetch Transcript window for more information.</p>
<p>Server responded: “Could not change perms on cache: Operation not permitted”)</p>
<p>ftp_cmd/ftp_user: 2,-30000 (state == SETTING_PERMS)</p>
</div></blockquote>
<p> </p>
<p>There is some suggestion in other TCH hosting forums that 777 permissions are now forbidden. If this is the case, I am not sure what to do. Without the current installation working, I am hesitant to attempt to upgrade to Gallery3.</p>
]]></description><guid isPermaLink="false">41772</guid><pubDate>Thu, 26 May 2011 00:17:35 +0000</pubDate></item><item><title>Using Get_Browser</title><link>https://forums.totalchoicehosting.com/topic/41632-using-get_browser/</link><description><![CDATA[
<p><strong>background:</strong></p>
<p>I want to collect information on browser and OS from page viewers.</p>
<p>It seems the way to do this is to use the "get_browser" function in php.</p>
<p>However, to get the full array of data it appears that the php.ini file has to edited to point to a browscap.ini file.</p>
<p> </p>
<p>I've successfully done this on my development setup using a local MAMP installation.</p>
<p> </p>
<p>My production version will be on a Wordpress site hosted on TC.</p>
<p> </p>
<p><strong>My Question</strong></p>
<p> </p>
<p>If I use the "get_browser" function in a php script for the production version will the array attribute work because the php.ini file points to the browscap file? Alternatively can the php.ini file be edited?</p>
<p> </p>
<p>As you can probably tell from my questions I'm a neophyte on this subject and would appreciate some guidance.</p>
<p> </p>
<p>Thanks.</p>
]]></description><guid isPermaLink="false">41632</guid><pubDate>Sat, 07 May 2011 17:51:42 +0000</pubDate></item><item><title>403 Forbidden: The Server Understood The Request, But Is Refusing To F</title><link>https://forums.totalchoicehosting.com/topic/39127-403-forbidden-the-server-understood-the-request-but-is-refusing-to-f/</link><description><![CDATA[
<p>Building an actionscript Twitter client and using OAuth for the sign in process.</p>
<p> </p>
<p>By necessity I need to use a php proxy to redirect all calls between my actionscript client and the Twitter server.</p>
<p> </p>
<p>Having an extrememely frustrating issue with the following error message. '403 Forbidden: The server understood the request, but is refusing to fulfill it.'</p>
<p> </p>
<p>The following 2 steps ALWAYS work after I click my 'Sign In with Twitter' button, I make it to the Twitter OAuth sign in page so I have the correct request token, etc</p>
<p> </p>
<p>1 successfully retrieve request token</p>
<p>2 navigate to Twitter's OAuth login page (following url isn't my actual URL but represents the actual path visible in the browser) *****/twitter/proxy.php?path=http%3A%2F%2Ftwitter.c...</p>
<p> </p>
<p>But the ONLY way I can proceed further (ie clicking 'Sign In' on the Twitter Oauth sign in page) without getting the 403 error is if the browser has just launched BEFORE navigating to the Twitter OAuth sign in page.</p>
<p> </p>
<p>Let me explain...</p>
<p>ie I have a separate duplicate compiled version of my application on my desktop where I click the 'Sign In with Twitter' button to start the login process. It targets the same php proxy script, retrieves the request token, then issues a navigate to URL command which launches a new browser window, or in this case, launches the browser.</p>
<p> </p>
<p>Clicking signIn now works correctly, no 403 error</p>
<p> </p>
<p>Other wise(if the browser has ALREADY been open BEFORE I get to the twitter OAuth Sign In page) I get the 403 forbidden message, even if the username-password fields are blank.</p>
<p> </p>
<p>What gives? I am totally stumped.... This occurs in BOTH Safari and Firefox in OSX....so I can assume its NOT a browser issue </p>
<p> </p>
<p> </p>
<p>Could this have something to do with the Totalchoice server not being allowed to make requests back to itself?</p>
<p> </p>
<p>Am going to need some senior tech support it seems to get this resolved...</p>
]]></description><guid isPermaLink="false">39127</guid><pubDate>Thu, 21 Jan 2010 15:20:51 +0000</pubDate></item></channel></rss>
