Posts
 
Reputation
Joined
Last Seen
Ranked #543
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
34
Posts with Upvotes
31
Upvoting Members
25
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
6 Commented Posts
5 Endorsements
Ranked #340
Ranked #396
~67.1K People Reached
Favorite Tags
Member Avatar for aneeqtariq_143

I have the same requirement so I wrote a few lines that would demonstrate the answer to your question and give me a base to work from. <?php if (isset($_POST['submitted'])){ print_r($_POST); } ?> <html> <head> <script type="text/javascript"> function addTextArea(){ var div = document.getElementById('div_quotes'); div.innerHTML += "<textarea name='new_quote[]' />"; div.innerHTML += …

Member Avatar for diafol
0
7K
Member Avatar for davy_yg

I think you are confusing two file system types; localhost is for the browser address bar and relates to hostnames, but the script needs the system path. If 'install.php' is in the same directory, then you can try `'./install.php'` (./ is shorthand for this directory). You need to give the …

Member Avatar for Alberto Bucur
0
170
Member Avatar for ricardojorge.net

@ricardojorge register.php line 35: `$r = mysql_query($q);` add some error checking: `if(!$r = mysql_query($q)) die(mysql_error());` do you get an error message? @lastmitch I agree with you, but I fancied the challenge and was already looking :)

Member Avatar for Ank1
0
444
Member Avatar for anirban1087

I copied your code into my own page and ran it and got a result with FF, IE and Chrome: object(SimpleXMLElement)#1 (1) { [0]=> string(5) "52.82" } Strange...

Member Avatar for R0bb0b
0
291
Member Avatar for adam.adamski.96155

Hello :D I am using the twitter API to perform a search for a certain author, and storing the results in a database so that I can perfrom an action on each entry. However, there are many duplicate results that have small differences at the beginning of the string or …

Member Avatar for adam.adamski.96155
0
4K
Member Avatar for adam.adamski.96155

Hello :) I'm working with a database of postcodes. I have an existsing query that returns the postcodes within a certain radius: `select *, acos(cos(51.496502411798 * (PI()/180)) *cos(-0.13982862499836 * (PI()/180)) *cos(lat * (PI()/180)) *cos(lng * (PI()/180))+cos(51.496502411798 * (PI()/180)) *sin(-0.13982862499836 * (PI()/180)) *cos(lat * (PI()/180)) *sin(lng * (PI()/180))+sin(51.496502411798 * (PI()/180)) *sin(lat …

Member Avatar for pritaeas
0
137
Member Avatar for GraficRegret

Hey GraficRegret, welcome to Daniweb :) Your description sounds like a typical use of PHP and MySql, but what help do you specifically need? Is there some code you need some assistance with? Are you looking for general considerations and tips from those who already walked that road?

Member Avatar for diafol
0
180
Member Avatar for bops

There are probably better ways, but I would make a temporary database with mysql and store them in there for easier manipulation. I would write a script to insert a few hundred at a time, and add the records gradually to avoid PHP execution limit, with an echo for every …

Member Avatar for bops
0
1K
Member Avatar for Farhad.idrees

I see the problem: `function validateForm(Qform)` expects a parameter passed with the function call, but you pass nothing: `onSubmit="validateForm();` change it to: `onSubmit="validateForm(this); return false;"` and it should work okay.

Member Avatar for Farhad.idrees
0
325
Member Avatar for bettybarnes

Your database section looks a little mamlformed, specifically this line: `while ($query !=-1 && $row = mysql_fetch_assoc($query)) {` I would guess that the previous line: `$values = mysql_fetch_assoc($query);` already collected the necessary information, so if this line: `echo print_r($values, true);` prints the correct information, I would try changing your code …

Member Avatar for adam.adamski.96155
0
162
Member Avatar for amith_ami

Line 32: `$sql="INSERT INTO tbl_candidate(email_id) VALUES('$email_id1');` has a missing quote before the semi-colon. Line 39: `else{` is missing the preceding curly brace. Fix those, see what happens.

Member Avatar for amith_ami
0
96
Member Avatar for dinhunzvi

`if(isset($_POST['id']) && ($row['bankID'] == $_POST['id']))` or, `if(isset($row['bankID']) && ($row['bankID'] == $_POST['id']))` depending which key is not set. It's good that you have all errors showing.

Member Avatar for adam.adamski.96155
0
339
Member Avatar for manivannan.ajith

This hurts me more than it hurts you, but... [Let me google that for you!](http://lmgtfy.com/?q=what+is+json%3F)

Member Avatar for JorgeM
0
104
Member Avatar for albert.sibanda.9

Welcome to Daniweb **albertsibanda9** :) The long answer: [Read This Before Posting A *second* Question](http://www.daniweb.com/web-development/php/threads/435023/read-this-before-posting-a-question) The short answer: Post your code before LastMitch gets hold of you :D

Member Avatar for LastMitch
0
196
Member Avatar for tibor.marias

check for result if($result = mysql_query("SELECT * FROM table")){ while ($row = mysql_fetch_array($result)){ // don't echo immediately, store in $string $string .= '["' .$row[1]. '",' .$row[2].'],'; } // now $string has an extra comma... $string = substr($string, 0, -1); } use [substr()](http://uk3.php.net/manual/en/function.substr.php) to select all but last character, then echo …

Member Avatar for diafol
0
150
Member Avatar for shahai.ali

> but i want to show the error in such a way that name of the tables couldn't be shown... Is that all? `$query = mysql_query("DELETE FROM table_2 WHERE tchr_id='".$id."'") or die("Oops, we have a problem, please contact the administrator.");` Change message to suit.

Member Avatar for adam.adamski.96155
0
202
Member Avatar for shahai.ali

`$alert_error = "<script type=\"text/javascript\"> alert('".mysql_error()."') </script>";` In the above line you are referencing `'mysql_error()'`, but it doesn't exist yet because you did not run the query that produces the error. Also, you wanted Javascript to alert the value of `'mysql_error()'`: if (!$query = mysql_query("DELETE FROM abc WHERE id ='$id'")){ echo …

Member Avatar for shahai.ali
0
613
Member Avatar for mpc123

This is simple maths, use parentheses to force calculations in correct order: `field3 minus (field1 divided by field2)` $result = ( $row['field3'] - ($row['field1'] / $row['field2']) ); echo "<td>".$result."</td>";

Member Avatar for mpc123
0
170
Member Avatar for bitejones

There are probably better ways, but If I had to achieve it with existing knowledge, I would do something like this: $wordString = $_POST['search']; /* first test there are comma separated values */ if (strpos($wordString, ",")){ /* split string into array of strings on the comma */ $words = explode(",", …

Member Avatar for adam.adamski.96155
0
205
Member Avatar for dodgers125

@kevinp2012 seriously, are you asking the OP to improve **his** English? @dodgers125 I'm not *sure* what you want but maybe I can give some pointers about your code: <!-- header row, the 1 must be in quotes: border="1"--> <table border="1"> <tr><th>Sale Number</th> <th>Item</th> <th>Item Cost</th> <th>Units Sold</th> <th>Sale Cost</th> </tr> …

Member Avatar for adam.adamski.96155
1
231
Member Avatar for Riu 2009

Using javascript: <head> <!-- You must have the id set in the next line --> <link id="stylesheet" rel="stylesheet" type="text/css" href="default.css" /> <script type="text/javascript"> function switchStyle(el){ //get selected theme var styleSheet = el.options[el.selectedIndex].value; //apply the new style using id set earlier. document.getElementById('stylesheet').href = styleSheet; } </script> <body> <!-- (this) refers to …

Member Avatar for diafol
0
247
Member Avatar for Rizi004

I believe we have two insert types with MySQL: `"INSERT INTO tablename set field='value', column='amount'..."`, and `"INSERT INTO tablename (field, column) VALUES ('value', 'amount')"` But your query is a mixture of both and neither: `"INSERT INTO ".$table." values $fld='$this->add_security($val)'"`

Member Avatar for adam.adamski.96155
0
134
Member Avatar for Riu 2009

`$check= mysql_query("SELECT FROM accounts WHERE (email='".$email."')");` Select what from accounts? ALL, Id etc? I guess error checking the query would have given an error.

Member Avatar for Riu 2009
0
125
Member Avatar for xbat

**@xbat**, from what I can see, `'q'` is not defined in your JS code, it is not even referenced, so it can't be JS that's giving the error. The only way I can understand this undefined error regarding 'q' is the processing page, testwopart1.php. The beginning of the script (testwopart1.php), …

Member Avatar for xbat
0
424
Member Avatar for MarkieJye

A standard array of checkboxes: <input type="checkbox" id="unicycle" name="cycle[]" value="1">I have one wheel. <input type="checkbox" id="bicycle" name="cycle[]" value="2">I have two wheels. <input type="checkbox" id="tricycle" name="cycle[]" value="3">I have three wheels. Now, echoed with PHP: <?php //escaping the double quotes: echo "<input type=\"checkbox\" id=\"unicycle\" name=\"cycle[]\" value=\"1\">I have one wheel."; //using single quotes: …

Member Avatar for MarkieJye
0
151
Member Avatar for flynismo

It may well be possible to get all the things you want in one query, using the Join technique, but that is for someone else to tell you, have a look [here](http://www.daniweb.com/web-development/databases/mysql/threads/437575/combine-two-queries-into-one) :D As for looping through the way you mentioned: <?php $cityArray = new array(); $sql = "SELECT city …

Member Avatar for flynismo
0
111
Member Avatar for Khav

**vaultweller123** is exactly right. If you declare a variable: `$variable = "value";` ...and then you declare the same variable with a different value: `$variable = "another value";` ...the variable holds the second value and the first value is lost. It is the same in your loop, your variable '$url' can …

Member Avatar for adam.adamski.96155
0
409
Member Avatar for Albert Pinto

I read through the code you posted, it was messy and I felt dirty and soiled :D But your question is: > any idea how to pass the selected data to the backend page once i click submit ...?? ...and my answer is yes, I have plenty idea, and I …

Member Avatar for Albert Pinto
0
1K
Member Avatar for AndreRet

I don't see how the hidden input can possibly be populated with the intended value because it is PHP that echoes the value and PHP won't do anything once the page is loaded. `$_POST['brand']` needs to exist when the page is loaded for PHP to echo the value onto the …

Member Avatar for AndreRet
0
240
Member Avatar for php_noob

I answered the same question yesterday so I can just copy and paste :D You need to make sure all your form elements are contained within a form declaration: <form action="page_that_will_process_form.php" method="post"> <input type="text"... /> <input type="button"... /> </form> Make sure each input has a unique name. <input name="unique_name"... /> …

Member Avatar for adam.adamski.96155
0
153