812 Posted Topics

Member Avatar for asaidi

Use the Output method with appropriate parameters depending on what you want: http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:output

Member Avatar for asaidi
0
3K
Member Avatar for opawix

Make the ID of a record in your students table autoincrement and use it as a primary key. If this is not an option, check for existence of the record first with `SELECT COUNT(*)`. A note on security: do not use $_GET array values directly in your insert query since …

Member Avatar for opawix
0
305
Member Avatar for GhuleVishal

The pages have to be in the directory that Apache is configured to serve. In Linux this is often /var/www/html. The Apache directive that defines this directory is in httpd.conf and is called DocumentRoot. So in above example in Linux it would be `DocumentRoot "/var/www/html"`. And of course Apache server …

Member Avatar for broj1
0
162
Member Avatar for ismael ahm@d

// if values exist in $_POST (or $_GET if you use it) if(isset($_POST['product_id']) && isset($_POST['country_id'])) { // product ID $product_id = $_POST['product_id']; // begin the query $query = 'INSERT INTO countries_product (coutry_id, product_id) VALUES '; // add coutry ID's foreach($_POST['country_id'] as $country_id) { $query = "($country_id, $product_id),"; } // remove …

Member Avatar for ismael ahm@d
0
9K
Member Avatar for broj1

Hi there It's not a complaint just a note: when I hover over the adds on DW pages my Firefox often crashes (and says 'Well, this is embarassing...'). I learned to live with that (patience is my strong attribute) but thought you might want to know (also I do not …

Member Avatar for broj1
0
161
Member Avatar for tomas.kringen

Hi Tomas and welcome. The answer is: Java is not neccessary. To create a website, theoreticaly, HTML is enough. In practice CSS is a must also (to make page look nice and to de-couple contents and design) as well as Javascript (to do many client side things like form validation …

Member Avatar for tomas.kringen
0
269
Member Avatar for darl.liew

Have you tested what are the values are in the $_GET? Are they comming from a form or you construct a URL + query string some other way? You should always check for posted values: if(isset($_GET['file']) && isset($_GET['image'])) { $file = $_GET['file']; $image = $_GET['image']; } else { // handle …

Member Avatar for darl.liew
0
5K
Member Avatar for Webville312

The way you use foreach looks strange to me. foreach($_POST['bot'] as $bot && $_POST['mt'] as $mt && $_POST['eot'] as $eot) { $insert = ""INSERT INTO marks(beginning_of_term,mid_term,end_of_term) VALUES($bot,$mt,$eot); $execute_insert = mysql_query($insert); } The PHP manual says: foreach (array_expression as $value) statement foreach (array_expression as $key => $value) statement `$_POST['bot'] as $bot …

Member Avatar for Webville312
0
1K
Member Avatar for mionazraelmiranda

It is not evident from your code where the $price is getting echoed. This should work: $result = mysql_query("SELECT * FROM `order` where date = '$date' "); $price = $row['total_price'] + $row['total_price']; echo "Double price is $price<br />"; } as long as $row['total_price'] exists and has some value;

Member Avatar for mionazraelmiranda
0
190
Member Avatar for hfiza.amirah

If by email brodcast you mean sending mail to many recipients using php then look at swiftMailer. http://swiftmailer.org/

Member Avatar for broj1
0
262
Member Avatar for TMD

Is there any reason that you implemented the functionality in javascript? You could probably do the same processing with php and just mail the values. But if you really want to use javascript for processing then you will have to use ajax approach - a javascript function that passes values …

Member Avatar for broj1
0
1K
Member Avatar for Simon180

Create the javascript using PHP (see the comments in the code): // suppose this is the rows array you get form the database $rows = array( array( 'sort' => 'sort1', 'url' => 'url1', 'details' => 'detail1', 'image' => 'image1' ), array( 'sort' => 'sort2', 'url' => 'url2', 'details' => 'detail2', …

Member Avatar for broj1
0
284
Member Avatar for duneflyingyfz_1

In the database each user should have a group number (or you should have some other mechanism in place to distinguish groups). Then on the **login page** you redirect a user to the page for his group using using `switch` statement and `header('location:mygroup.php')`. switch($userGroup) { case 1: header('location:group1.php'); break; case …

Member Avatar for broj1
0
132
Member Avatar for Ritesh_4

`a` and `t` are format characters in the date function. If you want to use them as text (literally) you must escape each of them.

Member Avatar for Ritesh_4
0
159
Member Avatar for shilu2

$_FILES['photo_file'] does not exist for some reason. Good practice is to check for existance first: if(!isset($_FILES['photo_file'])) { // handle the wrror the way you see fit die('Error uploading the file'); } // code for normal processing

Member Avatar for jacob.lemelincarrier
0
204
Member Avatar for websponge

To display row(s) you should add a variant of a fetch statement: $tables = mysql_fetch_row($result); echo print_r(tables, 1); http://www.php.net/manual/en/function.mysql-fetch-array.php http://www.php.net/manual/en/function.mysql-fetch-assoc.php http://www.php.net/manual/en/function.mysql-fetch-field.php http://www.php.net/manual/en/function.mysql-fetch-object.php http://www.php.net/manual/en/function.mysql-fetch-row.php Also mysqli is newer extension and is recommended to be used instead of mysql you use. http://www.php.net/manual/en/book.mysqli.php

Member Avatar for broj1
0
162
Member Avatar for rotten69

Each post has to be associated with the user ID (the ID of the user that authored it). I presume user ID is also stored in the session. So when you display posts you check each post to whom it belongs and if it belongs to currently logged-in user also …

Member Avatar for broj1
0
178
Member Avatar for Headshot_Harry

I am not familiar with FormMail but maybe this link helps: http://www.scriptarchive.com/readme/formmail.html#email In line 215 it uses PHP's internal mail function to send mail. There it sets in additional headers the From: addres using $post['email'] which some server reuire (I guess). But I think PHP's mail function sends mail using …

Member Avatar for theHop
0
606
Member Avatar for sarah49

Also while developing scripts it is useful to have error reporting switched on so instead of a blank screen you get some useful information. You can do this either in your script (each of them): ini_set('display_errors',1); error_reporting(E_ALL); or in the php.ini file if you have access to it: error_reporting = …

Member Avatar for broj1
0
231
Member Avatar for garyjohnson

If videos.videoname is a string you should enclose $search in quotes (line 14): WHERE videos.videoname='$search' Have you tried to debug the code by inserting echo, die or print_r debug statements like: // in line 2 to check the value sent over die($_POST['search']) // or between lines 20 and 21 to …

Member Avatar for broj1
0
128
Member Avatar for ericjw316

This topic seems to be quite popular these days. Have a look at this thread: http://www.daniweb.com/web-development/php/threads/432815/fetch-result-in-my-drop-down-list#post1862915

Member Avatar for dcdruck
0
192
Member Avatar for MMadhavi

Where do you get stuck? The principle is: construct appropriate query to retrieve rows from the table and then use data of each row to build option elements: // query $q = 'SELECT id, title FROM movies'; // connection and querrying stuff ... // start the html code for select …

Member Avatar for rpv_sen
0
440
Member Avatar for pranay1995

The trouble could be in your query on line 16 where you should use the variables (but you probably only forgot the $ sign). The correct query would be: $checkUsername=mysql_query("select Username, Password from registration where Username='$Username' and Password='$Password'");

Member Avatar for pranay1995
0
209
Member Avatar for venkyb47

If you want to use a php variable in html enclose it within the `<?php ?>` tags and echo it: onclick="showRemarks(' <?php echo $activityid; ?>');" id="remarksadd"></img>

Member Avatar for venkyb47
0
344
Member Avatar for GazzaCurran

Regarding the checkboxes (or tick boxes, as you call them): when processing the posted values you have to check for an existence of a value of each checkbox. If the check box was not clicked, the value does not exist in the $_POST array. if(isset($_POST['disabilities'])) { $disabilities = 'Yes'; } …

Member Avatar for broj1
0
139
Member Avatar for jacksantho
Member Avatar for riverspart
0
217
Member Avatar for anitg

Echo the problematic query that the second code generates and post it. Also enclose field names within backticks since there might be a possibility that the generated field name is a mysql keyword.

Member Avatar for broj1
0
202
Member Avatar for Angle90

Hope this works for you: order deny,allow deny from all allow from [your IP] http://httpd.apache.org/docs/2.2/howto/access.html

Member Avatar for Angle90
0
180
Member Avatar for dante123
Member Avatar for broj1
0
228
Member Avatar for klemme

Maybe not a direct answer to your question but you could use a `mysqli_fetch_object` function which stores result in an object instead of in an array. In PHP (v 5.something I guess) object are by default passed by reference so you do not have to wory about that. Has somebody …

Member Avatar for DarkMonarch
0
307
Member Avatar for bLuEmEzzy

First row has first five columns with rowspan=2 and last column with colspan=4. Second row has only the last four cells. <tr> <td rowspan="2">col 1</td> <td rowspan="2">col 2</td> <td rowspan="2">col 3</td> <td rowspan="2">col 4</td> <td rowspan="2">col 5</td> <td colspan="4">Qualification</td> </tr> <tr> <td>Ed</td> <td>Tr</td> <td>Ex</td> <td>El</td> </tr>

Member Avatar for bLuEmEzzy
0
490
Member Avatar for dante123

Here is my suggestion that uses some ideas from above: Inthe include files for menus only have a structure for each menu (top and left) stored in a multidimensional array. Then create another file that holds the function to draw the menu (and possibly your other functions). Call a function …

Member Avatar for dante123
0
261
Member Avatar for navi17

My personal opinion: If you have say 100 instances of the same application that could be a nightmare to maintain (bug fixes, upgrades...). You would be better of having one app (and one database) but you have to be careful to make each user's data and login secure. So particularly …

Member Avatar for diafol
0
230
Member Avatar for broj1

Hi folks. I have a strange thing happening here. I have a loop where counter gets incrememnted by 0.1 starting from 0 and up to 1. In each iterration I use the counter in an expression with modulo operator. I get incorrect result when the counter has values of 0.8 …

Member Avatar for DarkMonarch
3
396
Member Avatar for daniel36

Seems like $row['teacher_id'] and $row['comment'] haven't got a value. Insert the following after the line 19: if(!isset($row['teacher_id']) or empty($row['teacher_id']) or !isset($row['comment']) or empty($row['comment'])) { die('<pre>' . print_r($row, 1) . '</pre>'); } and post the output. (the code above will check if any of the suspicious values do not exist and …

Member Avatar for broj1
0
150
Member Avatar for penet.biz

Firstly: you are mixing double quotes for PHP strings with double quotes for html attributes. Escape the later. Secondly: composite variables in a string should be enclosed in curly braces to get parsed correctly. $mesaj="<li><a href=\"{$db_field['Image']}\" class=\"pirobox\" title=\"{$db_field['Titlu']}\"><img src=\"{$db_field['Image']}\"/></a><p>{$db_field['Content']}</p><div class=\"button\"><pre><a href=\"index.php\">Read More</a><a href=\"{$db_field['Download']}\">Download</a></pre></div></li>";

Member Avatar for broj1
0
314
Member Avatar for dante123

Define is used for defining constants and constans once defined can not be changed (by another define). You can always test if the constant has already been defined: if(!defined('THIS_PAGE')) {define('THIS_PAGE', 'pagename')}

Member Avatar for diafol
0
183
Member Avatar for Goldfinch

Your code contains several statements of this form $var=bad-date; If you intended to assign a string `'bad-date'` to `$var` enclose it with quotes. Before displaying image you should then test the $var if it contains valid date: if($var != 'bad-date') { $imagepath="daily/$var.gif"; ... }

Member Avatar for broj1
0
124
Member Avatar for weirdCreature7

Check also whether it is not empty: if(is_array($_SESSION['cart']) and !empty($_SESSION['cart'])) or check for elements one level below: if(is_array($_SESSION['cart'][$i]) and !empty($_SESSION['cart'][$i])) or check for elements two levels below: if(isset($_SESSION['cart'][$i]['productid'])) { $pid=$_SESSION['cart'][$i]['productid']; } else { echo 'No product ID!'; }

Member Avatar for diafol
0
517
Member Avatar for sheshagirig

To access fields of a row use associative index that mysql_fetch_array function returns: echo $row['Firstname']." - ".$row['Rank']; To address particular rows (using SELECT, UPDATE or DELETE queries) you have to use WHERE condition(s) that return just one row. In your case it would be a good thing to have another …

Member Avatar for sheshagirig
0
130
Member Avatar for thilipdilip

IP of the machine browsing your script: `$_SERVER[REMOTE_ADDR]` If behind proxy (does not work always): `$_SERVER['HTTP_X_FORWARDED_FOR']`

Member Avatar for Javvy
0
159
Member Avatar for Squidge

Just a dumb question: if you want to get active scripts why is the condition `WHERE active = '0'`? Shouldn't it be `WHERE active != '0'`?

Member Avatar for Squidge
0
153
Member Avatar for isalano

Invest i a good book like this one: http://www.amazon.co.uk/Absolute-Beginners-Experts-Voice-Source/dp/1430224738/ref=sr_1_49?ie=UTF8&qid=1345629495&sr=8-49 or more advanced one: http://www.amazon.co.uk/PHP-MySQL-Dynamic-Web-Sites/dp/032152599X/ref=sr_1_1?ie=UTF8&qid=1345629611&sr=8-1 learn from the resources on net: http://www.w3schools.com/php/default.asp http://www.php.net/ DANIWEB and set up a development environment and a server and start with simple scripts.

Member Avatar for almostbob
0
97
Member Avatar for MMadhavi

More user friendly solution would be to offer movie IDs in a drop down list (html select element). In that case user can not select an invalid ID and they also do not have to remember all IDs (you can display movie names in the select element). Of course if …

Member Avatar for broj1
0
120
Member Avatar for vindyauwu

Check whether the query returns any records. Insert the following code between lines 7 and 8 and copy the output query in phpmyadmin: die("SELECT * FROM messages WHERE to_user = '$to_user' AND deleted = 'no'"); It could be that the variable `$to_user` has no value yet.

Member Avatar for broj1
0
273
Member Avatar for rosse88

From the error message one could conclude that the query returns 0 rows and therefore 1st row (index 0) can not be accessed. Please test the query with the actual parameters by inserting this code right after line 14: die("SELECT `logs_id` FROM `school_logs` WHERE `school_user` = '$school_user' AND `school_id` = …

Member Avatar for rosse88
0
238
Member Avatar for DaveyMoyes

If page two is included in page one you can use variables from page one in page two straight away. If they are different variables they should have different names.

Member Avatar for broj1
0
201
Member Avatar for Raakesh399

Googled and found these: http://www.easyphpcalendar.com/ http://keithdevens.com/software/php_calendar

Member Avatar for broj1
0
133
Member Avatar for mahdiyazdani

You should put a test in the for loop to see whether the displayed number is the number of the current page; if yes then you have to have a code for displaying that number (and no link), otherwise you display a link. It is hard to give a snippet …

Member Avatar for broj1
0
97
Member Avatar for davy_yg

The links above are referring to the named anchors (1, 2...) on the same page (hence #). The links above are constructed this way if they are on the page picture.php: <a href="#1">Picture 1</a> <a href="#2">Picture 2</a> or if they are on some other page: <a href="picture.php#1">Picture 1</a> <a href="picture.php#2">Picture …

Member Avatar for broj1
0
144

The End.