chrometweaks.org

Where are the french UFO files? Any other iPage web host them?

Click Here To View All Answers...


My first question is Where are the french UFO files? Any other iPage web host them? Hoping for any comment. Another question I got... Hi Guys,.

I am trying to add an option to the admin so that I can edit my affiliate information. I am basing my add-on on the 'Information Box by Calman V2' contribution..

Everything has gone rosey until I went into the admin to try it out, I get this error.

This is the sql used.

CREATE TABLE info_affiliate (Id int(1) unsigned NOT NULL default '0', language_id int(1) unsigned NOT NULL default '1', Text blob NOT NULL, PRIMARY KEY  (Id)) TYPE=MyISAM;.

INSERT INTO info_affiliate VALUES (1, 1, 'Put your Affiliate Information Here...');.

And this is part of the infoaffiliate.php file from my admin.

<?php.

    echo '<BR><BR><font size=-3>Select ';.

    if ($info_lang == 1) {.

     echo '<a href="'tep_href_link('affiliate_info.php?info_lang=1', '', 'NONSSL')'"><font color=blue><b>English</b></font></a>';.

       echo ' OR </font>';.

       echo '<a href="'tep_href_link('affiliate_info.php?info_lang=4', '', 'NONSSL')'"><font color=blue>French</font></a><br>';.

    }.

    if ($info_lang == 4) {.

     echo '<a href="'tep_href_link('affiliate_info.php?info_lang=1', '', 'NONSSL')'"><font color=blue>English</font></a>';.

       echo ' OR </font>';.

       echo '<a href="'tep_href_link('affiliate_info.php?info_lang=4', '', 'NONSSL')'"><font color=blue><b>French</b></font></a><br>';.

    }.

  ?>.

<?php.

 if ($REQUEST_METHOD=="POST").

 {.

   mysql_query('UPDATE info_affiliate SET Text = "'.mysql_escape_string($aboutus).'" WHERE language_id='$info_lang).

         or die(mysql_error());.

 }.

 .

 $sql=mysql_query('SELECT * FROM info_affilate where language_id='$info_lang).

   or die(mysql_error());.

 $row=mysql_fetch_array($sql);.

?><table width="98%" align="center" border="0" cellpadding="0" cellspacing="0">.

<form name="affiliate_info" method="Post" action="">.

<tr>.

         <td width="400px" valign="top"><br>.

 <textarea name="affiliate_info" cols="100" rows="22"><?php echo stripslashes($row['Text']); ?></textarea></td>.

                       <td></td>.

</tr>.

<tr>.

 <td colspan="2">&nbsp;</td>.

</tr>.

<tr>.

 <td align="right"><input type="submit" name="Save" value="Save" style="width: 70px"></td>.

 <td>&nbsp;</td>.

Can anyone see where I am going wrong?.

Thanks.

Mark..

Comments (16)

Hmm... I need to find out myself. I don't know what is the right answer. I'll do some research and get back to you if I got an good answer. You should email the people at iPage as they probably could assist you..

Comment #1

Sorry, Its been a few hectic days..

This is the contrib.

Link.

Thanks.

Mark..

Comment #2

Sorry to bump an old post guys but I did not get an answer..

Regards.

Mark..

Comment #3

Looks to me the table name is misspelled, it's missing an 'i'.

'SELECT * FROM info_affilate '.

Should be.

'SELECT * FROM info_affiliate '..

Comment #4

Hi Carine,.

I have corrected that spelling mistake but I still get the same error in admin..

Thanks.

Mark..

Comment #5

Another little fix, I'm not 100% sure but I think MySQL requires you to end every statement with a semi colon (';')..

Comment #6

Thanks for your help carine,.

Can anyone else have a bash at this one for me before I.

Thanks.

Mark..

Comment #7

Hi Chris,.

Will you cast your eyes over my admin file please and tell me if there is anything that is not right as this is the problem me thinks!.

<?php.

Require('includes/application_top.php');?>.

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">.

<html <?php echo HTML_PARAMS; ?>>.

<head>.

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">.

<title><?php echo TITLE; ?></title>.

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">.

</head>.

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">.

<?php require(DIR_WS_INCLUDES'header.php'); ?>.

<table border="0" width="100%" cellspacing="2" cellpadding="2">.

 <tr>.

   <td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27">.

   <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">.

   <?php require(DIR_WS_INCLUDES'column_left.php');?>.

   </table></td>.

    <td class="pageHeading" valign="top"><?php.

      echo "Affiliate Information";.

?>.

  <?php.

    echo '<BR><BR><font size=-3>Select ';.

    if ($info_lang == 1) {.

     echo '<a href="'tep_href_link('affiliate_info.php?info_lang=1', '', 'NONSSL')'"><font color=blue><b>English</b></font></a>';.

       echo ' OR </font>';.

       echo '<a href="'tep_href_link('affiliate_info.php?info_lang=4', '', 'NONSSL')'"><font color=blue>French</font></a><br>';.

    }.

    if ($info_lang == 4) {.

     echo '<a href="'tep_href_link('affiliate_info.php?info_lang=1', '', 'NONSSL')'"><font color=blue>English</font></a>';.

       echo ' OR </font>';.

       echo '<a href="'tep_href_link('affiliate_info.php?info_lang=4', '', 'NONSSL')'"><font color=blue><b>French</b></font></a><br>';.

    }.

  ?>.

<?php.

 if ($REQUEST_METHOD=="POST").

 {.

   mysql_query('UPDATE info_affiliate SET Text = "'.mysql_escape_string($aboutus).'" WHERE language_id='$info_lang).

         or die(mysql_error());.

 }.

 .

 $sql=mysql_query('SELECT * FROM info_affiliate where language_id='$info_lang).

   or die(mysql_error());.

 $row=mysql_fetch_array($sql);.

?><table width="98%" align="center" border="0" cellpadding="0" cellspacing="0">.

<form name="affiliate_info" method="Post" action="">.

<tr>.

         <td width="400px" valign="top"><br>.

 <textarea name="affiliate_info" cols="100" rows="22"><?php echo stripslashes($row['Text']); ?></textarea></td>.

                       <td></td>.

</tr>.

<tr>.

 <td colspan="2">&nbsp;</td>.

</tr>.

<tr>.

 <td align="right"><input type="submit" name="Save" value="Save" style="width: 70px"></td>.

 <td>&nbsp;</td>.

</tr>.

<tr>.

 <td colspan="2">&nbsp;</td>.

</tr>.

</form>.

</table>.

<br>.

<?php require(DIR_WS_INCLUDES'footer.php'); ?>.

<p>&nbsp;</p>.

<p>&nbsp;</p><p><br>.

</p><?php require(DIR_WS_INCLUDES'application_bottom.php'); ?></td>.

   </tr>.

</table>.

</body>.

</html>.

Thanks.

Mark..

Comment #8

Mark.

Have you tried putting the ; in at the end of the select statement ?

Comment #9

Hi Carine,.

If I put a ; at the end of the Select statement I get this error.

Mark..

Comment #10

The line should read:.

$sql=mysql_query('SELECT * FROM info_affiliate where language_id='$info_lang';').

  or die(mysql_error());.

You probably put the ; outside of the mysql statement..

Comment #11

Carine,.

I have changed that and it still gives the original error..

Thanks.

Mark..

Comment #12

  mysql_query('UPDATE info_affiliate SET Text = "'.mysql_escape_string($aboutus).'" WHERE language_id='$info_lang).

        or die(mysql_error());.

What is the value of mysql_escape_string($aboutus) at the time this executes?..

Comment #13

Chris,.

I have no I idea what you mean!.

Mark..

Comment #14

I mean you are trying sert the value of `Text` to mysql_escape_string($aboutus). However, the column `Text` does not accept null values, as per your table definition. If the value of mysql_escape_string($aboutus) is null, or an empty string, this might cause this error..

Actually, it usually doesn't cause this particular error, but I think it's best to eliminate this possiblility before moving on, because I see nothing wrong with your syntax..

So, you need to interpolate mysql_escape_string($aboutus), and find out what the value is you are trying to update to..

Also, please point out any changes you specifically made to this script, as that will undoubtedly be your error...

Comment #15

Chris,.

How do I do that? (I know, I know, thick as pig ****!).

Mark..

Comment #16

Print it to the screen..

Programming can be a bitch, huh?..

Comment #17


This question was taken from a support group/message board and re-posted here so others can learn from it.