812 Posted Topics

Member Avatar for double_cola

The `printList()` should return a value if you want to use it in assignment (line 3 in the first snippet). function printList($file_names){ //print the list echo "<p class=cart-list-header ></p>"; echo "<ul class=cart-list>"; $pdf_check = glob('pdf/*.pdf'); $tpdf = array(); foreach($pdf_check as $pdf){ $tpdf[] = substr($pdf, 4); } foreach($file_names as $file){ if …

Member Avatar for double_cola
0
220
Member Avatar for Stefce

Maybe there is something wrong with your update query (maybe the `$sender` or `$total` are not what you expect). You can simply check it by sticking the following piece of code right after line 24: die($query); This will display your update query with the parameters and stop the script. Now …

Member Avatar for broj1
0
460
Member Avatar for pravinkumar1

[PHPAcademy](https://phpacademy.org/) if you are more of a visual type of person.

Member Avatar for almostbob
0
366
Member Avatar for mangel.murti
Member Avatar for mangel.murti
0
188
Member Avatar for azegurb

I have been watching this article with much interest hoping that someone will post their solution or ideas. Since there is no much activity so far maybe just a thought or two: if you set up a session handler to use database instead of temp file storage, you might have …

Member Avatar for broj1
0
264
Member Avatar for khin thida phyo

I would use one of jquery UI plugins. [Recommended reading](https://www.daniweb.com/web-development/php/threads/435023/read-this-before-posting-a-question).

Member Avatar for broj1
0
61
Member Avatar for sheriffkhalid

It would be much easier if you posted the code in question especially the part arround line 9. Nevertheless, it looks like you are missing a closing `)` somewhere.

Member Avatar for broj1
0
38
Member Avatar for santhoshweb

The `session_start` function must be called before any html is sent. Best place is on very top of the script: <?php session_start(); ?> ... margin-left: 94px; margin-top: -66px; margin-left: 94px; margin-top: -66px; max-width: 100%;"/></a></h1> ... See the PHP manual entry for the [session_start function](http://php.net/manual/en/function.session-start.php), especially the Notes part.

Member Avatar for Web Dev Rob
0
170
Member Avatar for AntonyRayan

Haven't studied your code closely but the number 2147483647 is exactly the max [integer](http://php.net/manual/en/language.types.integer.php) value on 32 bit systems. Why do you not handle your phone number as a string?

Member Avatar for broj1
0
205
Member Avatar for RikTelner

If you want to translate the above `ifs` into `switch` correct way as I see it would be: switch($temp) { case 0: echo "it's 0 Celsius"; break; default: switch($temp > 0) { case true: echo "it's not chill outside"; break; default: echo "it's chill outside"; } } Another way of …

Member Avatar for broj1
0
118
Member Avatar for davy_yg

The simplest way is to enclose the whole html table within a form. In each row there is a delete button which is actually an input element with a type="submit". The name attribute of each delete button should be a corresponding ID of the row in the database (typicaly a …

Member Avatar for davy_yg
-1
164
Member Avatar for harishprakash

Welcome to Daniweb. Please read [this sticky](https://www.daniweb.com/web-development/php/threads/435023/read-this-before-posting-a-question). This is the first hit from [duckduckgo](https://duckduckgo.com/?q=php+forgoten+password+script) search: http://www.plus2net.com/php_tutorial/php_forgot_password.php and there are heaps of others. You can find a lot of useful stuff regarding your question on this forum, too.

Member Avatar for imti321
0
213
Member Avatar for FarrisFahad

Maybe this is not an answer to your question but I was just wondering why you do not use any of the ready made solutions for pagination. You can find some examples on [phpclasses.org](http://www.phpclasses.org/search.html?words=pagination&x=0&y=0&go_search=1) (they will want you to sign-up to download the code but I think it is worth …

Member Avatar for broj1
0
397
Member Avatar for AntonyRayan

Provided that you keep user data in a database, just add a field containing the path to the image. You can provide default image (or two, based on sex) and add a functionality for users to provide their own photos.

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

I had a quick look at the code and the main error is that you are missing a method attribute in the form, so it defaults to GET, but you are using POST parameters. So change the form line to: <form action="post" id="nl-form" class="nl-form" action="../EMAIL.php"> There are other errors too, …

Member Avatar for <M/>
0
598
Member Avatar for pryidevsblog

Have you installed fpdf correctly so the directory structure is preserved. Font definition files are usually in font subdirectory of the fpdf installation. Check if this is so and if the `helveticab.php` file exists there.

Member Avatar for broj1
0
920
Member Avatar for shafakhat91

The problem is in the name of the `References` field (column) which is a Mysql reserved word and should not be used as a field name. If you still wish to use it as a field name you should enclose it in backticks. I would recommend you change it so …

Member Avatar for broj1
0
411
Member Avatar for Osagie_1

In the `Test_2` method the `$rootName` is not defined so it won't work. Anyway, I do not see any added value in your approach. You could do all this just by using json_decode. But if you really want to do it through your custom class then you should have good …

Member Avatar for broj1
0
129
Member Avatar for dayanadolce

What does the error message say apart from Fatal error (post the whole text of the error message)? Also, the mysql_query function returns a resouce (a special php type). Are you sure you want the generateOrderedArray() function to return an array of resource? You might wanna look at [the manual](http://php.net/manual/en/function.mysql-query.php) …

Member Avatar for dayanadolce
0
366
Member Avatar for mwashu

I'll do a bit of guessing here since I do not have experience with MS SQL server. It seems that MS SQL support is not installed in your EasyPHP environment (default is mySql). There is some info on [this link](http://stackoverflow.com/questions/14631988/trying-to-install-mssql-drivers-with-easyphp-12) on how to do it.

Member Avatar for broj1
0
179
Member Avatar for davy_yg

Is line 76 of the input_image.php actually a line 13 in the above snippet? If yes, obviously `$_SESSION['adm_banner.jpg']` does not exist. Where is it supposed to be set?

Member Avatar for imti321
0
189
Member Avatar for davy_yg

If you do not have image ID then `$data` array is not set. You should check for it before using it, especially in these two lines: if(isset($data['image']) && isset( $data['newfilename'])) { echo $data['image']; echo '<div id="updateimage"><img src="images/'.$data['newfilename'].'" height="250px"></div>'; }

Member Avatar for matrixdevuk
0
894
Member Avatar for ericcarver

You have to use a [HTML form](http://www.tizag.com/htmlT/forms.php) here. The action attribute of the form should point to the script that will process the data (validate it, sanitize it and store it into the database). The method attribute (get or post) will define how the form will be posted (`post` method …

Member Avatar for diafol
0
731
Member Avatar for imti321
Member Avatar for imti321
0
354
Member Avatar for Akun_1

Seems like some obfuscated php code. The author probably did not want others to see it without a lot of effort. Might be connected to the copyright notice in the beginning of the script.

Member Avatar for broj1
0
107
Member Avatar for Muhammad Nadeem_1
Member Avatar for Lee_9

I have tested your script and it works OK. This is the data I tested on: INSERT INTO book (id, bname, aname, pname, description) VALUES (1, 'Book 1', 'Author 1', 'Publisher 1', 'Description 1'), (2, 'Book 2', 'Author 2', 'Publisher 2', 'Description 2'), (3, 'Book 3', 'Author 3', 'Publisher 3', …

Member Avatar for broj1
0
225
Member Avatar for Hijran

You shall not send any HTML output before the `header` function. It won't work. So rearrange your code. Something like: <?php if($username=="" && $password=="") { header('location:admin.php'); exit(); // add this for security } else if($username=="hijran" && $password=="khan") { header('refresh:5; user.php'); } else { header('location:error.php'); exit(); // add this for security …

Member Avatar for imti321
0
413
Member Avatar for imti321

There are many ways: save it (database, json), store it in session, use $_POST/$_GET... Post what you have so far and describe what you want to achieve.

Member Avatar for broj1
0
363
Member Avatar for davy_yg

You should put the `session_start()` command on top of the `admin.php` script for session to work.

Member Avatar for broj1
-1
172
Member Avatar for rgracey

Before writing a next task to the database you read the last task. However, if the user has the form opened in the browser, there might be a problem displaying the current last inserted task ID, since many tasks could have been inserted after opening the form. You can use …

Member Avatar for broj1
0
188
Member Avatar for soomro_moon

https://www.daniweb.com/web-development/php/threads/488707/how-to-use-cookies-in-a-website-through-php http://davidwalsh.name/php-cookies ...

Member Avatar for broj1
0
87
Member Avatar for Hijran

The `else if` part of the code (line 23) should contain a condition. The rest of the answer is waiting for you [here](https://www.daniweb.com/web-development/php/threads/488599/cant-redirect-to-adminuser-page-after-login#post2137412) (similar post you started earlier on).

Member Avatar for broj1
0
197
Member Avatar for zebnoon1

You can not send headers after you have sent HTML output. Move the following block of PHP code to the top of the script and you'll be fine: if(isset($_POST['login'])) { $uname = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_SPECIAL_CHARS); $pword = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_SPECIAL_CHARS); if ($uname=="nitcoadmin" && $pword=="nitco@bahrain"){ //$_SESSION['user']=$uname; //$_SESSION['passw']=$pword; // $_SESSION['login']='1'; header('location:enqrep.php'); } …

Member Avatar for zebnoon1
1
223
Member Avatar for olawole.famakin

If you want to pass multiple values you can do it this way: xmlhttp.open("GET","getuser.php?q="+str+"&k="+somevalue,true); In this case you will always have both q and k elements in the $_GET array. But it is a question of what you really intend to do. Maybe some other approach is more appropriate.

Member Avatar for broj1
0
370
Member Avatar for ravi142

Can you post the code you've done so far. And then more precisely describe what you want but were not able to do.

Member Avatar for broj1
0
223
Member Avatar for garyjohnson

Something like: $rawString = 'aamu.edu: Alabama A&M University'; $temp = explode(': ', $rawString); // $temp[0] -> college_email // $temp[1] -> college_name $query = "INSERT INTO tableName (college_email, college_name) VALUES ('{$temp[0]}', '{$temp[1]}')"; And do not forget to sanitize strings first.

Member Avatar for broj1
0
120
Member Avatar for Simon180

To follow good design practices you should keep categories in a separate table. But anyway: - put a select element (a dropdown) or checkboxes on page to let people chose a category/ctagories - create a select statement using a chosen category/categories construct a SQL statement to query the database: $query …

Member Avatar for broj1
0
2K
Member Avatar for Azii

In 2.php you should have details enclosed within an html eement (such as div) with an ID so that you can access it using jquery `text()` or `html()` or similar method. <div id="my-content"> This is the body of the email. </div> var emailBody = $("#my-content").text();

Member Avatar for broj1
0
205
Member Avatar for zebnoon1

The $mail doesn't even come from the form. Should you code it something like: if(isset($_GET['submit']) && isset($_GET['q']) && isset($_GET['email']) { $mail=$_GET['email']; // sanitize this first ... Then the question is what type the email field is. And a side note: vlidate and sanitize the data from the form before you …

Member Avatar for broj1
0
232
Member Avatar for tNicknames

Not sure if I understood the question but this recursive function will traverse the object, search for a property and display it: function displayElement($obj, $el) { foreach($obj as $key => $val) { if(is_object($val)) { displayElement($val, $el); } else { if($key == $el) { echo "Found $key: $val<br>"; die(); } else …

Member Avatar for broj1
0
175
Member Avatar for OtepTheThird

If I got your question right you want to know whether a special character is required in PHP to write a statement on multiple lines. The code in PHP would be: $query = "INSERT INTO table(field1," . "field2)VALUES(value1," . "Value2)"; or $query = "INSERT INTO table(field1,"; $query .= "field2)VALUES(value1,"; $query …

Member Avatar for matrixdevuk
0
507
Member Avatar for arafath077

It should not be a problem if you use UTF-8 I guess. But anyway, the character code for รถ is `&ouml;` or `&#246;`. <p>Sch&ouml;nefeld</p>

Member Avatar for diafol
0
113
Member Avatar for Azii

First store the username in the session variable. // sanitize/validate first //... $_SESSION[$uname] = $uname; On other pages (within the same session) it will be available to your scripts: $uname = $_SESSION[$uname]; provided that you used the `session_start()` (always put it on top of your script). And sanitize the user …

Member Avatar for broj1
0
316
Member Avatar for Azii

Seems to be possible doing this using Javascript. See http://msdn.microsoft.com/en-us/library/office/fp161148%28v=office.15%29.aspx. And use PHP to pepare the HTML part.

Member Avatar for broj1
0
1K
Member Avatar for jarmouz

If you replace the following code: list($ip, $netmask) = split("/", $ipNetmask ); $ip_elements_decimal = split("[.]", $ip ); with this one (for IPv4 addresses): list($ip, $netmask) = explode("/", $ipNetmask ); $ip_elements_decimal = explode(".", $ip ); you should not get the depreciated notice. In fact I think you do not need regular …

Member Avatar for jarmouz
0
200
Member Avatar for Hakim_2

Something like: $rs2 = mysql_query($sql2); // array of months to get the index $months = array('Jan' => 1,'Feb' => 2,'Mar' => 3,'Apr' => 4, 'May' => 5, 'Jun' => 6, 'Jul' => 7, 'Aug' => 8, 'Sep' => 9, 'Oct' => 10, 'Nov' => 11, 'Dis' => 12); // the …

Member Avatar for broj1
0
187
Member Avatar for arafath077

If you know the structure will be exactly like the above: function convertDate($oldDate) { $months = array('Jan' => 1,'Feb' => 2,'Mar' => 3,'Apr' => 4, 'May' => 5, 'Jun' => 6, 'Jul' => 7, 'Aug' => 8, 'Sep' => 9, 'Oct' => 10, 'Nov' => 11, 'Dec' => 12); $temp …

Member Avatar for broj1
0
151
Member Avatar for bro_1

See [OWASP Top Ten](https://www.owasp.org/index.php/Top_10_2013-Top_10) especially the A1 - Injection. Probably all the web developer needs to know about the security. It is a lot of stuff to read and you do not have to digest it all at once. But make sure you bookmark it.

Member Avatar for veedeoo
0
513
Member Avatar for razar63

The main error was in the fact that you should not send any output to the browser before the [header](http://php.net/manual/en/function.header.php) function. In your second alternative coding example above you broke this requirement. In the first example you actualy made a redirection before outputting the script code so the script code …

Member Avatar for broj1
0
1K

The End.