Forum: PHP 5 Days Ago |
| Replies: 10 Views: 342 I cleaned up the code a bit and although I don't know much about setting up the arrays in a html form I believe the complete code should look more like the following:
<strong>Update multiple rows in... |
Forum: PHP 5 Days Ago |
| Replies: 10 Views: 342 That code in it's design is flawed. The following line will cause a lot of trouble:
$sql1="UPDATE $tbl_name SET AcMake='$AcMake[$i]', AcCapacity='$AcCapacity[$i]', AMP='$AMP[$i]', qty='$qty[$i]'... |
Forum: PHP 25 Days Ago |
| Replies: 2 Views: 364 The following should do the trick the the result being in the $res array
<?php
$var=$_POST['box'];
$i=1;
$res=array();
$var=(empty($var))?array():$var;
foreach ($var AS $val) {
... |
Forum: PHP 29 Days Ago |
| Replies: 12 Views: 530 I see how that can be handy but another thing I have noticed with sites like google and youtube is that they seem to redirect users to their country code domain meaning there is a separate database... |
Forum: PHP 29 Days Ago |
| Replies: 12 Views: 530 Just a note on that. Wikipedia receives 1,000 new articles every day and many more edited articles so it is possible to compare Wikipedia to ever changing websites such as Facebook. I guess it is a... |
Forum: PHP 30 Days Ago |
| Replies: 12 Views: 530 Are you at all familiar with the mediawiki cms. That is the same cms wikipedia uses and it does not spread into millions of tables. Instead it has hundreds of computers that just process the... |
Forum: PHP 30 Days Ago |
| Replies: 12 Views: 530 Well actually I have been told in the mysql forum that if you design a table so that it has indexing you shouldn't ever need multiple tables for the one job. That is when designed properly because... |
Forum: PHP Nov 18th, 2009 |
| Replies: 12 Views: 463 Maybe my explanation was too short. Sometimes people will do the following:
<?php
$connection = mysql_connect("myserver.com","myuser","mypassword") or die ("Couldn't connect to server.");
$db =... |
Forum: PHP Nov 18th, 2009 |
| Replies: 12 Views: 463 So it displayed something... So we know that you were using the right names but the normal cause of this is an extra line of code. Try the following script.
<?php
$connection =... |
Forum: PHP Nov 18th, 2009 |
| Replies: 12 Views: 463 To test if no rows are found try the following:
while( $data2 = mysql_fetch_array($query)) {
echo $data2[0];
echo $data2[1];
echo $data2[2];
}
The nothing is displayed then that means there... |
Forum: PHP Nov 17th, 2009 |
| Replies: 12 Views: 463 Replace lines 11 to 13 with the following
echo $data2['firstname'];
echo $data2['lastname'];
echo $data2['task']; |
Forum: PHP Nov 17th, 2009 |
| Replies: 19 Views: 587 Just to make it clear - indeed there should be no echos before the header(). |
Forum: PHP Nov 17th, 2009 |
| Replies: 19 Views: 587 That is correct from what I have read in the past. |
Forum: PHP Nov 17th, 2009 |
| Replies: 4 Views: 502 Perhaps this:
<?php
mysql_connect(HOST,USER,PASS);
@mysql_select_db("db303278079") or die( "Unable to select database");
$query="SELECT * FROM restaurants";
$result=mysql_query($query);... |
Forum: PHP Nov 17th, 2009 |
| Replies: 19 Views: 587 Well actually the entire page will be process by php unless the exit; statement is placed there. So for example if you have a mysql insert it will insert before redirecting unless the exit; is placed... |
Forum: PHP Nov 17th, 2009 |
| Replies: 4 Views: 275 If you want wildcards then the following contains the wildcards:
$sql = 'SELECT * FROM device WHERE `device_num` LIKE "%'.mysql_real_escape_string($val_d).'%" OR `dib` LIKE... |
Forum: PHP Nov 17th, 2009 |
| Replies: 19 Views: 587 <?php
header("Location: http://yoursite.com/index.php");
exit;
//above must be at very top before any browser output |
Forum: PHP Nov 17th, 2009 |
| Replies: 3 Views: 586 Try adding the following to the top of your php file(s)
setcookie ('PHPSESSID', $_COOKIE['PHPSESSID'], time()+172800); |
Forum: PHP Nov 17th, 2009 |
| Replies: 4 Views: 275 Try replacing it with the following:
$sql = 'SELECT * FROM device WHERE `device_num` LIKE "'.mysql_real_escape_string($val_d).'" OR `dib` LIKE "'.mysql_real_escape_string($val_dp).'"'; |
Forum: PHP Nov 16th, 2009 |
| Replies: 4 Views: 318 I would have to say if you managed to get XAMPP working then good, keep it as XAMPP has a few minor additional features that WAMP doesn't have (eg. mailserver) although the installation for XAMPP is... |
Forum: PHP Nov 14th, 2009 |
| Replies: 3 Views: 251 Try the following:
<?php
require_once('config.php');
for ($i=1;$i<11;$i++) {
$aid='aid'.$i;
$$aid=$_POST['Question-'.$i];
$qid='qid'.$i;
$$qid=$_POST['qid'.$i]; |
Forum: PHP Oct 29th, 2009 |
| Replies: 5 Views: 296 You may want to note that for assigning a possibly undefined variable or array index/key the following is the correct method.
$PK = (isset($_POST['PK']))?$_POST['PK']:'';
The above is what line 24... |
Forum: PHP Oct 11th, 2009 |
| Replies: 3 Views: 328 Your links are all pointing to the wrong location and should be something like as follows: <?php
//REMEMBER TO CONNECT TO DATABASE!
$show_all=$_POST['rg01']; // Show All
//echo $show_all;
... |
Forum: PHP Sep 28th, 2009 |
| Replies: 12 Views: 371 Why won't that work. Is there something in the included library that prevents it working. The only thing I would suggest is escaping the variable $key like the following:$zips =... |
Forum: PHP Sep 28th, 2009 |
| Replies: 5 Views: 193 From my experience yes it is. |
Forum: PHP Sep 25th, 2009 |
| Replies: 8 Views: 298 I entered in the specs of the plan I'm on with my host and it's over double the price. If there was something like that where you can decide cpu, storage space and bandwidth for a third of the price... |
Forum: PHP Sep 25th, 2009 |
| Replies: 5 Views: 842 To retrieve the variable param from the url simply use $_GET['param'] to get its value. |
Forum: PHP Sep 24th, 2009 |
| Replies: 8 Views: 298 I did a google search and the following link might be of great interest to you. http://www.m6.net/ Enjoy. |
Forum: PHP Sep 16th, 2009 |
| Replies: 3 Views: 449 That part of the syntax is totally wrong. I don't think that an include is not meant to be in an if statement. Also replace the include with the require function which does the same thing but with... |
Forum: PHP Sep 13th, 2009 |
| Replies: 6 Views: 414 Try rebooting the apache httpd service. I've noticed on windows rebooting the computer doesn't restart the httpd service so you will need to go into your controll panel to restart the apache httpd... |
Forum: PHP Sep 12th, 2009 |
| Replies: 6 Views: 414 Well a server can have several php.ini files and only one of them are really used. So make sure the php.ini file you changed is the same one as listed when you use the following code:
<?php... |
Forum: PHP Sep 12th, 2009 |
| Replies: 2 Views: 317 Perhaps the following:
//get username
$username='Bill Gates';
//validate
$username=mysql_real_escape_string($username);
//set the sql query
$result=mysql_query('SELECT * FROM `table` WHERE... |
Forum: PHP Sep 11th, 2009 |
| Replies: 4 Views: 435 What's the problem or is this solved? |
Forum: PHP Sep 11th, 2009 |
| Replies: 4 Views: 435 In future please use code tags as this is not your first post. Also the following code should do the trick:
$category_id=mysql_real_escape_string(stripslashes($_POST['category_id']));... |
Forum: PHP Sep 11th, 2009 |
| Replies: 16 Views: 786 In Ubuntu. ok. I found this problem when I first got a Virtual Private Server. The server had a different file structure than what my Ubuntu did. So try to browse around your server to make sure... |
Forum: PHP Sep 11th, 2009 |
| Replies: 16 Views: 786 No error. That's because you didn't echo the exec function. Line 18 should be as follows:
echo exec($createBackup); |
Forum: PHP Sep 10th, 2009 |
| Replies: 6 Views: 268 Try replacing line 11 with the following:
$file[] = str_replace(" ","_",$_POST[$files1]); |
Forum: PHP Sep 10th, 2009 |
| Replies: 6 Views: 268 Try on line 34 the following code and tell us the results:
echo '<xmp>'; print_r($file_names); echo '</xmp>';
That should dump the keys and values of the array. They don't always have numbers... |
Forum: PHP Sep 9th, 2009 |
| Replies: 13 Views: 1,330 I believe it is the break; code in the switch statement. That is why I suggested replacing it with an if statement. But obviousley there is something fishy going on with the $returnCode variable. |
Forum: PHP Sep 9th, 2009 |
| Replies: 13 Views: 1,330 Weird. Should have worked. :?:
Below is another piece of code you can try and hopefully it should work.
$returnCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($returnCode!=='200' ||... |