Posts
 
Reputation
Joined
Last Seen
Ranked #124
Strength to Increase Rep
+13
Strength to Decrease Rep
-3
97% Quality Score
Upvotes Received
555
Posts with Upvotes
382
Upvoting Members
169
Downvotes Received
9
Posts with Downvotes
9
Downvoting Members
8
72 Commented Posts
~584.44K People Reached
About Me

I've been doing all sorts of thing within the IT area. Started on Spectrum for fun back in eighties I started to seriously engage in CAD (Microstation, MDL, Autocad, Lisp) in nineties and then shifted to IT security (smartcards, PKI, e-banking...) and…

Interests
My spare time is mostly spent for music. I play keyboards in a seven piece band.
PC Specs
HP ProDesk i5, Ubuntu 17.10 at home, Windows 10 at work
Favorite Tags
Member Avatar for Raju_3

The image method: http://www.fpdf.org/en/doc/image.htm The tutorial: http://www.fpdf.org/en/tutorial/tuto2.htm

Member Avatar for rofa_1
0
11K
Member Avatar for rabbit07

Now, there might also be a problem in the password field definition in the table spec: `password varchar(20) NOT NULL`. As far as I remember the good old MD5 produces a hash of lenght that fits into CHAR(32). So password hashes stored in the users table could be truncated due …

Member Avatar for Biiim
0
404
Member Avatar for akgreen

This is interesting, thanx for sharing. But what were the requirements for this kind of script? Is this a part of a production application? And did you have to implement any security (so the whole world does not start sending thousands of pages to your printer)?

Member Avatar for Yogesh_22
7
22K
Member Avatar for larry29936

If you intend to use quotes arround field and table names in Mysql you must use backticks, not single or double quotes. However they are not required if table and field names are not same as Mysql keywords/reserved words which is your case anyway. See the list of Mysql keywords …

Member Avatar for broj1
0
697
Member Avatar for Mr.M

In first version you are missing the other condition ($_SESSION['iiio'] != "pending"). In that case the div is shown by default. It looks like you are using Bootstrap so you can use the `show` and `hidden` classes provided by Bootstrap. I am using ternary expression here since it is most …

Member Avatar for Daniel_87
0
23K
Member Avatar for kkjaykamau

The code is basically OK except for the `return` statements. Why do you use them? Are the PHP scripts being called using the `include/require` statements? And make sure your first script has the `.php` extension (not the `.html`).

Member Avatar for Schol-R-LEA
0
3K
Member Avatar for Kim Gabrielle

Not sure what exactly is the expected workflow but few notes anyway: The PHP code in the beginning of the test.php should probably only execute after form submission or when the `$_POST` values are set so maybe perform a check or you might get errors/warnings: if(isset($_POST['submit'])) { $user = $_POST['user']; …

Member Avatar for broj1
0
7K
Member Avatar for Nrashmra

Quite many issues here: The following code is not valid: $valueToSearch = $_POST['requirementtype' 'build' ]; You can not have two strings as an array index. They should be separated in i.e two variables like so: $searchRequirementtype = $_POST['requirementtype']; $searchbuild = $_POST['build']; These two values should be escaped before used in …

Member Avatar for broj1
0
2K
Member Avatar for Lloyd_4

You can get the variables out of sight by using POST method in your form or call instead of GET which you are using in above example. If you use POST the variables won't be part of the URL instead they will be "hidden" in the HTTP header. Mind you …

Member Avatar for abubaker_2
0
259
Member Avatar for mexabet

The ID that appear in the URL depends on the field names of the form that sends the data. A field in your form probably has a name attribute that equals to `id` and information entered into that field goes into the `id` variable in the URL. I would recommend …

Member Avatar for broj1
0
354
Member Avatar for janicemurby

You should do it in a similar fashion. I presume the information about the gender is stored in a database for each user. When they login you read this information and redirect based on it. Something like: if($row['gender']=='Couple MF') { header('location:landingpage2MF.php'); } else if($row['gender']=='Couple MM') { header('location:landingpage2MM.php'); } else if...

Member Avatar for broj1
0
210
Member Avatar for spowel4

If you want to use a variable inside a string then the string must be enclosed in double quotes. [CODE]$var = 'foo'; echo "Variable value: $var";[/CODE] will display: [CODE]Variable value: foo [/CODE] while[CODE]$var = 'foo'; echo 'Variable value: $var';[/CODE]will display: [CODE]Variable value: $var[/CODE] See [url]http://www.php.net/manual/en/language.types.string.php[/url]

Member Avatar for diafol
0
7K
Member Avatar for Mark_65

EDIT: I noticed after posting that the javascript functions are meant to be in a separate JS file. Disregard my 1. remark, sorry. Had a quick look at the code and there are two obvious error: 1. The Javascript functions are outside the `<html></html>` and outside the `<body></body>` pairs which …

Member Avatar for broj1
0
2K
Member Avatar for phphp

You can also check how the query gets constructed, using similar technique as described above by cereal. Just add this between line 2 and 3: die($query); This will print out the query on the screen and stop the script. Now you can inspect the query whether it has all the …

Member Avatar for ahmad.albab.87
0
297
Member Avatar for MERIN_1

If you have a fixed number of variables (known in advance and equal to the lenght of the `$row`) you could use the [list](http://php.net/manual/en/function.list.php) function. Something like: list($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m) = $row; But be aware that using an array instead …

Member Avatar for broj1
0
334
Member Avatar for phphp

You can not subtract two strings representing dates on line 4 and expect to get a difference. Besides the variables on line 4 have not been declared anywhere (but I guess you just misstyped them). The best thing to do is to use the [DateTime](http://php.net/manual/en/class.datetime.php) and the [DateInterval](http://php.net/manual/en/dateinterval.format.php) PHP classes. …

Member Avatar for diafol
0
383
Member Avatar for Jacob_10

Looking at your code the new_entries table is in another database (`newentries`). Is that what you really wanted to do? You are duplicating rows (althoug in another database) so maybe you first review your DB design. If that is OK, make sure connection to the `newentries` database is OK and …

Member Avatar for diafol
0
223
Member Avatar for Owais_1

Quite many issues here, some big, some smaller. I'll try to comment on some without any particular order of importance. 1. On line 9 you try to concatenate some unknown constant. It should be either a variable (i.e. `$error`, but defined somewhere) or mysqli's error function `mysqli_connect_error()`. 2. I strongly …

Member Avatar for broj1
0
2K
Member Avatar for Sylvia_3

I tried your code and the table gets generated OK. I get this: Age Beg Bal Interest Deposits Ending Bal 45.00 2000.00 324.65 1200.00 3524.65 46.00 3524.65 521.09 1200.00 5245.75 47.00 5245.75 742.58 1200.00 7188.33 48.00 7188.33 992.31 1200.00 9380.63 49.00 9380.63 1273.87 1200.00 11854.50 50.00 11854.50 1591.33 1300.00 14745.83 …

Member Avatar for Sylvia_3
0
272
Member Avatar for AntonyRayan

Use [PHPExcel](https://github.com/PHPOffice/PHPExcel) to create Excel file from the data you read from the database. Dynamic headers are just headers that contain text and formulae in them (the header changes if the information in the respective column changes). You have to build those formulas yourself.

Member Avatar for broj1
0
375
Member Avatar for Vikash_7

If this is a guide how to do something it has serious issues: * POST variables are not being sanitized so arbitrary code can be injected * An old and deprecated mysql extension is used So sanitize (check, validate, cast, replace, blacklist, whitelist...) the post data and switch to the …

Member Avatar for broj1
0
162
Member Avatar for TheFearful

> Is it possible to do a nested checkbox It is, but you will have to code. Use Javascript or even better jQuery to listen to the click event and to check related checkboxes upon clicking the main one. It is easier if you put related checkboxes in a container …

Member Avatar for TheFearful
0
210
Member Avatar for thatsnotmyname

Displaying images in a grid is probably better since your page will be displayed nicely on mobile devices - provided that your grid is set-up properly. You can use a proven framework for that such as [Bootstrap](http://getbootstrap.com/). If you want to display images in pages use pagination - google for …

Member Avatar for diafol
0
562
Member Avatar for thatsnotmyname

If you want to prevent unauthorised users from displaying the iamges you can encrypt them using [mcrypt_encrypt](http://php.net/manual/en/function.mcrypt-encrypt.php). But be aware that you have to deal with key management to be able to decrypt later. By that I mean generating secure keys, securely storing the keys not to expose, corrupt or …

Member Avatar for broj1
0
223
Member Avatar for jonsan32

I can't test the code since I am on Linux and using Firefox and Chrome. However my recommendation is that you use [jquery](http://jquery.com/) functions in your javascript code since jquery is meant to abstract browser differences. Looking at your code you did include jquery library but are not using it. …

Member Avatar for broj1
0
166
Member Avatar for AntonyRayan

PHPExcel site is [here](http://phpexcel.codeplex.com/), documentation is [here](https://github.com/PHPOffice/PHPExcel/wiki/User%20Documentation%20Overview%20and%20Quickstart%20Guide). Great library, I have used it many times.

Member Avatar for broj1
0
140
Member Avatar for Niels_1

Try : echo $user_data[0]['fullname']; since fetchAll returns a set of all the rows (only one in your case).

Member Avatar for AndrisP
0
140
Member Avatar for Niels_1

You could use jquery ajax [post](http://api.jquery.com/jQuery.post/) method. The data for the post would be all the parameters, that are needed for the public function. The page won't refresh but you will still be able to carry out the insertion into the database. But you need a javascript event to triger …

Member Avatar for broj1
0
319
Member Avatar for Roger_2

Or use more jquery-like approach, where you catch onclick event in jquery: <button type="button" class="btn-login" id="btn-login">Login</button> ... <script> $("#btn-login").on("click", function() { toggle_visibility('foo'); toggle_visibility('sidebar'); toggle_visibility('tiles'); toggle_visibility('wsf') }); </script> </body>

Member Avatar for broj1
0
410
Member Avatar for divyakrishnan

You have 5 rows of select element and checkboxes so you have to keep track of which row a user has selceted / checked. You can do this if you add row number to the name attributes. So for row No. 1 the attribute would be: <select name="lang[1]"> <input name="speak[1]" …

Member Avatar for p@user
0
276