812 Posted Topics

Member Avatar for HTMLperson5

Try if apache web server is running. Go to your web root directory and create a simple index.htm file with the following contents: <html><head>HTML test</head><body><p>Hello html world</p></body></html> Open it in your browser and check if web server is running OK. Next you can test if PHP works. Create a test.php …

Member Avatar for broj1
0
199
Member Avatar for DaveyMoyes

If they are numeric check if they are equal: if(is_numeric($lastfour) && is_numeric($cnumber) && ($lastfour != $cnumber)) { // they are not equal } elseif(strcmp($lastfour, $cnumber) != 0) { // they are not equal } else { // they might be equal }

Member Avatar for broj1
0
146
Member Avatar for jacksantho

To use session mechanism start each script with: session_start(); Store the link in the $_SESSION array from the while loop this way: $_SESSION['link'][] = "<a href=test.php>$pid</a>"; You can also use $pid as an index for the array: $_SESSION['link'][$pid] = "<a href=test.php>$pid</a>"; Then in the test.php page just use the array …

Member Avatar for broj1
0
4K
Member Avatar for McLaren

According to the PHP manual the only difference between && and AND is that && is higher in precedence and gets evaluated before AND, otherwise hey do the same thing (logical comparison). This should not affect your example since you use parentheses and ! has higher precedence anyway. Can you …

Member Avatar for cereal
0
325
Member Avatar for newbie1234

You have a problem with the browsing history not the cache (the cache just speeds up loading of pages by saving what you visited). My opinion is that it is not a good idea to change the behaviour of browser back and forward buttons since user expects clicking on them …

Member Avatar for broj1
0
151
Member Avatar for veledrom

You could use return statement to return true on success and false on failure. This way you can test the method when calling it from somewhere else like: $we = new Whatever; if($we->say_hello('Jack')) { // do something like log success // ... } else { // do something else like …

Member Avatar for veledrom
0
116
Member Avatar for Albert Pinto

> header('Location: http://www.mysite.in/index.php'); I don't think you need the second redirection (to the index.php) at all. If the visitor is from the banned country (such as 'PK') they will be redirected by first redirection. other visitors will just stay at the index.php.

Member Avatar for Albert Pinto
0
556
Member Avatar for gopi17

Two things come to my mind: Check if the allow_url_fopen in php.ini is set (see http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen). If you are on Windows make sure backslashes are escaped or use forward slashes (see http://php.net/manual/en/function.fopen.php).

Member Avatar for code739
0
142
Member Avatar for ElaineTeo
Member Avatar for ElaineTeo
0
207
Member Avatar for dheerajm

You can also save the original search query (or results) into the session ($_SESSION array) and use the values in the other script. See http://www.php.net/manual/en/book.session.php

Member Avatar for senthilvignesh
0
118
Member Avatar for Rsimpson105

Is there any HTML code before your php tag? No html or any other output can be sent before header() function (not even a space - check for those).

Member Avatar for senthilvignesh
0
245
Member Avatar for LastMitch

If I understand correctly: you want to construct an SQL statement depending on a field to be sorted on and the sort direction (ASC, DESC)? If the above is true then the simplest option is to have the field to be sorted on and the sort direction in a querystring …

Member Avatar for diafol
1
4K
Member Avatar for sentongogray

http://www.w3schools.com/ says on their front page: Learn to create websites. It is a good starting point. You will have to learn at least: HTML: http://www.w3schools.com/html/default.asp CSS: http://www.w3schools.com/css/default.asp In addition to that it is good to know: Server scripting, like PHP: http://www.w3schools.com/php/default.asp Client scripting, like Javascript: http://www.w3schools.com/js/default.asp Databases and SQL: http://www.w3schools.com/sql/default.asp …

Member Avatar for rohanbhangui
0
181
Member Avatar for Shougat

The code has errors. You are missing quotes arround strings in lines 6 and 7: echo "<td>" . '<input name="txtf1" type="text" />' . "</td>"; echo "<td>" . '<input name="txtf2" type="text" />' . "</td>"; Since you do not know whether you are getting all the fields from the database as you …

Member Avatar for broj1
0
465
Member Avatar for Tharanga05

Try to find out whether the findcity.php, which is supposed to return HTML code for a select element, works OK. I would put the following on the line 10 of the findcity.php: die($query); which will display the query instead of the select element. Now you can test the query in …

Member Avatar for broj1
0
495
Member Avatar for Awah Mohamed

I am not sure whether I am on the same line but number of simultaneous connections probaly depends on the web server you are using and how it is configured. If you are using Apache maybe this is the starting point: http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients Interestingly there is a Web socket protocol but …

Member Avatar for Awah Mohamed
0
1K
Member Avatar for imranjavedpk

My advice is to use TCPDF library for converting to PDF. There are plenty of excelent examples on their website which is www.tcpdf.org. The library is open source and maintained.

Member Avatar for broj1
0
85
Member Avatar for abhi10kumar

Use mysql_real_escape_string (provided that you use mySql): $safe_short_description = mysql_real_escape_string("PG for Girls/Ladies/Women in Kasmiri Rd, heart of the Agra city with fully furnished, 2/3 times homely food and all basic amenities."); $safe_long_description = mysql_real_escape_string("PG's for Girls/Ladies/Women in Kasmiri Rd, heart of the Agra city - Neat, clean & beautiful, PG's …

Member Avatar for seslie
0
100
Member Avatar for HasNor

I have not tried this but I think text fields should be put within text delimiters (usualy double quotes). Try changing your code this way: $csv_output .= '"$row['misRefId']"' . ", "; ... This way commas will be within double quotes as part of the text and wont be treated as …

Member Avatar for Biiim
0
3K
Member Avatar for CarterLangley

You have two else statements for one if statement which is syntactically incorrect: if(($_SESSION['id']) && ($_SESSION['access_level'] == 1)) { } else { } else { // this second else on line 383 is incorrect } You can use elseif(another condition) if that is what you require.

Member Avatar for CarterLangley
0
205
Member Avatar for broj1

Hi all I would like to display several charts on a webpage. I have designed a class that would draw each chart using GD and based on data set by a public method. Unfortunately instead of charts being drawn I get an error message: The image ... cannot be displayed …

Member Avatar for broj1
0
237
Member Avatar for gilgil2

A general answer: 1. read the record that the user is about to change 2. put each field value as a value of a html form field 3. for select html elements (drop down as you call it) put a set of option in an array, loop through that array …

Member Avatar for gilgil2
0
188
Member Avatar for waqar3
Member Avatar for veledrom

in_array function actualy works if you pass it an array as a needle (PHP 4.2 and above) : $test_arr = array( 0 => array('StudentID' => 123456789), 1 => array('StudentID' => 001122334), 2 => array('StudentID' => 010203040), 3 => array('StudentID' => 987654321)); if(in_array(array('StudentID' => 123456789), $test_arr)) { echo 'Found'; } else …

Member Avatar for veledrom
0
159
Member Avatar for marifard

You will have to use the correct type of joins (LEFT JOIN, RIGHT JOIN) to retrieve records with empty values. Which type of JOIN depends on the structure of tables and where the empty values are. See this tutorial: http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php

Member Avatar for diafol
0
160
Member Avatar for Wolxhound90

Insert this code between lines 8 and 9 and post what is displayed: echo('<pre>' . print_r($row, 1) . '</pre>'); This will display and array of values for each row. <pre> tags are just for nicer formatting. If each row is an array of expected values then your table should print …

Member Avatar for Wolxhound90
0
105
Member Avatar for tubesnube

You are probably missing an assignment to a variable $doc_id (put it on line 22) just before you construct $searchById, like: $doc_id = $_POST['searchID'] And if $doc_id is a number (integer) you could use = instead of LIKE in your query.

Member Avatar for tubesnube
0
302
Member Avatar for himanshu.1691

If you have only drop down boxes (select elements in HTML terms) in your table, you can assign this function to the checkbox's onclick event: function selectAll { // read all select elements var selectArray = document.getElementsByTagname('select'); // loop thorugh the select elements array for(var oneSelect in selectArray) { // …

Member Avatar for broj1
0
172
Member Avatar for studentabc

I think you do not need any php nor javascript code in the html document according to the instructions. If required fields are missing, you will handle an error message in the process.php. In the process.php file first check whether the required fields are there (use isset() and empty() functions …

Member Avatar for broj1
0
2K
Member Avatar for Mariel Pineda

Do you get any error messages? If yes post them here. Also display the query and check it in phpmyadmin (or post it here). Change your code to something like: $query = "SELECT * FROM books where Code='$code'"; // this will display the query so you can check it die($query); …

Member Avatar for broj1
0
389
Member Avatar for madhan

jQuery you use also supports ajax. See http://api.jquery.com/jQuery.ajax/. That's the most I can suggest since I am not too familiar with jQuery.

Member Avatar for blocblue
0
2K
Member Avatar for breakzzzz20

Do the classic trick: insert `die(query)` after the `$query = mysql_query("INSERT INTO grades ...` statement and inspect whether the query is OK. Test it in phpmyadmin (or post it here).

Member Avatar for breakzzzz20
0
2K
Member Avatar for tallygal

This is because you have a return statement within a foreach loop so the loop gets executed only once. Try this way: function t6($table) { $rows = ''; foreach ($table as $key => $value) { $rows .= "<tr><td>$key</td><td>$value</td></tr>\n"; } return $rows; }

Member Avatar for tallygal
0
2K
Member Avatar for Transcendent

I copied your code and the value of gender displays OK (if you chose one). Put a break after it in php file to make it more visible echo "You are: $genderRadio<br />"; If the gender still does not get displayed print the whole $_POST array and see what it …

Member Avatar for broj1
0
134
Member Avatar for Mariel Pineda

I suggest you echo the query to see whether it is what you are expecting. Modifiy the part where you construct the query like this: // put the query in a variable $q = "UPDATE books SET Title ='$title_save', Price ='$price_save', Stock='$stock_save' WHERE Code= '$code'"; // submit query using the …

Member Avatar for broj1
0
105
Member Avatar for DarkMonarch

To keep a lang setting in a session seems OK for a session duration, to store it as a preference, put it into a database or a file. But back to your problem: do you have anywhere in your script(s) the session_start() command? It is required on every page for …

Member Avatar for DarkMonarch
0
98
Member Avatar for BenzZz

In the included file check whether the data (and database) exist and if not add records (otherwise do nothing). Or in your primary fle check whether the data exists and if not then include the file.

Member Avatar for broj1
0
144
Member Avatar for don't give up

First move the beginning form tag (line 30) out of the while loop. It should be before the `<table>` tag, just after line 12. The rest is similar to your previous post. If show_others_0.php script is another page (not this one) then you will process POST data there. First check …

Member Avatar for broj1
0
315
Member Avatar for arihantphp

This is i.e enter_name.html with a form containing a text input element and a submit button ... <form method="post" action="show_name.php"> <input type="text" name="entered_name" /> <input type="submit" name="submit" value="submit"> </form> ... This is show_name.php that receives the post data and displays it; specific file is in the action of the form, …

Member Avatar for broj1
0
220
Member Avatar for don't give up

Basicaly what you do you add a ceckbox to each row in the table, wrap the table in `<form></form>` tags, add hidden fields which hold the topics and add a submit button. Then you first check if the form has been submitted. If yes you process it (do the insert) …

Member Avatar for don't give up
0
137
Member Avatar for MattD00

Maybe you shoud put the update block first, so the script check whether POST data exists and writes changes to the DB (I presume action is set to open the same script). if (isset ($_POST['update1'])) { //$row["title"] = "title"; //$row["id"] = "id"; $update = "UPDATE home SET title = '".$_POST['title']."' …

Member Avatar for broj1
0
116
Member Avatar for beastpanda

The problem is in lines 7 and 8 of the html file. You are missing '=' sign when assigning name attributes to input elements. This is the correct code: value one: <input type="text" name="val1" size=10 /><br /> value two: <input type="text" name="val2" size=10 /><br />

Member Avatar for broj1
0
190
Member Avatar for gopi17

Hopefuly you are using CSS for layout. If yes, you can use different media types and rules: @media screen for normal screen, @media handheld for smaller screens on handeld devices. See: [url]http://www.w3.org/TR/CSS2/media.html[/url]

Member Avatar for gopi17
0
134
Member Avatar for aianne

What is the error message (if any) that you get? Have you checked if the update query gets constructed as expected? Place the following code on line 97 in grade.php: [CODE]die($sql);[/CODE]. It will stop the script at the point where the query is constructed and echo the query. You can …

Member Avatar for aianne
0
324
Member Avatar for PF2G

I do not know whether this is the cause for your trouble but there are two issues: 1. you start a table row within a list item (<li>) and end it outside the list item; html tags should be nested appropriately 2. putting a table (even if properly nested) within …

Member Avatar for broj1
0
105
Member Avatar for danielbala

Let's start with basic questions: have you started servers (there should be an icon on the desktop i guess)? Is at least one of the index pages existing (index.htm, index.html, index.php)?

Member Avatar for danielbala
0
152
Member Avatar for SQLpower

Line 8 will never get executed, but that is not the problem anyway. The code seems OK. What actually is not working? Please describe (error messages, what is supposed to happen but it does not...).

Member Avatar for nidayaqoob1230
0
198
Member Avatar for desup

You can use nowdoc syntax (requires PHP 5.3): [url]http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc[/url] Please note that variables will not get parsed. You could also use a heredoc syntax but I am really not sure whether function keyword gets parsed or not.

Member Avatar for desup
0
278
Member Avatar for arunpawar

Hopefuly you have the URL for each bookmark in the table (bookmark_url and bookmark_text fields as an example below). [CODE]// echo table rows while($row2 = mysql_fetch_row($data)) { $bookmark_url = $row2['bookmark_url']; $bookmark_text = $row2['bookmark_text'] echo "<tr><td><a href=\"$bookmark_url\">$bookmark_text</a></td></tr>"; } [/CODE]

Member Avatar for broj1
0
109
Member Avatar for himanshu.1691

It is a good idea to plan ahead as much as possible. The higher the access rights are the higher the role value. As veedeoo suggested it pays if you use values that have enough free values between them so you can always add a new role which fits between …

Member Avatar for broj1
0
139

The End.