Home » Forum
NoNumber!

Joomla!® Websites & Extensions
development  -  support  -  consultancy

I try to respond within 48 hours (excluding weekends).
If I haven't responded by then, feel free to post a reminder or bug me via email.

My last reply was: 3 Minutes ago.

Welcome, Guest
Please Login or Register.    Lost Password?

phph code length
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: phph code length
#4853
phph code length 2 Years, 3 Months ago  
Hi - Thank you for sourcerer

I can make s.erer function and have the php code talk to my mySQL database. Good!

I seem to have an issue with code length. I use JoomlaFUCK WYSIWIG and it looks like I can get one line of code before it bugs

-----------------one line----------------------------------------

The width of the editor screen. I am envious of the long winded examples where the hello tag is at the top of the page and the good bye tag is at the bottom

Right now every line gets get a hello-good bye pair and I don't think thats right.

Whats up?

Phillip
phil_m
Posts: 3
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#4854
phph code length 2 Years, 3 Months ago  
I am not sure what you mean.
phil_m:
Right now every line gets get a hello-good bye pair and I don't think thats right.

???
Peter van Westen
Admin
Posts: 9148
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#4855
phph code length 2 Years, 3 Months ago  
sure,

when i start with something new, i start small for testing purposes

{source}[[?php echo "hello world";?]]{/source}

({source} = hello tag {/source} = good bye tag)

That works fine, i get hello world

but i don't need that, i need a whole page of sql statements and record sets and echo comamnds so I C and P'd my php statements into JoomlaFCK and put the hello tag at the top and good bye tag at the bottom. i get a blank page like discussed in the swedish example in the post earlier

I thought I could avoid the blank page issue by isolating my commands into functional chunks but there are too many.

Forget the one line issue, i tested and got at least two lines in before it bugged or went blank


below is my code block i need to port from my html site to joomla
using sourcerer

thank you!

Phillip


<?php


foreach ($_POST as $field => $value)
{
echo "<h3>Job Number - $value</h3>";
}

echo "<table border='0' width='100%'";

$link = mysql_connect('localhost', 'xxxxxxxx', 'xxxxxxxx');

if (!$link) {

die('Could not connect: ' . mysql_error());
}


mysql_select_db("realksa1_realksa") or die(mysql_error());

$data = mysql_query("SELECT JCN, Title, SG, Salary, qual, duty, promo_to, agency_1 FROM realksa2 WHERE JCN LIKE '%$value%' ")
or die(mysql_error());


while ($row = mysql_fetch_row($data)) {

echo "<tr><td><font face='Verdana' size='2'>$row[1]</font></td><td><font face='Verdana' size='2'> $row[7]</font></td><td><font face='Verdana' size='2'>$row[2]</font></td><td><font face='Verdana' size='2'>$row[3]</font></td><td></td></tr>";
echo "<tr><td><font face='Verdana' size='2'>Promotion to $row[6]</font></td><td></td><td></td><td></td><td>";

echo " <form action='www.paypal.com/cgi-bin/webscr' method='post'>";
echo "<input type='hidden' name='cmd'value='_s-xclick'>";
echo "<input type='hidden' name='hosted_button_id'value='519577'>";
echo "<table><tr><td>";
echo "<input type='hidden' name='on0'value='JCN'>";
echo "</td></tr><tr><td>";
echo "<input type='hidden' name='os0' Value = '$row[0]' MaxLength = '& 60& ' >";
echo "</table>";
echo "<input type='image' src='www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif' border='0' name='submit' alt=''>";
echo "<img alt='' border='0' src='www.paypal.com/en_US/i/scr/pixel.gif' width='1' height='1'>";
echo "</form>";


echo " </td></tr><br><br><br>";
echo "<tr><td colspan='5'><b><font face='Verdana' size='2'>Duty</font></b></td></tr>";
echo "<tr><td colspan='5'><font face='Verdana' size='2'>$row[5]</font></td></tr>";
echo "<tr><td colspan='5'><b><font face='Verdana' size='2'>Qualification</font></b></td></tr>";
echo "<tr><td colspan='5'><font face='Verdana' size='2'>$row[4]</font></td></tr>";

echo "</table>";


}

mysql_close($link);
?>
phil_m
Posts: 3
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#4856
phph code length 2 Years, 3 Months ago  
Try to not use multiple echo statements.
Or collect them in an array and echo the array with implode( '', $your_array ).
Or just use one echo, like:
echo "<tr><td><font face='Verdana' size='2'>$row[1]</font></td><td><font face='Verdana' size='2'> $row[7]</font></td><td><font face='Verdana' size='2'>$row[2]</font></td><td><font face='Verdana' size='2'>$row[3]</font></td><td></td></tr>
<tr><td><font face='Verdana' size='2'>Promotion to $row[6]</font></td><td></td><td></td><td></td><td>
   <form action='https://www.paypal.com/cgi-bin/webscr' method='post'>
   ...
</table>";

Peter van Westen
Admin
Posts: 9148
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#4857
phph code length 2 Years, 3 Months ago  
Also, I advise you to use double quotes for html. And single quotes for PHP.
So NOT:
echo "<font face='Verdana' size='2'>$row[1]</font>";

But:
echo '<font face="Verdana" size="2">'.$row[1].'</font>';

Peter van Westen
Admin
Posts: 9148
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
Go to topPage: 1
Moderators: Peter van Westen
hosting joomla
MaxCDN | Content Delivery Network | Accelerate your site to the max
Open Source Training | Online Joomla! Training and Support