812 Posted Topics

Member Avatar for rhodoscoder

Have you corrected the missing $ in line 1 of your code (as JorgeM suggested). You might have overlooked it since the error wasn't explicitly mentioned (just guessing). Also you can examine the contents $_GET array by adding this code in the beginning of the script: die(print_r($_GET, 1));

Member Avatar for JorgeM
0
182
Member Avatar for Eagle.Avik

Test the sql staement by inserting this temporary debug code right after line 19: die($sql); This will display the insert query and stop the script. Now you can inspect the query or test it in phpmyadmin. You can also post it here. Also use error checking: $result = mysql_query($sql, $db) …

Member Avatar for broj1
0
289
Member Avatar for garyjohnson

I would check whether the $IdArray exists and is not empty: $query = "SELECT * FROM test WHERE user = '$user'"; if(isset($IdArray) && !empty($IdArray)) { $ids = implode(',', $IdArray); $query .= " AND id IN ($ids)"; } ... And, maybe you should post the $IdArray here (using print_r($IdArray)). Just to …

Member Avatar for broj1
0
445
Member Avatar for thomale

Put $email in single quotes since it is expected to be a string: $result = mysql_query("SELECT users_email, users_pass FROM login WHERE users_email = '$email'");

Member Avatar for broj1
0
453
Member Avatar for Dannyv79

Learning PHP and web technologies by watching videos: https://phpacademy.org/ A lot of good already made PHP classes (if you decide to go OOP), ready to use or learn by examining the code: http://www.phpclasses.org/ And good old PHP manual, a wealth of first hand information: http://www.php.net/manual/en/

Member Avatar for naina125
0
224
Member Avatar for n21115

Have you tried to add a second argument that will hold the output of the command: $command = "/usr/bin/lftp -u username,password ftp.website.com -e 'set ftp:ssl-allow off; put /var/www/folder/file.zip; bye'" . " 2>&1"; exec($command, $output); print_r($output);

Member Avatar for n21115
0
1K
Member Avatar for renierdbruyn

Well, this function looks rather complex. This is valid, but quite hard to debug. But, let's try it anyway. Put this temporary debug code on line 149: echo $applicants[$applicant_id_number] . '<br>'; This should presumably display somewhere all the values of the $applicants array used in the if test (if not, …

Member Avatar for broj1
0
259
Member Avatar for guym

The trouble is probably in the following statement on line 15: if (mysql_query ("INSERT INTO movieinfo VALUES ('','$Movie_Name','$Poster', '$GenreArray', '$IMDB_Rating', '$Quality', '$Year', '$Trailer')")) where you are trying to use the `$GenreArray` variable, which is of an array type instead of a string. I suppose you want to save genres as …

Member Avatar for broj1
0
498
Member Avatar for kevinpatel

Salt actually increases the complexity of the hashed value and makes dictionary attacks more difficult. The salt should be known only to authorized users (or applications). If you use the default (pre-set) value in CakePHP it's almost like not using the salt since almost everyone knows it or can get …

Member Avatar for broj1
0
101
Member Avatar for wallet123

Seems like you had a standalone mysql server installed before you installed xamp and the two do not want to work in parallel. If you do not need a standalone server remove it through the control panel (backup existing data). If you need it, do not start the one in …

Member Avatar for Squidge
0
278
Member Avatar for ahmadweb

Seems like you are missing the quotes in the $_POST associative indexes. And in addition to that to get the $_POST array elements properly parsed withing the double quoted string enclose them within curly brackets. $checkdate = "SELECT * FROM emp_status WHERE user_id = '{$_SESSION['user_id']}' AND ((start <= '{$_POST['start']}' AND …

Member Avatar for ahmadweb
0
366
Member Avatar for developer707

To backup a database you use [mysqldump](http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html) command on the db server. You must provide a root password (or dbuser password with appropriate access rights), : mysqldump -u root -pdyourassword yourdbname > yourdbname_backup.sql To do it from a php script use the [system](http://php.net/manual/en/function.system.php) command: $result = system('mysqldump -u root -pdyourassword …

Member Avatar for broj1
0
205
Member Avatar for Burhan_1

You can create [sessions](http://www.php.net/manual/en/book.session.php) on your server only, not on other servers. To create a session put the [session_start()](http://www.php.net/manual/en/function.session-start.php) command on the beginning of your script. Then assign values to the $_SESSION array. On each script that contains a session_start command you can read and change these values. The values …

Member Avatar for broj1
0
193
Member Avatar for johndohmen1963

The `$achternaam` variable contains spaces before the actual name and the first space gets capitalized by `ucfirst` function. Use trim to get rid of the spaces: echo ucfirst( strtolower( trim($achternaam) ) );

Member Avatar for johndohmen1963
0
189
Member Avatar for winbala5

Try with [curl](http://php.net/manual/en/book.curl.php) and see [this article](http://stackoverflow.com/questions/1363925/check-whether-image-exists-on-remote-url) if it helps.

Member Avatar for broj1
0
162
Member Avatar for chrisschristou

If I got it right your script works fine on local PC but does not work when on online server? But what does not work - inserting into the database or redirection to another page? If insertion does not work you have to make sure the connection to the database …

Member Avatar for broj1
0
397
Member Avatar for chrisschristou

Is the `total` field declared as NOT NULL in your table? If it has to have a value you have to make sure the value exists in the query. You can also check the query if you insert this temporary debug code on line 8: die($insertSQL); This will display the …

Member Avatar for chrisschristou
0
223
Member Avatar for johmny

Do you want to start a war? <= [just kiddin] Seriously, this is a question you won't get a definite answer to. I think both are good. PHP for me is better since I know it :-) (or at least I think I do). As far as I know PHP …

Member Avatar for diafol
0
152
Member Avatar for mmcdonald

This topic has been already marked as solved but I would like to add useful information that deserves to be added, and this is [OWASP top 10](https://www.owasp.org/index.php/Top_10_2013-Top_10) list of vulnerabilities of web apps and guides on how to minimize them. It might be a slightly more complex reading but it …

Member Avatar for diafol
0
293
Member Avatar for leokuz

You declared `$pass` variable but used `$password` in the query. And also you should check for existence of the data sent from the form and only if it exist query the database. In additon to that you should use quotes when queryinig for strings. And in addition to that you …

Member Avatar for tpunt
0
410
Member Avatar for tibormarias

> This is where the session stops. What do you mean by that? Do you get any error messages? > init.php included at first line, includes the session_start() In this case it is important that you post the code of the included file. On line 61 you have: header('Location: edit.php?success'); …

Member Avatar for tibormarias
0
240
Member Avatar for tibor.marias

Examine the constructed query to spot possible errors. Add the following temporary debug code to the register_user function: function register_user($register_data) { array_walk($register_data, 'array_sanitize'); $fields = '`' . implode('`, `', array_keys($register_data)) . '`'; $data = ''' . implode('', '', $register_data) . '''; // temporary debug code die("INSERT INTO `sikeres` ($fields) VALUES …

Member Avatar for tibor.marias
0
149
Member Avatar for muzique18

You could try with [INSERT ... ON DUPLICATE KEY UPDATE](http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html) provided that you have a unique index or primary key defined (you could use email for that or first_name+last_name).

Member Avatar for broj1
0
324
Member Avatar for rakwel10

If you look at the source code for the html in browser you will see a script inserted into the jquery load method (probably through the search box): // the script is inserted after this code $("#result").load("search-data.php?keyword= The script is encoded in a way using character codes, and you can …

Member Avatar for veedeoo
0
1K
Member Avatar for Britto_1

You should use javascript (or better jquery) to read which teacher was selected in the first select element and remove of disable that option in the second select element. The javascript (jquery) code could be controlled by php. The data should be pulled ftom the database.

Member Avatar for broj1
0
389
Member Avatar for ceeandcee

> but when I enter two variables it crashes What do you mean by that? Does your computer crash? Or you just get an error message instead of expected outoput? If there is an error message, please post it. If it isn't enable [reporting](http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting) and [display](http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors) of error messages. If …

Member Avatar for pritaeas
0
158
Member Avatar for dlmagers

You have to initialize the $error_message to empty string frst: `$error_message = '';` so in case there are no errors the empty string will be displayed (= nothing will be displayed). EDIT: Also you can check if error message exists and display it only then: <?php if(isset($error_message) && !empty($error_message)) { …

Member Avatar for broj1
0
377
Member Avatar for adishardis

In my opininion you do not need the cust_type field since it is redundant which is against the database normalization rules. You can always get the oldest one with: SELECT id FROM thetable ORDER BY date_of_trans ASC LIMIT 1

Member Avatar for broj1
0
187
Member Avatar for lloydsbackyard
Re: fpdf

The simplest solution: move the html part (the form) to the end. This way no HTML will be output before the pdf. <?php if (isset($_POST['print'])) { require('fpdf/fpdf.php'); class PDF extends FPDF { // Page header function Header() { $this->SetFont('Arial','B',14); $this->Cell(30,10,'Negros Oriental High School','C'); $this->Ln(); $this->SetFont('Arial','',12); $this->Cell(0,0,'Dumaguete City'); $this->Ln(); $this->SetFont('Arial','',14); $this->Cell(0,20,'OFFICIAL …

Member Avatar for lloydsbackyard
0
922
Member Avatar for PriteshP23

One approach: 1. make a form for your questions 2. use radio buttons for questions 1 and 2 3. use a text input or text area for question 3, and enclose it in a hidden element (i.e. a div) 4. attach a javascript function on the onclick event of the …

Member Avatar for broj1
0
1K
Member Avatar for Rahul47

> "Select query returns a result set upon success, whereas Insert query returns a true value upon success" This just means that INSERT query returns true if it succeeds to insert the data into database. On the contrary the SELECT query return rows. If query is unsuccessful it returns false …

Member Avatar for broj1
0
214
Member Avatar for broj1

Hi I have just replied on a post that was posted 43 years ago. My reply was also 43 years ago. I had that feeling that time just flies lately but this might be a little too fast. Or is it just some issue with unix time. This is the …

Member Avatar for stultuske
1
906
Member Avatar for Php_1

Many solutions to that. Basically you have to have two columns for each value in different languages. The field names can have language in their names (such as comment_en, comment_fr for english and french languages). The language is stored somewhere (like in a cookie, in a session or as user …

Member Avatar for broj1
0
156
Member Avatar for Raju_3

First thing, please do not start [two threads](http://www.daniweb.com/web-development/php/threads/461231/how-to-stored-image-are-display-in-fpdf#post2006442) in a very short time span for the same problem. The problem I ran into was that fpdf's image method expects a file with an extension for supported images. This is why it is a problem to pass it a binary data …

Member Avatar for broj1
0
2K
Member Avatar for srilakshmi7

For some ideas see [this tutorial](http://www.phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html).

Member Avatar for broj1
0
68
Member Avatar for best4earn

> How to make a captcha code unhackable ? What do you mean by this? Captcha is meant to protect against automated scripts and robots (it tries to confirm that the human is using the service). It is not meant to protect from unaothorised access fom hackers. > How to …

Member Avatar for jkon
0
153
Member Avatar for nigelhow

The problem is that $offerpricepl is not defined yet in the first iteration of the while loop. Put the test first and then echo the row: ... while($row1 = mysql_fetch_array($result1)){ // this is the heading row echo "<tr><td>" . "Selection" . "</td><td>" . "Profit/Loss" . "</td></tr>"; // now define the …

Member Avatar for stevie.whalen
0
197
Member Avatar for satbir4

You forgot to enclose index name in single quotes. If you want to use double quotes you also have to enclose the array element in curly braces: echo "<div>{$abc['ID']} $id</div>";

Member Avatar for kaustavbanerjee
0
198
Member Avatar for nigelhow

The issues with your function are: - The function has it own scope so $row array is unknown to it. Pass the $row array as a parameter. - the code `$bid==$bidpricepl;` and other similar do nothing (== is a comparison operator) - if the function echoes something you do not …

Member Avatar for broj1
0
237
Member Avatar for aVar++

In real life nothing is 100% secure. But if you are opening access only for a short time (only for assessment), you should be quite safe. Nevertheless consider the following: Your phpmyadmin should be configured securely: create a user for your teacher, grant him only the necessary privileges, allow him …

Member Avatar for broj1
0
280
Member Avatar for Malymieczek

Make sure that the hosting computer's firewall is not blocking http (port 80). > x.x.x.x:3306/signup.php?... and x.x.x.x:8080/signup.php? Usually http is on port 80 if you haven't changed it. 3306 is a mysql server's default port number so it should not work for http.

Member Avatar for broj1
0
186
Member Avatar for andreiviziru

You can use ajax for that (if it is worth the trouble). See [jquery ajax](http://api.jquery.com/jQuery.ajax/).

Member Avatar for broj1
0
317
Member Avatar for vicky one
Member Avatar for broj1
0
206
Member Avatar for renierdbruyn

In your foreach loop I would put applicants' data in an array and add a rank which is just a difference between an applicant's age and advertised required age (assuming that x years older and x years younger candidates rank equally). Then the array should be sorted. // this will …

Member Avatar for broj1
0
215
Member Avatar for f14dtom

To add my 2 cents: I have been using Linux desktop at work and at home for about 4 years now. At work we switched to Fedora desktop and server after not receiving usable support from Microsoft for Windows SBS when we had problems (support was paid for). We had …

Member Avatar for Vasvi
3
743
Member Avatar for Webbsta

First try to turn error_reporting to E_ALL and display_errors to on in the php.ini. Your script probably has some errors but the errors aren't displayed (just my guess).

Member Avatar for Webbsta
0
219
Member Avatar for edwin.joseph.7543

Many issues here: - `database` is a mysql reserved word so it is a bad idea to use it for the table name (and is missguiding also), but if you insist, enclose it in backticks - sending two queries is not necessary if you retrieve all data with the first …

Member Avatar for edwin.joseph.7543
0
400
Member Avatar for Swati_2
Member Avatar for Rachael_1

One solution: The form with the button should be within the while loop so each row has additional column containing the form with one button. The button's name should be the ID `($row['id'])` so you get the ID in the $_GET array upon clicking (please note that it is more …

Member Avatar for broj1
0
1K
Member Avatar for SirMahlon

Check first whether $_POST values exist (they usually do not on the first page load). And also it is very important to escape the values before inserting into the database. // check if values exist if(isset($_POST[firstname]) and isset($_POST[lastname])) { $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . …

Member Avatar for broj1
0
237

The End.