39,320 Topics
| |
Please consider the following class : <?php class p0110dbinsertbuilder { public $table=""; private $fields ; public function add($Field,$Value){ $this->fields = array($Field,$Value); } public function insertstring(){ $count = count($this->fields,0); $c = "INSERT INTO " . $this->table . "("; for ($i=0;$i<$count;$i++){ $c .= $this->fields[$i][0]; if ($i <> $count-1){ $c .= ","; } … | |
hello dear Friends i just discover this forum i don't know more about how it work here, i need help to complete my website i created a shopping cart with php in dreamweaver with generated code all work fine customer can add product to cart and edit quantity , see … | |
$a = array(000,400,000,500); $b = array(300,400,450,500); $i=0; foreach($b as $k=>$v) { if($v==$a[$i]) { $b[$k]='000'; } $i++; } print_r($b); i want same thing in two dimensional array $a = Array ( [0] => Array ( [0] => 000000 [1] => 000400 [2] => 000450 ) [1] => Array ( [0] => … | |
I have two lists which I have sorted with asort(). $weightings = Array([7] => 1,[3] => 2,[1] => 10,[2] => 10,[10] => 10,[6] => 10,[4] => 15,[5] => 15,[8] => 20,[9] => 20); $revised_date = Array([1] => 1378652385,[2] => 1378654024,[3] => 1378654113,[4] => 1378654151,[5] => 1378654201,[6] => 1378654239,[7] => 1378654273,[8] … | |
Hi, i want to login with facebook and go back 1 page - window.history.back() - but only when error=1 (login.php?erro=1): This is the process_facebook.php: if($UserCount[0]){ //User is now connected, log him in login_user(true,$me['first_name'].' '.$me['last_name']); echo $_GET['erro']; /*if(isset($_GET['erro'])){ echo "<script>window.history.back();</script>"; }*/ } else{ // Insert user into Database. @mysql_query("INSERT INTO users … | |
How can I prevent a XSS attack but allow user to post iframe and img? My page is php based but I allow users to submit text and have allowed only iframes and imgs with strip_tag How do I prevent a user from launching an xss attack? | |
hello everybody i buil my dynamic site in dreamweaver cs6 but i'm not abble to formate the nember i want format number to decimal number like float in phpmyadmin this is how i do and it don't work please help thank. <label for="shipping">Sub total</label><input name="subtotal2" type="text"id="subtotal2" value="<?php echo $row_total[ number_format, … | |
Hi, I am using jquery tabs for displaying data.And while displaying the data in the tabs I have to use ajax again to display data. The data in the first tab is giving the desired result. But when I click on the second tab. The tab is loaded correctly. But … | |
Hi everyone, I have a website that gives me the following url when viewing a users profile. website.com/index.php?a=profile&u=username I am trying to create a htaccess rule that will generate a friendly url like website.com/username The existing htaccess file is RewriteEngine on RewriteCond %{request_filename} -f RewriteRule ^(.*) $1 [L] RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ … | |
Please consider my "execute" method of my db class. When I pass it a bad sql, it does not thow the PDOException, just returns $return === false and does not do anything in the db. What am I missing? public function execute($sql){ if (!$this->connection){ try{ $conn = new pdo(self::$dbName ,self::$user … | |
Full disclosure - I'm not total novice so any help would be appreciated but simple help for dummies will be **extra** appreciated :) I'm creating a form in an html page. It needs to link up with a payment gateway and forward the entered information (I'm currently using the method="post" … | |
i am getting array output as: Array ( [0] => Array ( [0] => 000000 [1] => 000400 [2] => 000450 ) ) Array ( [0] => Array ( [0] => 000350 [1] => 000400 ) ) i want output like this: Array ( [0] => Array ( [0] => … | |
hello Dear friend of Daniweb i'm new in this site i just discovered yesterday, i find here fine. i create my website in Dreamweaver i created shopping cart and on local server in wamp it work fine but when i upluad on my hosting server i get this error: <?php … | |
Hi, I want to import only zip codes (inside csv) into one of table inside mysql database. All zip codes are in a csv file. When I run PHP code it works only with first zip code. Can somebody please help me on this where I am doing mistake. Here … | |
Hello, I have an array that I need to sort by keys. The array looks like this: Array ( [0] => Array ( [question_title] => Question 8 [question_description] => [type_id] => 1 [type_title] => Yes/No [question_number] => 8 ) [1] => Array ( [question_title] => Question 9 [question_description] => [type_id] … | |
I am getting following error when trying to click the next or previous button on following site: http://bdworld.co/newest.php?categoryId=35 > Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/69/9332569/html/imagewar/newest.php on line 30 Newest Pictures! ( Others ) SQL query failed. Check your query. Error Returned: You have an … | |
So I am trying to write to an xml file. When I do it, NO SYNTAX comes up! BUT, When I go to the xml file it's supposed to write to it looks untouched and none of the data is there. here is my PHP code: <?php $xmldoc = new … | |
This is my links in website: mywebsite.com/index.php?id_1=main&id_2=kontakt mywebsite.com/index.php?id_1=main&id_2=onama How to remove from url that be like this mywebsite.com/index.php/onama mywebsite.com/index.php/kontakt This is my index.php and in template pocetna.php <li><a href="index.php?id_1=main&id_2=kontakt">КОНТАКТ</a></li> <li><a href="index.php?id_1=main&id_2=onama">О НАМА</a></li> <?php session_start(); require_once("configuration.php"); require_once("functions.php"); require_once("session_load.php"); //require_once("connection.php"); $url_id = get_url_value(); // ucitavanje pocetne strane, homepage if (($url_id['grupa'] == "0") … | |
| So I always wondered this, probably a bit dense. Let's say I've got a url string http://somelink.php?id=7 And that takes the user to another page which gives them access to something private. But what is to stop the user replacing the 7 with say an 8 (manually editing the url … |
table slabpay ------------------------------------------------------- agent_id|agent_name|cust_id|cust_name|installment_amt| ------------------------------------------------------- 1 |mike |1 |john |350 | ------------------------------------------------------- 1 |mike |1 |john |400 | ------------------------------------------------------ 1 |mike |2 |abraham |350 | ------------------------------------------------------- 1 |mike |1 |john |450 | ------------------------------------------------------- 1 |mike |2 |abraham |400 | ------------------------------------------------------- mysql query ------------------------------------------------------ `$select = mysql_query("SELECT cust_id, cust_name,installment_amt FROM slabpay … | |
Hi Guys, Completely new to PHP! Just wanted to play around with Fields and submit stuff to a database on localhost through xampp. This code writes to the database no problem, except no insert is happening with 'Telephone' and it throws this error; Notice: Undefined index: Telephone in C:\xampp\htdocs\Inputs\update.php on … | |
| So guys I have a vanilla install of code igniter and the thing returns a internal server error 500. This is only on my linux box. It works in windows xp on a virtual machine but I'd love to have it work on my linux box. So what do you … |
Hi I need an help on showing related post in an website. i want to display my related posts with help of keywords column. Below is my database structure id int(12) title varchar(250) content varchar(250) image_path varchar(250) type varchar(250) keywords varchar(250) can any one please help me. Thanks | |
Hi all, am trying to use bootstrap switch in my form. Am at a lost as to how to get the value of name="onoffswitch" from that field and insert it into mysql db, here is my code... div class="onoffswitch"> <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked> <label class="onoffswitch-label" for="myonoffswitch"> <div class="onoffswitch-inner"></div> … | |
I want to do what i describe on the title using php. Is it possible ? And how ? Something like this for example: http://www.pestaola.gr/ you can realize that there are pictures on menu bar. Thanks in advance. | |
my actual code is: $agent_id=mysql_real_escape_string($_GET['memberid']); $result = mysql_query("SELECT id,ac_no,agent_name FROM ankali_slabpay WHERE agent_id=$agent_id ORDER BY id DESC LIMIT 1"); $row = mysql_fetch_array($result); $ac_number=$row['ac_no']; $agent_name=$row['agent_name']; ?> <?php $b = array(000350,000400,000450); //pre-defined installment amount values $replacement = "000000"; $cust_mast = '$C21'; $bank_name = 'KISAN SWARAJ'; $dfile = "READ ME CUSTOMERS.txt"; $fo = … | |
When I insert data into the database, for instance, a new client, and after that query the clients in the database, the new client is not immediately shown in the list. For it to be listed, I have to clear the cookies and log in, again, into the site. Why … | |
Hello, I have Error Like this when i open the table in phpmyadmin.. why this is happening with table ? please any solution for that... #145 - Table is marked as crashed and should be repaired Thanks | |
Dear Sirs, I would like to update some information in my MySQL through a PHP syntax, but it won't work. I'll show you my code. while($info = mysql_fetch_array( $data )) { if ($info['author'] === $user_data['username']) { print '<div class="registerleft"> <form action="" method="post"> <ul> <h2>A tulaj</h2> <li> Vezeteknev<br> <input type="text" name="first_name" … | |
<?php require("Dbconnect.php"); //echo "<table id='t1'>"; $cls=$_GET['class']; //$count=0; echo $cls; $qry ="select cls_section_id from class where Class_name='$cls' "; $result=mysql_query($qry); while($row=mysql_fetch_array($result)) { echo $row['cls_section_id']; } ?> http://localhost/ediary/school%20%20diary%20system/subjectassign.php?class=%20NURSERY-A therefore $cls has value=NURSERY-A and when i am querying it does not result anything and instead of $cls if i use 'NURSERY-A' directly then output … |
The End.