Monday, November 25, 2013

How to turn off magic_quotes_gpc at Godaddy hosting

If You try to deploy your Joomla website at Godaddy hosting , you may face a problem that you should turn off  magic_quotes_gpc, in this article I will explain the correct way to do that.

After I had searched for in the internet and try many solves , I Found the best solution as following  :

(1) First of all do not try to turn off the magic quotes in your .htaccess file, it won’t work on godaddy.
(2) Second, if you’re running PHP5 on your account, rename your php.ini file to php5.ini, make sure it’s in your root folder.
(3) Third, make sure all the lines in your php5.ini file end in a semi colon ;
(4) Fourth, add this line to your php5.ini file:
magic_quotes_gpc = Off;


the  source :
http://support.godaddy.com/groups/web-hosting/forum/topic/how-to-turn-off-magic_quotes_gpc/


Saturday, May 25, 2013

HtmlEditorExtender (ASP 4.5)

This Tutorial  about using HtmlEditorExtender in your aspx pages.
Frst of all  HtmlEditorExtender  can be added as extender for a regular textbox control for example :


<asp:TextBox ID="txtMessageBody" runat="server" TextMode="MultiLine" Rows="10" Width="100%"></asp:TextBox>
<ajaxToolkit:HtmlEditorExtender ID="txtMessageBody_HtmlEditorExtender" runat="server" Enabled="True" TargetControlID="txtMessageBody">
</ajaxToolkit:HtmlEditorExtender>

but if you try to run your web site the following error will be appeared  : 
"Sanitizer provider is not configured in the web.config file. If you are using the HtmlEditorExtender with a public website then please configure a Sanitizer provider. Otherwise, set the EnableSanitization property to false."

So you have two choices to solve it  : 
First choice :
If your page is not public you can set the EnableSanitization property to false in your HtmlEditorExtender

Second Choice :
  1. Add "HtmlAgilityPack.dll" and  "SanitizerProviders.dll" in your "Bin" Folder
  2. Add The following in Your Web.Config file :
Under Configuration tag  add

<configSections>

<sectionGroup name="system.web">

<section name="sanitizer" requirePermission="false"

type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit" />

</sectionGroup>

</configSections>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>

<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />

<bindingRedirect oldVersion="0.0.0.0-1.4.6.0" newVersion="1.4.6.0" />

</dependentAssembly>

</assemblyBinding>

</runtime>

Under System.Web  tag add 
<sanitizer defaultProvider="HtmlAgilityPackSanitizerProvider">

<providers>

<add name="HtmlAgilityPackSanitizerProvider" type="AjaxControlToolkit.Sanitizer.HtmlAgilityPackSanitizerProvider"></add>

</providers>

</sanitizer>




Then The Result is