cereal 1,524 Nearly a Senior Poster Featured Poster

Just as side note, if you can't join two tables but still need to print through php, you can use mysql_data_seek():

<?
# ...
# connect to db
# ...

$q1 = mysql_query("select * from table_name");
$q2 = mysql_query("select * from table_name_2");

$a = mysql_num_rows($q1)-1;
$b = mysql_num_rows($q2)-1;

$c = ($a == $b) ? $a : max($a,$b);

for($i = 0; $i < $c; $i++)
{
    if($a >= $i)
    {
	if(mysql_data_seek($q1, $i))
	{
	    $r = mysql_fetch_assoc($q1);
            echo 'q1: ' . $r['field_name'] . "\n";
	}
    }

    if($b >= $i)
    {
        if(mysql_data_seek($q2, $i))
        {
            $v = mysql_fetch_assoc($q2);
            echo 'q2: ' . $v['field_name'] . "\n";
	}
    }
}

?>

Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Update your Joomla installation to last one and, if the problem continues, fill a bug on their support forum, so the Joomla team can work on the source and release a patch:

http://docs.joomla.org/Bug_Squad

bye!

cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe I'm wrong but searching on web I came up with a thread discussing of that obfuscated js code, and it seems to match an injection attack, here's the link:

- http://www.reddit.com/r/javascript/comments/mk1u8/i_found_code_in_my_files_i_did_not_add_what_does/c31jt8k

cereal 1,524 Nearly a Senior Poster Featured Poster

Perhaps you could use federated tables:

- http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html

but if the connection goes away you get an empty set from the federated table, that because on each query you get results from remote, in this case you should update a second table so you can retain data locally.

cereal 1,524 Nearly a Senior Poster Featured Poster

It seems you are using a function secure_form_data() , did you included that in your online code? What it does? If you try to echo $pass which output you get?

cereal 1,524 Nearly a Senior Poster Featured Poster

Have you tried explain? For example:

mysql> explain users;
+---------+-------------+------+-----+---------+----------------+
| Field   | Type        | Null | Key | Default | Extra          |
+---------+-------------+------+-----+---------+----------------+
| id      | int(9)      | NO   | PRI | NULL    | auto_increment |
| fname   | varchar(50) | NO   |     | NULL    |                |
| lname   | varchar(50) | NO   |     | NULL    |                |
| userid  | varchar(50) | NO   |     | NULL    |                |
| referer | varchar(50) | NO   |     | NULL    |                |
+---------+-------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

You can also use show create table users\G that will output additional data:

mysql> show create table users\G
*************************** 1. row ***************************
       Table: users
Create Table: CREATE TABLE `users` (
  `id` int(9) NOT NULL AUTO_INCREMENT,
  `fname` varchar(50) NOT NULL,
  `lname` varchar(50) NOT NULL,
  `userid` varchar(50) NOT NULL,
  `referer` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
cereal 1,524 Nearly a Senior Poster Featured Poster
cereal 1,524 Nearly a Senior Poster Featured Poster

And what you have on line 14? $data['country']=$this->user->country(); ?
If yes you may want to paste the updated user model code?

cereal 1,524 Nearly a Senior Poster Featured Poster

Change the controller function with this:

function index()
{
    $this->load->model('user');
    $this->load->helper(array('form','url'));
    $data['country']=$this->user->country();
    $this->load->view('signup_view',$data);
}

If you load the view before you collect data you will get an error, and you need also to send data array to the view, so you need to use a second parameter in the load->view as I wrote above. If you get new errors post them, bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

No problem, bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

This is old but it still can be useful:

in line 15 of header_view.php file add a slash to the url:

'/index.php/home/productsList/'+catId

in line 78 of home.php (the controller) there is a mistake, where did you get $this->params? Refer to the URI Class, you should solve:

$data['products'] = $this->m_products->getProducts($this->uri->segment(3));

bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

You can only use yum into another box to download the needed package, so you can copy that into a usb flash drive as it seems that repositories are not public available (but I'm not sure about this since I don't know RedHat and CentOS policies):

yum install yum-downloadonly php-xml

As a side note: the php5 installation package for Ubuntu already includes php-xml. Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

First of all remember to use CODE to wrap data you post in the forums.
Second: this is wrong $this->db->select('id','country_name'); you should write $this->db->select('id, country_name'); otherwise country_name will be seen as second argument.

Check if this solves the problems. Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

I can't help but it seems to depend on the Client behavior:

The client MUST mask all frames sent to the server. A server MUST close the connection upon receiving a frame with the MASK bit set to 0. In this case, a server MAY send a close frame with a status code of 1002 (protocol error) as defined in Section 7.4.1.

cereal 1,524 Nearly a Senior Poster Featured Poster

The allowed input types are:

button
checkbox
file
hidden
image
password
radio
reset
submit
text

you are using type="input" since line 48, change it and it should work. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Check the code of timthumb script:

http://timthumb.googlecode.com/svn/trunk/timthumb.php

I never tried that but it gives the ability to create screenshots of websites, you will need access to the command line of your webserver, in shared hostings this may not be possible. Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

In your copy there are some errors: 1) here is missing the if statement and 2) inside the die() you wrote mysql_error; while it should be mysql_error() I didn't say to check the connection, because that gives another error, but the database, use this:

$con = mysql_connect("localhost","user","password");
mysql_select_db('your_database') or die("There was an error connecting to the table");
if (!$con)
{
    die('Could not connect: ' . mysql_error());
}

bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

That means the query is resulting false. Check your connection code, probably you are connecting to the wrong database.

cereal 1,524 Nearly a Senior Poster Featured Poster

On the administration side you need a form to create an instance for each word associated with the English translation and an audio file that can be mp3, wav or ogg, depends on you. Something like an email an his attachments.

Here I would use two tables for the words, one for the Arabic and one for the English ones. Then a third table where you register only the id from the two previous tables, will connect the words, because you can have one-to-many correlations: "water" or "bread" have many terms in Arabic. For example:

mysql> select id,word from arabic_dict; select id,word from english_dict;
+----+--------+
| id | word   |
+----+--------+
|  1 | بحر     |
|  2 | ماء    |
+----+--------+
2 rows in set (0.00 sec)

+----+-------+
| id | word  |
+----+-------+
|  1 | water |
+----+-------+
1 row in set (0.00 sec)

mysql> select * from ArEn;
+-----------+------------+
| arabic_id | english_id |
+-----------+------------+
|         1 |          1 |
|         2 |          1 |
+-----------+------------+
2 rows in set (0.00 sec)

On the user side you need a simple interface to get all the data associated with a word. You have a lot to do, good luck! :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Change that query to:

$result = mysql_query("SELECT * FROM customers WHERE customerID = '$customerID'") or die(mysql_error());

If there is a problem you will get the error, bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Change this:

$categories = $row

with:

$categories = $row;

;D

cereal 1,524 Nearly a Senior Poster Featured Poster

Yes you can, in dojo I use:

function unsetRadio() {
    dojo.query('#group1 input[type=radio]:checked').attr('checked',false);
}

it should be simpler with getElementById, bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Something like this should work, where the name has the format status_"id_user": status_1, status_2 ... status_23.

<input type="radio" name="status_1" value="to be" /> to be
<input type="radio" name="status_1" value="not to be" /> not to be

<input type="radio" name="status_2" value="to be" /> to be
<input type="radio" name="status_2" value="not to be" /> not to be

<input type="radio" name="status_3" value="to be" /> to be
<input type="radio" name="status_3" value="not to be" /> not to be

This will give you:
$_POST
$_POST
$_POST

Then use array_keys to extract user ids, you will end up with something similar to this:

<?php
$a = array_keys($_POST);
$array = array();
foreach($a as $key)
{
	if(preg_match('/status/i',$key))
	{
		$b = explode('_',$key);
		echo 'id: ' . $b[1] . ' value: ' . $_POST[$key];
		
		# uncomment below to build an array
		# $array[] = array($b[1] => $_POST[$key]);
	}
}

#print_r($array);
?>

hope it's useful, bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Here's an example:

------------
file: a.xml
------------

<xml>
	<channel>
		<item>
			<title>a title 1</title>
			<link>a_link_1</link>
		</item>
		<item>
			<title>a title 2</title>
			<link>a_link_2</link>
		</item>
		<item>
			<title>a title 3</title>
			<link>a_link_3</link>
		</item>
	</channel>
</xml>


------------
file: b.xml
------------

<xml>
	<channel>
		<item>
			<title>b title 1</title>
			<link>b_link_1</link>
		</item>
		<item>
			<title>b title 2</title>
			<link>b_link_2</link>
		</item>
		<item>
			<title>b title 3</title>
			<link>b_link_3</link>
		</item>
		<item>
			<title>b title 4</title>
			<link>b_link_4</link>
		</item>
	</channel>
</xml>


---------------
file: read.php
---------------

<?php
$a = file_get_contents('a.xml');
$b = file_get_contents('b.xml');
$xa = new SimpleXmlElement($a);
$xb = new SimpleXmlElement($b);	

$na = $xa->channel->item->count();
$nb = $xb->channel->item->count();
$c = ($na == $nb) ? $na : max($na,$nb);	# how many loops? in this example 4 because b.xml has 4 items

if($c != 0)
{
	echo '
	<ul>
	';
	for($i = 0; $i < $c; $i++)
	{
		if($xa->channel->item[$i] == true)
		{
			echo '
			<li><a href="'.$xa->channel->item[$i]->link.'">'.$xa->channel->item[$i]->title.'</a></li>
			';
		}
		
		if($xb->channel->item[$i] == true)
		{
			echo '
			<li><a href="'.$xb->channel->item[$i]->link.'">'.$xb->channel->item[$i]->title.'</a></li>
			';
		}
	}
	echo '
	</ul>
	';
}
?>

Just change $c to (for example) $c = 2; if you want to control how many links your application is going to display. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

In CI you should use a model to do this kind of tasks, but you can pack the result to a string and return that, just use true as third parameter in $this->load->view :

$string = $this->load->view('my_view',$data,true);

A full example would be:

public function test()
{
    $data['a'] = 'hello world!';
    $string = $this->load->view('first_view',$data,true);
    return $string;
}
    
public function hello()
{
    $data['read'] = $this->test();
    $this->load->view('second_view',$data);
}

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

It's late and I still think to let users figure how to match limits but, I was reading imagemagick docs and found this: -define jpeg:extent={size} You can use it like this:

convert -define jpeg:size=900x900 -define jpeg:extent=32kb -thumbnail 450x450 -quality 95 IMG_7070.jpg test_50_b.jpg

This command will rewrite the thumbnail changing quality until it matches the right sizes. It will slow down respect to normal converting but it's not too heavy. The first define it's used to increase speed, you can set it at the same size of the thumbnail -define jpeg:size=450x450 , but I prefer an higher value, it will give a better quality.

Bye :)

Source: http://www.imagemagick.org/Usage/formats/#jpg_write

cereal 1,524 Nearly a Senior Poster Featured Poster

Try this:

$options['img']= array(
    'D:\\xampp\htdocs\oct\images\A4-book1.jpg' => array('obj'=>2),
    'D:\\xampp\htdocs\oct\images\A4-book1.jpg' => array('obj'=>4)
);

Where 2 and 4 are the page numbers.

cereal 1,524 Nearly a Senior Poster Featured Poster

Add a new var on line 17:

var check = true;

And for each if statement, replace return (false); with check = false; At the end, where you wrote return true; write:

if(check == true)
{
    return true;
    // send form
}

else
{
    return false;
}
cereal 1,524 Nearly a Senior Poster Featured Poster

change it with this:

echo '<img src="'.$data['gambar'].'"><br>';

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

This is called Method Chaining and yes, you can use it whenever you want if the class is built in the right way. Check this comment on PHP Manual: http://www.php.net/manual/en/language.operators.php#87904
bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Line 15:

Ext.form.Field.prototype.msgTarget = "side";

That means you need a container where to write the form:

<div id="side"></div>
cereal 1,524 Nearly a Senior Poster Featured Poster

You can create that file and start mysql like this:

mysql --defaults-extra-file=/etc/mysql/my.cnf

Here you can find more information about Option Files: http://dev.mysql.com/doc/refman/5.5/en/option-files.html
bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Apparently there's nothing wrong. Which error are you receiving?
$product is defined like: $product = $_POST['product']; ?

cereal 1,524 Nearly a Senior Poster Featured Poster

Sure, in this line you need to set the value:

<input type="text" name="Conveyor Number" />

that becomes something like:

<input type="text" name="Conveyor Number" value="<?php echo $id; ?>" />

Right now, update_record.php doesn't send out this value. And the form in your layout.php page doesn't have an ID field value, you set a different name for each button and send a value like this: CMD_LRC1140
this:

<input name="CMD_LRC1138" type="button" id="CMD_LRC1138" value="CMD_LRC1138" onclick="location.href='update_record.php'"/>

should be:

<input name="id" type="submit" id="CMD_LRC1138" value="CMD_LRC1138" />

So try to change your layout.php form to this:

<form id="form2" name="form2" method="post" action="update_record.php">
    <p><label><input name="id" type="submit" id="CMD_LRC1140" value="CMD_LRC1140" /></label></p>
    <p><label><input name="id" type="submit" id="CMD_LRC1138" value="CMD_LRC1138" /></label></p>
    <p><label><input name="id" type="submit" id="CMD_LRC1115" value="CMD_LRC1115" /></label></p>
</form>

In update_record.php you can write:

$id = $_POST['id'];

# the query will become:
$query_Recordset1 = "SELECT * FROM conveyor_number WHERE conveyor_number.`Conveyor Number` = $id";

Hope is useful. Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Your code seems ok to me. Maybe this comment can be useful for you: http://www.php.net/manual/en/language.oop5.basic.php#92759
bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Check the quotes on line 5: $this->set_session('logged', true);

cereal 1,524 Nearly a Senior Poster Featured Poster

In order to access from the virtual server you need to change a setting on the database config file. Search for my.cnf and change this line:

bind-address = 127.0.0.1

Set the ethernet IP of the host machine. By default MySQL listens only on localhost. When you done restart MySQL server and it should work.

cereal 1,524 Nearly a Senior Poster Featured Poster

It's really hard to read this code. Next time use bbcode tags.

On update_record.php this query is not complete:

$query_Recordset1 = "SELECT * FROM conveyor_number WHERE conveyor_number.`Conveyor Number`";

It should be:

$query_Recordset1 = "SELECT * FROM conveyor_number WHERE conveyor_number.`Conveyor Number` = `id_to_search`";

Try to change this.

Now. Layout page is just used to open the edit form on update_record? Am I wrong? Why don't you just use links? Something like:

<a href="update_record.php?id=1">update record</a>

On the update page you just need to run a command like this:

if(ctype_digit($_GET['id']))
{
   $id = $_GET['id'];
   $query_Recordset1 = "SELECT * FROM conveyor_number WHERE conveyor_number.`Conveyor Number` = $id";
}
cereal 1,524 Nearly a Senior Poster Featured Poster

beep_multiple_beep_action_form() is a function to build an array, you can use print_r to display the array:

$a = beep_multiple_beep_action_form($context);
print_r($a);

But you need to search where this function is used, in order to see the original array.
This code $beeps = $form_state['values']['beeps']; instead is used to display part of a multidimensional array, something like this:

array(
    'values' => array('beeps' => 'some data')
);

bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

You should post your update query and the form used. Without code we can't tell you where mistakes are.

cereal 1,524 Nearly a Senior Poster Featured Poster

Together with pritaeas suggest, you can also append a random string to the end of the file:

<a href="/path/file.txt?random_string">file name</a>

you won't need that value to open the file and the browser will read always a new link.

cereal 1,524 Nearly a Senior Poster Featured Poster

I see readDateJS not readDate on the PHP script. May be this?

cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe you can use memcached. When Post does an operation you save a value on memcached, Get will do a loop in search of that value (stored in RAM), this will not affect the database until the condition is true. Example:

<?php
# Post
$query = mysql_query("INSERT INTO your_table () values()");

$m = new Memcached('mymemc');
$m->setOption(Memcached::OPT_PREFIX_KEY, 'myapp:');
$m->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);
$m->addServer('127.0.0.1',11211);

$m->add('cache','hello world!',100); # 100 seconds before disappearing
?>

On the other side:

<?php
# Get
$m = new Memcached('mymemc');
$m->setOption(Memcached::OPT_PREFIX_KEY, 'myapp:');
$m->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);
$m->addServer('127.0.0.1',11211);

if($m->get('cache') == true)
{
    $query = mysql_query("SELECT * FROM your_table ...");
    $m->delete('cache');
}
?>

More information: http://www.php.net/manual/en/book.memcached.php

cereal 1,524 Nearly a Senior Poster Featured Poster

Great, you're welcome! Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster
cereal 1,524 Nearly a Senior Poster Featured Poster

Try to change line 251 with this:

$result = mysql_query ($data) or die(mysql_error());

Just to understand if the query is returning an empty set or if there is an error. I can't think anything else, I'm sorry ;(

cereal 1,524 Nearly a Senior Poster Featured Poster

What happens if you use this query?

$data = "SELECT plantsdb.name, plantsdb.type, plantsdb.size, plantsdb.yard, plantsdb.field, plantsdb.total FROM plantsdb LEFT JOIN findplantsdb ON plantsdb.name=findplantsdb.Name WHERE findplantsdb.Color in($FlowerList) AND findplantsdb.Lastword in($LastwordList) AND findplantsdb.Type LIKE 'ROSE'";

Check what happens on line 199 and 207:

# this could be wrong
$FlowerList = "'".join("','",$_POST['Flower'])."'";

# for single checkbox will output: 'blue' and that's ok
# for multiple checkbox: 'blue,red,yellow,white' instead of 'blue','red','yellow','white'

# so try:
$FlowerList = join(",",$_POST['Flower']);
cereal 1,524 Nearly a Senior Poster Featured Poster

Can you post the form where there are the checkbox fields? In order to work the checkbox name as to be the same for each group, so you send an array to the script, when you receive that, you implode() the array or do a loop to use it in the query:

<input type="checkbox" name="roses[]" value="blue" /> blue
<input type="checkbox" name="roses[]" value="red" /> red
<input type="checkbox" name="roses[]" value="white" /> white

On PHP side you write:

$FlowerList = implode(',',$_POST['roses']);

$data = "SELECT plantsdb.name, plantsdb.type, plantsdb.size, plantsdb.yard, plantsdb.field, plantsdb.total FROM plantsdb LEFT JOIN findplantsdb ON plantsdb.name=findplantsdb.Name WHERE findplantsdb.Color in($FlowerList) AND findplantsdb.Lastword = $LastwordList AND findplantsdb.Type LIKE 'ROSE'";

Do the same for Rose Class. This example works only if in findplantsdb there is only one color per row.

cereal 1,524 Nearly a Senior Poster Featured Poster

You need to use a CSS rule to restrict the area: td { width: 200px; } Add a class if you want to limit that rule only to some td . Otherwise you can use the tag pre .

If this is not what you need, please give more information, post an example of the code used and the output expected.

cereal 1,524 Nearly a Senior Poster Featured Poster

Try this, is done with your arrays:

<?php
$instruments = array(
	array( 'ID' => '1', 'Name' => 'Guitar', 'Model' => 'Gibson Dark Fire'),
	array( 'ID' => '2', 'Name' => 'Guitar', 'Model' => 'Gibson Dusk Tiger'),
	array( 'ID' => '3', 'Name' => 'Banjo', 'Model' => 'Mad Moon'),
	array( 'ID' => '4', 'Name' => 'Ukulele', 'Model' => 'Koa'),
	array( 'ID' => '5', 'Name' => 'Guitar', 'Model' => 'Gibson Robot Guitar')
);
$stores= array(
	array('ID' => '1', 'Name' => 'Rock Store 1', 'Address' => 'another street n1'),
	array('ID' => '2', 'Name' => 'Bohemian Rhapsody Store', 'Address' => 'plaza n2'),
	array('ID' => '3', 'Name' => 'Indie Music Instruments', 'Address' => '3rd street n123'),
	array('ID' => '4', 'Name' => 'Blues Brothers', 'Address' => '1060 West Addison ')
);

$arrayInstrumentsStores = array(
	"relation1" =>array("instID"=>"1","storeID"=>"1"),
	"relation2" =>array("instID"=>"1","storeID"=>"2"),
	"relation3" =>array("instID"=>"4","storeID"=>"3"),
	"relation4" =>array("instID"=>"2","storeID"=>"1"),
	"relation5" =>array("instID"=>"3","storeID"=>"2"),
	"relation6" =>array("instID"=>"5","storeID"=>"4")
);

$string = 'Guitar';
$search = ucfirst(strtolower($string));
$result = '';

foreach($instruments as $key => $value)
{
	if($value['Name'] == $search)
	{
		$a = $value['ID'];
		foreach($arrayInstrumentsStores as $k => $v)
		{
			if($v['instID'] == $a)
			{
				$result[$v['storeID'].':'.$a]['storeID'] = $v['storeID'];
				$result[$v['storeID'].':'.$a]['instID'] = $a;
				$result[$v['storeID'].':'.$a]['instName'] = $value['Name'];
				$result[$v['storeID'].':'.$a]['instModel'] = $value['Model'];
			}
		}


	}
}
#print_r($result);
echo "\n";
$c = count($stores);
if(is_array($result))
{
	for($i = 0; $i < $c; $i++)
	{
		foreach($result as $key =>$value)
		{
			if($stores[$i]['ID'] == $value['storeID'])
			{
				echo $stores[$i]['Name'] . "\n";
				echo $stores[$i]['Address'] . "\n";
				echo $value['instName'] . "\n";
				echo $value['instModel'] . "\n\n";
			}
		}
	}
} else {
	echo 'not found' . "\n";
}

?>

The output will be:

Rock Store 1
another street …