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
~595.29K 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

812 Posted Topics

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
450
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
23K
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
716
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
264
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
358
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
213
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
8K
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
385
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
335
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
388
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
245
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
276
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
399
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
165
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
213
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
570
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
226
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
169
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
142
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
143
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
323
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
417
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
284
Member Avatar for ramsiva
Member Avatar for Okere_1

http://api.jquery.com/jquery.ajax/ You might have to do a bit of learning if you are not familiar with Ajax.

Member Avatar for broj1
0
98
Member Avatar for pilucho

Not sure if I understood ypur question but I'll have a go at it. The `mysqli_insert_id()` function returns the ID generated by a query on a table with a column having the `AUTO_INCREMENT` attribute (sentence copied from the [PHP manual](http://php.net/manual/en/mysqli.insert-id.php)). Now, in your insert query the ID is not treated …

Member Avatar for Taywin
0
388
Member Avatar for Abdulrasheed_1

Assuming that you use the POST method the users name should be in the $_POST array. Read it from there. Details depend on whether you have insertion script and the form in the same script or not. Maybe you post your code.

Member Avatar for broj1
0
92
Member Avatar for AntonyRayan

You use one of jquery [ajax methods](http://api.jquery.com/category/ajax/), i.e. `$.ajax()`. HTTP method should be `POST` since you are updating data (see some in-deepth explanation [here](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html) and some simpler explanation [here](http://www.w3schools.com/tags/ref_httpmethods.asp)). You supply the data to be inserted in [JSON](https://en.wikipedia.org/wiki/JSON) format. The `$.ajax` method is usually called with a click event (e.g. …

Member Avatar for broj1
0
2K
Member Avatar for ivylyn

http://www.html-form-guide.com/php-form/php-form-checkbox.html and thousands of other resultls using duckduckgo search for *php checkbox example* (you can also try google)

Member Avatar for jkon
0
155
Member Avatar for paul.rothenberger

Test the insert statement. Put this simple debug code just before line 60: die($q); This will echo the insert query on screen and stop the script. Now inspect the query whether it is OK and copy and test it in phpmyadmin (or whatever you use). Also, you check if user …

Member Avatar for Taywin
0
371
Member Avatar for pilucho

Nowhere you check if password and username have been entered which is not a good practice and might be a reason for your error. You should do it this way: if(!isset($_SESSION['auth_user']) && isset($_POST['cedula']) && isset($_POST['clave'])) { loginuser(); } Also use curly brackets even if you have only one statement, to …

Member Avatar for pilucho
0
291
Member Avatar for AntonyRayan

In my knowledge the `cal_days_in_month` function already takes into account leap years. I think the error is in line 10: $Start_Date="1/".$month."/".$year.""; To make string representation correct it should be in a format that represents a unique date (i.e. American month, day and year - `mm "/" dd "/" y`): $Start_Date=$month."/"."1/".$year.""; …

Member Avatar for diafol
0
357
Member Avatar for OtepTheThird

Have you checked Apache log files? If you use xampp they should be in C:\xampp\apache\logs.

Member Avatar for OtepTheThird
0
4K
Member Avatar for kavinsac

Do not forget security if you want to be a really good web developer. Familiarize yourself with [OWASP top 10](https://www.owasp.org/index.php/Top_10_2013-Top_10) threats and guidelines how to handle them. Regarding graphics skills learn vector graphics and software like Inkscape. It often helps when bitmap graphics does not suffice.

Member Avatar for diafol
0
573
Member Avatar for biddut.hossain.75

What would you like to do when `case 0`? I think `case 0` is when the import went without any problems. Then you don't have to do anything else apart from letting users know (which has already been done).

Member Avatar for diafol
0
4K
Member Avatar for rjony321

If I understood correctly you just want to skip first row which is heading row. If that is true then start inserting at row 2. Something like: $heading = true; while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE) { // check if the heading row if($heading) { // unset the …

Member Avatar for daksh singh
0
7K
Member Avatar for Ravinder_3

Also, the method name in `$this->__('Email Me')` does not seem to be valid or is my knowledge of PHP a bit shaky?

Member Avatar for broj1
0
4K
Member Avatar for Greg_8

Line 7: change it to (add the $ sign): if ($username && $password) Hopefully you use prepared statements or do some sanitizing of input variables before using them in queries/urls/html/mail/script.

Member Avatar for broj1
0
503
Member Avatar for javaid97
Member Avatar for javaid97
-1
212
Member Avatar for hell hansen

Or use recursion, maybe sometnihg like this (not thoroughly tested, just to show the concept): function findMax($array, $curMax) { foreach($array as $val) { if(is_array($val)) { $curMax = findMax($val, $curMax); } else { if($curMax < $val) { $curMax = $val; } } } return $curMax; } // Usage arr[0][0] = 53; …

Member Avatar for hell hansen
0
2K
Member Avatar for دليل تطبيقات

There seem to be no syntax errors. Why do you assume there is an error? Do you get any messages? Is the result not what you expected? What is different from what you expected?

Member Avatar for broj1
0
258
Member Avatar for دليل تطبيقات

Depending on what your password requirements are and what your approach is. Once you hash a password the hash will contain only database safe characters. I would expect you do not need so much a filter but a password quality checker.

Member Avatar for pritaeas
0
126
Member Avatar for diafol

I've been a long time Eclipse user. Not very advanced usage though, there are still things that I don't quite understand or like. But I like the fact that I was able to switch between Windows (current job) and Linux (previous job, home) environments without much hassle. Also OOP, JS …

Member Avatar for rsleventhal
0
648

The End.