812 Posted Topics

Member Avatar for satheeshakira

Use `UPDATE ... WHERE ...` syntax. If you want more detailed help post the code you already have and be as specific as possible with your question. Read [this](http://www.daniweb.com/web-development/php/threads/435023/read-this-before-posting-a-question).

Member Avatar for satheeshakira
0
2K
Member Avatar for ej.p.lopez

Put this temporary debug code on line 2: die($_GET['orderBy']); It should print the sort condition and stop the script. Check it whether is OK or post it here. Just a thought: maybe you should add a script name to your links: <a href="<?php echo __FILE__; ?>?orderBy=date">Type:</a>

Member Avatar for broj1
0
241
Member Avatar for hallianonline

This code is first compressed used zlib library and then base64 encoded, probably to obfuscate the original code, or just to simplify transport. There is no encryption key involved. The snippet above is just a reverse of this. The variable and function names are probably also obfuscated in a way …

Member Avatar for broj1
-1
211
Member Avatar for Sanjay_6

Your question is not very clear about what exactly is the problem. Is the text html? To display html use [htmlspecialchars](http://php.net/manual/en/function.htmlspecialchars.php) function which will safely display problematic characters (such as < and >). If you have different character sets use [mb_encode_numericentity](http://www.php.net/manual/en/function.mb-encode-numericentity.php) function instead. If the text is plain text your …

Member Avatar for broj1
0
1K
Member Avatar for kiLLer.zoh_1
Member Avatar for GlenRogers

Line 13: <?php echo $op;?> should probably create the html for options for the categories dropdown. But I can't find where $op is defined. Have you checked the generated code for the categoties dropdown?

Member Avatar for Banderson
0
4K
Member Avatar for son jo

And consider this: to access a mysql database you use a php database extension such as [mysql](http://php.net/manual/en/book.mysql.php), [mysqli](http://php.net/manual/en/book.mysqli.php) or [PDO](http://www.php.net/manual/en/book.pdo.php). If you are starting to learn please do not use the oldest mysql extension since it is being phased out. It is OK if you use newer mysqli extension but …

Member Avatar for broj1
0
433
Member Avatar for <M/>

Thanx for this tip. However note that $_SERVER['HTTP_REFERER'] is [not always 100% reliable](http://php.net/manual/en/reserved.variables.server.php).

Member Avatar for broj1
0
165
Member Avatar for jovstudios

First check whether the data in the table is OK (maybe you have multiple same inserts). The query in the getv.php seems to be missing the name field, since you refer to it in the while loop: $query = mysql_query("SELECT image, name FROM upload WHERE `category` = '$category'");

Member Avatar for Squidge
0
505
Member Avatar for thijscream

Are you sure the query returns 1? Test it with some code like: if($status == 1) { die('Status is obviously 1'); // header('location: index.php?user='.$user.''); } else { die('Status is actually ' . print_r($status, 1)); }

Member Avatar for chemwile
0
200
Member Avatar for GlenRogers

Unfortunately it is not enough just change mysql_* commands to mysqli_*. There are minor differences. For example mysql_query takes first parameter the query and optional second the link while mysqli_query takes the first parameter link (must be present) and second the query. I suggest you check the syntax of each …

Member Avatar for GlenRogers
0
160
Member Avatar for sanbhu2105

Put this temporary debug code on line 14. die("UPDATE tblproduct SET status='inactive' WHERE prod_id='".$prod_id."';"); It will display the query and stop the script. Now copy the query in phpmyadmin and test it.

Member Avatar for diafol
0
240
Member Avatar for lloydsbackyard

You should use POST method for that: <form method="post" action="process.php"> <input type="password" name="pass"> <input type="submit" name="submit" value="Submit password"> </form> And this is an example of a process.php <?php // check if password is set and matches criteria if(isset($_POST['pass']) && $_POST['pass'] != '') { // escape the value to avoid most …

Member Avatar for lloydsbackyard
0
191
Member Avatar for anil14353

The isset() function returns TRUE or FALSE. You probably wanted it this way: if(isset($_GET['_rp']) && $_GET['_rp'] == 1) ... elseif(isset($_GET['_rp']) && $_GET['_rp'] == 2) ...

Member Avatar for anil14353
0
1K
Member Avatar for davy_yg

If you resize your window width below about 970 px the horizontal scrollbar appears. This is usually set using min-width css property on container div element.

Member Avatar for davy_yg
0
113
Member Avatar for kanoy83

If you are learning to use ajax it might be right time to look at jquery also. jquery has nice [support for ajax](http://api.jquery.com/jQuery.ajax/) and will save you from using xmlhttp object directly making sure you cover all browsers and have the code right. Of course, all above about safe querying …

Member Avatar for kanoy83
0
2K
Member Avatar for GlenRogers

On each click of a button the form gets submitted with only one value. You'd be better off putting checkboxes next to each image (and only one submit button) and then check the array of checked ckeckboxes to produce the IN condition. Just an idea.

Member Avatar for GlenRogers
0
225
Member Avatar for L-D
Member Avatar for L-D
0
196
Member Avatar for klemme

I would expect in html formated mail <br> tag would produce a line break. This can't be the case in your message ($msg) since you are stripping all the tags. Maybe you should do it this way: $msg = strip_tags( $_GET['msg'], '<br>' ); provided that $_GET['msg'] already contains html breaks …

Member Avatar for klemme
0
342
Member Avatar for Webville312

Another one is [jQplot](http://www.jqplot.com/), open source and free for commercial use. I quite liked it. Simple and effective bar chart can also be accomplished just by using tables or divs and a bit of css. I have done it once in a small project and it looked quite cute.

Member Avatar for broj1
0
553
Member Avatar for Rahul47

A simple tutorial: http://www.tutorialspoint.com/php/php_get_post.htm Noce explanation on W3schools: http://www.w3schools.com/tags/ref_httpmethods.asp A technical specification as a part of of the HTTP protocol: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html And all this leads to: http://en.wikipedia.org/wiki/Representational_state_transfer#About and http://www.ibm.com/developerworks/webservices/library/ws-restful/ In simplified terms: use GET to retrieve data from the server, use POST to send data to the server, when you …

Member Avatar for Rahul47
0
536
Member Avatar for bradly.spicer

Upon successful insertion you might want to initialize $_POST with this code on line 43 (provided that you do not need the values anymore): $_POST = array(); Then the correct check would be: if(isset($_POST) && !empty($_POST)) The check you use in your code (`if($_POST != ''`)) is incorrect - $_POST …

Member Avatar for broj1
0
249
Member Avatar for saadi06

One approach would be to read the contents of the table in a giant string, hash that string and store the hash. Later you can repeat the procedure and compare the computed hash with the stored hash. But there are few considerations: - the string that you read rows into, …

Member Avatar for cereal
0
217
Member Avatar for Rahul47

The $`_POST` array doesn't contain a `name` element. The reason is in that the name input field has not been submitted yet. Include a check such as: <?php if(isset($_POST['name']) && !empty($_POST['name'])) { $name1=$_POST['name']; echo "<br> Your name is $name1 . Thanks for using our system."; } ?> Even better would …

Member Avatar for JorgeM
0
179
Member Avatar for lloydsbackyard

Shuldn't it be: header('location: ../admin.php'); // 1 folder up header('location: ../../admin.php'); // 2 folders up But HTTP 1.1 requires an absolute URI for the Location field so I am not sure if the above is OK to be used. Anyone knows more about that?

Member Avatar for pritaeas
0
169
Member Avatar for Priti_P
Member Avatar for roseblue
Member Avatar for Priti_P

An older post but it might help: http://www.daniweb.com/web-development/php/threads/124300/how-to-php-export-to-excel

Member Avatar for iamthwee
0
211
Member Avatar for sanbhu2105

I hope your query returns also prices for each of the retailers (it is not evident from the sql statement since you are using `SELECT *`). So in the while loop you can calculate running sum for all the prices. Once the while loop is finished the running sums will …

Member Avatar for broj1
0
989
Member Avatar for Shikha_1

This is strange. It works fine for me. Can you put this code on the very beginning of the lgin.php: die(print_r($_POST, 1)); This will display contents of the $_POST array and stop the script.

Member Avatar for broj1
1
159
Member Avatar for aido89

It could be that $_GET['id'] does not exist. To make sure it exists, do a check: if(isset($_GET['id'])) { $id = intval($_GET['id']); } else { // do something to handle the error } It would help much if you posted the exact error message (error message text including variable names, line …

Member Avatar for broj1
0
230
Member Avatar for Shikha_1
Re: php

EvolutionFallen's approach has one advantage. The result already contains the data for the user in question so if you need it you do not have to shoot another query. The `*` in the query should be replaced with the fields you really need. Atli's approach is slightly more optimized but …

Member Avatar for kkbalwada
0
199
Member Avatar for bops

The way I would approach this is exactly what you suggested - a good old traditional tree structure saved in a relational database (which mysql is). Relational databases are good at processing this kind of data, all the rest depends on the way the site would be used. If a …

Member Avatar for bops
0
322
Member Avatar for arsharma159
Member Avatar for dlaverick

It says that $wpdb is not an object so you can not address a method of it. Has $wpdb been initialized as a database object somewhere?

Member Avatar for dlaverick
0
230
Member Avatar for bradly.spicer

Use three different names for submit buttons. Then in the processing part of the code check which submit button has been pressed: if(isset($_POST['submit_delete'])) { //code for deleting } elseif(isset($_POST['submit_add']) { // code for adding } elseif(isset($_POST['submit_update']) { // code for updating }

Member Avatar for bradly.spicer
0
142
Member Avatar for Shikha_1
Member Avatar for GreenGERMBUBBLE

The likely cause of the error is missing POST data. You are nicely doing a check on the beginning: if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['email'])) but you forgot the starting curly bracket after the statement: if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['email'])) { ... You can also use simple debugging techniques …

Member Avatar for broj1
0
239
Member Avatar for ImZick

I used [Datatables](http://datatables.net/) a lot in my previous project and it covered all I needed (sorting, filtering, pagination, ajax, formatting, theming, language customization, sorting by date in many formats, sorting IP addresses etc.). I highly recommend it.

Member Avatar for broj1
0
2K
Member Avatar for diafol

The old site realy was a dinosaur but I got so used to it that now am getting a bit lost :-) (since it was always my prime source of information). Anyway, facelift is welcome but this is one of the sites where contents is king. And BTW the php …

Member Avatar for diafol
0
230
Member Avatar for joseph.lyons.754

The [PHP manual](http://php.net/manual/en/function.mail.php) will answer most of your questions. This is what it says for mail function: bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) $to - Receiver, or receivers of the mail $subject - Subject of the email …

Member Avatar for joseph.lyons.754
0
303
Member Avatar for sanbhu2105

The key info here is the product ID which is supposed to be stored in $_prod_id. But where do you get the value of $prod_id from (you use it in the query on line 17)?

Member Avatar for sanbhu2105
0
335
Member Avatar for dstoltz

Good editors support at least syntax coloring / highlighting for popular tools (PHP, Javascript, CSS, SQL, configuration files), indent code, suggest syntax, check parentheses, support various character sets, organize files etc. I use Notepad++ on Windows and KWrite on Linux. IDEs are a step forward by also helping you to …

Member Avatar for pritaeas
0
303
Member Avatar for rebelbelle

This is not the whole code. What is before the forst curly bracket? At the above snippet the closing curly bracket is a stray one.

Member Avatar for broj1
0
868
Member Avatar for McLaren

Thanks for the recommendation. I have read many books about PHP but none about team development, which is where I have lack of experience.

Member Avatar for McLaren
0
253
Member Avatar for shilu2

You will usually get the selected ID upon submiting the form. The selected value will be stored in either $_GET or $_POST global array, depending on the method, defined in the <form> tag. So in your code you have to check for submission of the form using this pattern: if(isset($_POST['submit'])) …

Member Avatar for broj1
0
208
Member Avatar for Gabe13

Also check if all input values exist. You are using these values in queries and if user did not enter all of them you will get strange results. // check if anything was entered (you might apply other checks and validations) if(isset($_POST['firstName']) && !empty($_POST['firstName'])) { // if yes, trim the …

Member Avatar for broj1
0
239
Member Avatar for dhani09

You are missing an anchor text and closing tag for anchor element. Also enclose the string in double quotes to parse the variables. Consenquently you have to escape double quotes that surround html attribute values: echo "<div><a href=\"uploads/$image\">$image</a></div>"; or use single quotes for enclosing html attribute values: echo "<div><a href='uploads/$image'>$image</a></div>";

Member Avatar for dhani09
0
8K
Member Avatar for SQLpower

Your insert query syntax is a bit strange. The basic syntax would be: INSERT INTO tablename (field1, field2,...) VALUES (value1, value2, ...) so in your case $q1 = "INSERT INTO job_employer_info (ename, epass, CompanyName, CompanyCountry, CompanyState, CompanyZip, CompanyCity, CompanyAddress, CompanyPhone, CompanyPhone2, CompanyEmail) VALUES( '$ename', '$epass', '$CompanyName', '$CompanyCountry', '$CompanyState', '$CompanyZip', '$CompanyCity', …

Member Avatar for SQLpower
0
196
Member Avatar for jethaya

I am not sure if I understood your problem correctly but there are some thoughts: 1. Put the mysql_connect and mysql_select_db outside the loop, somewhere on the beginning; it is preferred to execute this code only once 2. check for the existence of each $array element, since the data comes …

Member Avatar for jethaya
0
584

The End.