812 Posted Topics

Member Avatar for phorce

It might be hard to mix PHP code with HTML with this style of programming. You will be more or less limited to generate all HTML code with PHP I guess. Is that what you really want? And what is the role of the line 3 above (initialization of StdClass)? …

Member Avatar for phorce
0
200
Member Avatar for peter20

In your php script that generates pdf you have to override existing method Header() with your code.There are nice examples on their website, see [url]http://www.tcpdf.org/examples/example_003.phps[/url] To add custom text to the header use the Cell() method.

Member Avatar for broj1
0
1K
Member Avatar for joban.ali

Where do the $p_spice, $p_veg and $p_allergy that you use as conditions in your if statements come from? Shouldn't they be a part of the $row array (like $row['p_spice'])? I presume the paths to images are OK. There is an error in line 26 where you say [CODE]$nut='<img src= src="../Resources/nut.png" …

Member Avatar for joban.ali
0
86
Member Avatar for jacob21

I will try to explain my approach since I also use TinyMCE. I use two divs: the first div holds a textarea (TinyMCE editor), a Save button and a Cancel button. The other div holds edited text as an ordinary paragraph and an Edit button. One div is hidden (display:none) …

Member Avatar for stoopkid
0
231
Member Avatar for monzu123

You will have to query the database for number of matches form your dropdowns using COUNT(*) function. You can use a query in mysql for your example similar to: [CODE]SELECT COUNT(*) FROM databasename WHERE Country='France' AND Age BETWEEN 18 AND 40 AND Education='High School' AND InterestA='Reading'[/CODE] Just to give you …

Member Avatar for broj1
0
73
Member Avatar for calebcook

You could use an obfuscator. It is not a 100% solution and it might create some work when maintaining but it is an option. Have look at [url]http://www.phpprotect.info/[/url].

Member Avatar for moneeshot
0
190
Member Avatar for rahulroshan

And it also depends on the table type (engine) within a database. In mySql it is possible to do it if table type is InnoDb, but not if the type is MyIsam.

Member Avatar for broj1
0
82
Member Avatar for Giedrius

If password which is stored in the password database field is hashed (using md5 or sha1 function) then you have to also hash the password provide by the user (typed into a login form) and compare the hashes. [CODE]$hashed_password = sha1($passwod); // ... $sql = "SELECT * FROM skadate_profile WHERE …

Member Avatar for Giedrius
0
229
Member Avatar for cacofonix

Have a look a this link: [url]http://www.javascriptsource.com/page-details/session-time-out.html[/url]

Member Avatar for broj1
0
130
Member Avatar for Behseini

To export a PDF I use an open source TCPDF library ([url]http://www.tcpdf.org/[/url]). It has an excellent page with man examples: [url]http://www.tcpdf.org/examples.php[/url]. Hope it helps.

Member Avatar for broj1
0
347
Member Avatar for rse

Do you have session_start() function at the beginning of your script? If not it won't work. Check the $_SESSION contents with [CODE]print_r($_SESSION);[/CODE]and compare it with the value of $HTML[CODE]print_r($HTML);[/CODE]

Member Avatar for rse
0
139
Member Avatar for jonnyboy12

Your code is OK. I have been using this approach quite often (e.g. conditionally applying a background colour to a table). What makes you think the code does not work? Maybe the change just isn't visible. Try changing some other attributes to see whether there is any effect. Try: [CODE] …

Member Avatar for jonnyboy12
0
122
Member Avatar for davy_yg

See an example here: [url]http://www.daniweb.com/web-development/php/code/379236/page2[/url] Have look at the last post with improved code (the code in the first post was criticised rightly for lack of security measures).

Member Avatar for Zahinize
0
184
Member Avatar for vizz

I am not sure whether I understand your question but let me try. Enclose each of your forms with a div that has a CSS display property set to none like this: [CODE]<div id="form1" style="display:none;"> <form> ... ... </form> </div> <div id="form2" style="display:none;"> <form> ... ... </form> </div> [/CODE] Then …

Member Avatar for broj1
0
99
Member Avatar for azdonald

It is a bit difficult to give you an exact answer but I think your Quiz class should have all the attributes and methods to handle the quiz, such as a method to display a question (which you already have), an attribute (an array) with correct answers for all questions, …

Member Avatar for mschroeder
0
127
Member Avatar for moshe12007

Your input should be between the <form></form> tags and the form should have an action attribute set to the same page.

Member Avatar for vimalnath53
0
87
Member Avatar for jetlife76

You are missing a curly bracket at the end of line 9 jn the above code. [CODE]$distance = $cities[$_POST['destination']]};[/CODE]

Member Avatar for jetlife76
0
113
Member Avatar for amee01

Man, you must be in love with the if clause. It seems that you have one curly bracket missing at the end between lines 168 and 179. Your code is very complex and hard to follow but my IDE shows that what is marked as: [CODE]}//end foreach[/CODE] is really end …

Member Avatar for broj1
-1
94
Member Avatar for furlanut

The third block of code is OK, that is how you do it. Of course you can also have functions in a separate file like in your second block example in the fix_name.php file. Only the line 4 of the second block should be: [CODE]echo fix_name("costa playa");[/CODE]

Member Avatar for furlanut
0
115
Member Avatar for gourav1

PHP6 and MySql Bible, Wiley, was very informative for me (note PHP6 is not out yet, but the book it is OK for PHP5 too). [url]http://www.amazon.com/PHP6-MySQL-Bible-Steve-Suehring/dp/0470384506[/url]

Member Avatar for Stefano Mtangoo
0
117
Member Avatar for wolfgangcs

You should set atribute name of the checkbox to[CODE]name='item[]'[/CODE]so that you create a checkbox group. Upon submitting the form you will get all checked values in an array stored in $_SESSION. The array can be empty if none of the checkboxes were checked, so use empty() to check for values …

Member Avatar for diafol
0
82
Member Avatar for satishk_golu

\n is not a html tag. It does insert a new line in the source (view page source and you will see it). To have a new line in html page you need to use either <br /> or wrap each line in <p></p> or <div></div> pair like [CODE]echo "<div>value …

Member Avatar for broj1
0
282
Member Avatar for naui95

There are a couple of mistakes in your code: 1. you declare $nome=$db_field['name']; on line 19 and then use value="$nsme" on line 39 (typo?) 2. you declare $cognome=$db_field['gender']; on line 20 and then use value="$gender" on line 43 (shouldn't it be value="$cognome") 3. your <'php opening tag is not followed …

Member Avatar for naui95
0
336
Member Avatar for mwenyenia07

You probably have a quantity in input field and total somewhere in text (i.e in a div or span element). Both elements should have unique ID so their values can be read by javascript. In addition you should have a button with onclick event attached that fires your javascript function. …

Member Avatar for broj1
0
475
Member Avatar for jacob21

I use TCPDF which is licenced as LGPL and available at: [url]http://www.tcpdf.org/[/url] There are plenty of examples on the site to get you started: [url]http://www.tcpdf.org/examples.php[/url]

Member Avatar for broj1
0
4K
Member Avatar for Onlineshade

You need: 1. an editor that helps PHP development. PHP Eclipse ([url]http://www.phpeclipse.com/g[/url]) and Netbeans ([url]http://netbeans.org/[/url]) are probably most wide spread but for a beginner maybe a little overwhelming. Notepad++ (Windows) and Kwrite, gedit (Linux) are simpler and still powerfull ones. 2. a PHP and mysql enabled web server (can be …

Member Avatar for Onlineshade
0
136
Member Avatar for digital_plunder

Move the curly brace form line 49 to a line 29. Your second if block should be a part of your first if block which means if form has been submitted and if password is correct then display the greeting else display the table with the form. See the code …

Member Avatar for digital_plunder
0
153
Member Avatar for liphoso

On Linux (maybe on Windows too) you can use mysqldump command to backup mySql database in a SQL script. Optionaly the script can be compressed (gzipped in this example). [CODE] // username, password, mysql host, database name $dbuser = 'yourMysqlUsername'; $dbpw = 'yourMysqlPassword'; $dbhost = 'yourMysqlHost'; $dbname = 'yourMysqlDatabaseName'; // …

Member Avatar for broj1
0
106
Member Avatar for Nahiyan

I use Pager from the Pear framework. Have a look at [url]http://www.alberton.info/pear_pager_tutorials.html[/url] and [url]http://pear.php.net/package/Pager/docs[/url] Unfortunately you have to be familiar a little with how to install Pear components but it is not very hard.

Member Avatar for diafol
0
235
Member Avatar for shg234

You can not access the class variable that has been declared as private from outside the class. You either declare it public (instead of private) which is really not a good practice or add a method that returns the value of the variable. [CODE]class bag{ private $no_of_items=0; private $sub_total; public …

Member Avatar for broj1
0
166
Member Avatar for louie540

I thing the cause of trouble could be in your query in a comment section (line 2): [CODE]$query_news = ("SELECT * FROM newscomments WHERE nid = id");[/CODE] id should probably be a PHP variable, maybe $id? Just a guess. [CODE]$query_news = ("SELECT * FROM newscomments WHERE nid = $id");[/CODE]

Member Avatar for broj1
0
180
Member Avatar for newbie26

Use Javascript for printing. The view button type attribute should be 'submit' while the print button type attributeshould be just 'button'. Then asign a javascript function to the print button like this: [CODE]<input type="button" onClick="window.print()">[/CODE]

Member Avatar for broj1
0
260
Member Avatar for sibymary

My guess: make sure that table book does not already exist. Add IF NOT EXISTS to the query. [CODE]CREATE TABLE IF NOT EXISTS book( bookid SMALLINT(10) NOT NULL AUTO_INCREMENT, PRIMARY KEY(bookid), author VARCHAR(30), title VARCHAR(30), accessno INT(20),edition INT(20),publisher VARCHAR(30), copies INT(10), status VARCHAR(30),CONSTRAINT fkbook FOREIGN KEY (status) REFERENCES issue(status))[/CODE]

Member Avatar for Raj sahaniya
0
141
Member Avatar for dr.4030

One way of doing it: [CODE]$brush_price = 5; $counter = 10; // row for quantities with heading in first cell $qtyRow = '<tr><th>Quantity</th>'; // row for prices with heading in first cell $priceRow = '<tr><th>Price</th>'; // add cells to each row while ( $counter <= 100 ) { $qtyRow .= …

Member Avatar for broj1
0
60
Member Avatar for KillingKiller

In the second situation use two div elements each containing the form elements for one radio button and one div being visible (display:block) and other hidden (display:none). Radio buttons should have JS code which is fired on onclick event and toggles the visibility of both div elements.

Member Avatar for diafol
0
235
Member Avatar for gotboots

See differencies between GET and POST here: [url]http://wiki.answers.com/Q/What_is_the_difference_between_get_and_post_method_in_HTTP[/url] And more indepth here: [url]http://www.cs.tut.fi/~jkorpela/forms/methods.html[/url]

Member Avatar for broj1
0
319
Member Avatar for fuggles

Depends on the operating system on your VPS ant the service in question I guess. If it is Linux you can use the following command to enable e.g. the Apache webserver service which will still run after you log out (on Fedora 15): [CODE]/sbin/chkconfig httpd on[/CODE] Service control is becoming …

Member Avatar for cwarn23
0
74
Member Avatar for sammry

Your query should return only records for users whose expiry date is 7 days or less. That is why your mailing code should go into the while loop which steps through the result set. I suggest you check what your query returns. comment out lines 60 and 62 and add …

Member Avatar for sammry
0
243
Member Avatar for httpgal

What are variables $s1i, $s2i... and $s1s, $s2s... and where they get their values from? Do you get any error messages? What is the structure of the class table?

Member Avatar for calebcook
0
290
Member Avatar for LRNPHP

Introduce a foreign key in Table B which then have two fields: dst_code_fk with values 011, 012, 013... and fee with values 0.38, 0.55, 0.55... Then use join and if you want to find out a fee for dst_code 011 do it like this: [CODE]SELECT table_a.fee FROM table_a LEFT JOIN …

Member Avatar for LRNPHP
0
163
Member Avatar for broj1

I have prepared an example of login page which displays a form with inputs for username and password and compares submited values with records in database. If match is found the user is redirected to another page, if not error message is displayed. This example is heavy commented. Hope it …

Member Avatar for broj1
3
778
Member Avatar for Sparhauoc

You should set $_SESSION['loggedin']='1' only after the successful login not in the beginning of the script.

Member Avatar for broj1
0
122
Member Avatar for spanners

I am not sure if I understood the question but if you do not want to get the green $clubName parsed and replaced with it's value either escape the $ like \$clubName or put the whole string in single quotes and xml attributes in double quotes like:[CODE]$new_xml = '<?xml version="1.0"?>-<params>-<param><key>$clubName</key><textValue>' …

Member Avatar for spanners
0
185
Member Avatar for lobebe

The first thing I note is the missing ; in line 56 in the above listing.

Member Avatar for lobebe
0
216
Member Avatar for newbie14

The HTML code (second snippet) seem not to be generated from the PHP code in the first snippet since PHP code says id='gridRow' (single quotes) and HTML generated is id="gridRow" (double quotes) I would code like this (all HTML attributes in double quotes): [CODE]echo "<tr id=\"gridRow\"> <td >$count</td> <td> <input …

Member Avatar for vibhaJ
1
99
Member Avatar for Stefano Mtangoo

If session is stored in a filesystem it is stored as plaintext and every user having access to directory can read the session data (at least root and sudoers). If it is saved in a database only users that have access to database and appropriate permisions can read the data.

Member Avatar for Stefano Mtangoo
0
155
Member Avatar for davy_yg

Try to surround code in header.php with <?php ?> tags. [CODE]<?php <div id="header"> <h2>1stWebDesigner PHP Template</h2> </div> ?>[/CODE]

Member Avatar for azeem786
0
2K
Member Avatar for Nahiyan

Use print_r($mysql_result) to se what $mysql_result realy contains. Maybe it is an array.

Member Avatar for leakbali
0
205
Member Avatar for felix001

It is quite easy in PHP. You set form action to the same page and then first check wheter $_GET (or $_POST if method is post) array contain any submited values. The values that exist can be used for the HTML you wish to display below. An example: [CODE]if(isset($_GET['select1'])) { …

Member Avatar for broj1
0
76
Member Avatar for jacksantho
Member Avatar for broj1
0
57

The End.