/    Sign up×
Community /Pin to ProfileBookmark

a copied-modiefied PHP field must start with a number… why?

Hey

I have this Joomla CMS with a component I need to alter.

There are some fields which will only display on the output page when filled, so I tried making one more. I have copied one of the fields exactly, also in the database table, and just changed the name.

It works just like the previous fields… but only if I start with a number. I would like this field to be letter based and I have no clue where and why it is restricted to numeric entry

There are 2 pages I have modified… one admin.html.php and the other outputpage.html.php.
You will see below two sets of pieces in each code.. one original and one I have modified.

admin:

[code=php]<td width=”150″><?php echo _ALBERGHI_DISTANZANEVE ?>
:</td>
<td class=”small”><input class=”inputbox” type=”text” name=”distanzai” value=”<?php echo $row->distanzai; ?>” size=”10″ maxlength=”255″ />
<?php echo _ALBERGHI_ADMINDISTANZANEVE ?>
</td>
</tr>

<tr>
<td width=”150″><?php echo _ALBERGHI_STRANDTYP ?> :</td>
<td class=”small”><input class=”inputbox” type=”text” name=”strandtyp” value=”<?php echo $row->strandtyp; ?>” size=”10″ maxlength=”255″ />
<?php echo _ALBERGHI_ADMINSTRANDTYP ?> </td>
</tr>

_________________________

$numchk += 1;
$query = “ALTER TABLE `#__alberghi` CHANGE `distanzai` `distanzai` MEDIUMTEXT NOT NULL”;
$database->setQuery( $query );
$database->query();
$err_act[$numchk] = ‘Upgrade’;
$err_num[$numchk] = $database->getErrorNum();
$err_msg[$numchk] = $database->stderr();

$numchk += 1;
$query = “ALTER TABLE `#__alberghi` CHANGE `strandtyp` `strandtyp` MEDIUMTEXT NOT NULL”;
$database->setQuery( $query );
$database->query();
$err_act[$numchk] = ‘Upgrade’;
$err_num[$numchk] = $database->getErrorNum();
$err_msg[$numchk] = $database->stderr();
[/code]

outputpage:

[code=php]
<?php if ($item->distanzai>0) echo _ALBERGHI_DISTANZANEVE . “:<strong> ” . $item->distanzai ?><?php if ($item->distanzai>0) echo “</strong><br />”; ?>
<?php if ($item->strandtyp>0) echo _ALBERGHI_STRANDTYP . “:<strong> ” . $item->strandtyp ?><?php if ($item->strandtyp>0) echo “</strong><br />”; ?>

______________________________________

<td width=”150″><?php echo _ALBERGHI_DISTANZANEVE ?>:</td>
<td align”left”> <input class=”inputbox” type=”text” name=”distanzai” value=”<?php echo $row->distanzai; ?>” size=”10″ maxlength=”255″ /></td>
</tr>

<tr>
<td width=”150″><?php echo _ALBERGHI_STRANDTYP ?>:</td>
<td align”left”> <input class=”inputbox” type=”text” name=”strandtyp” value=”<?php echo $row->strandtyp; ?>” size=”10″ maxlength=”255″ /></td>
</tr>
[/code]

database from phpmyadmin:

[code=php]
ALTER TABLE `jos_alberghi` CHANGE `distanzai` `distanzai` MEDIUMTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL

ALTER TABLE `jos_alberghi` CHANGE `strandtyp` `strandtyp` MEDIUMTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL
[/code]

So that´s that… I hope anyone can help

thanks

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@SiddanauthorOct 18.2007 — Could anyone please help by letting me know at least where to look?

I just have no clue where it is restricted only to numerics... All fields look the same to me.... wether is it is text or numbers
Copy linkTweet thisAlerts:
@SiddanauthorOct 23.2007 — perhaps I have let some info out?

If so then let me know and I will see what I can provide
Copy linkTweet thisAlerts:
@SiddanauthorOct 28.2007 — ... ok seems like nobody knows ?
Copy linkTweet thisAlerts:
@NogDogOct 28.2007 — Perhaps you should check the Joomla site's knowledge base and/or forums?
Copy linkTweet thisAlerts:
@SiddanauthorOct 30.2007 — Oh believe me I have tried.... This is my last place of desperation to seek help. And since this is purely php based question I hoped to recieve some kind help...

It is obiously something in the database that prevents any text from showing.. unless it begins with a number
×

Success!

Help @Siddan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...