39,326 Topics
| |
Hi, I use a query which is identical throughtout my application, only thing that differs is the select part of the query, so for example: mysql_select_db("mydatabase", $con); $result4 = mysql_query("SELECT * FROM nap where Exchange LIKE '$majorvalue%'"); while($row = mysql_fetch_array($result4)) { $psba = $row['Site']; $status = $row['Status']; $spectrum = $row['InSpectrum']; … | |
how to update table in foreach loop with where clause my code: foreach($output as $var) { $tmp = explode(",", $var); $collec_date = $tmp[2]; $cust_id = $tmp[4]; $cust_name = $tmp[5]; $install_no = $tmp[6]; $amount = $tmp[7]; $sql = "UPDATE ankali_slabpay SET install_date='$collec_date', install_amt='$amount' WHERE ac_no='$cust_id' AND install_no='$install_no' AND $install_amt='000000' GROUP BY … | |
What im tryig to do is add one line of code to all files at once Can this even be done ? I have tried reading all files in a directory then fopen to fwrite without any success. Any ideas ? Thank you | |
I want to remove all enters from an input and replace them with a single space. By that I mean something as </br>. So if someone places the input like this Hello, my name is bob. How are you? It will look like this, Hello, my name is bob. How … | |
User fills out certain values in a form and hits the submit button. The values the user filled out will be submitted to the database. The user needs to come back to that form and be able to update the values he did not enter the first time. How would … | |
Hello. I've created 2 pages that i'm currently working on. One is called; Test.php -- which just includes a basic form in HTML. <Form name ="form1" Method ="POST" Action ="result.php"> Building Name: <INPUT TYPE = "TEXT" Name ="buildingName"> Room Number: <INPUT TYPE = "TEXT" Name ="roomId"> <INPUT TYPE = "Submit" … | |
I need help for my code when i login successfly i have error this is my code: <?php session_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="portfolio_baza"; // Database name $tbl_name="skole_login"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot … | |
I'm working with openid library and one thing has been bodering me. <?php # Logging in with Google accounts requires setting special identity, so this example shows how to do it. require 'openid.php'; try { # Change 'localhost' to your domain name. $openid = new LightOpenID('localhost'); if(!$openid->mode) { if(isset($_GET['login'])) { … | |
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 … |
The End.