812 Posted Topics

Member Avatar for Djmann1013

Sory for jumping in, I just have too much time right now :-). You can not use a function within double quoted string (you can use variables though). Do a concatenation: $sql = "INSERT INTO `db` (profile image) VALUES " . mysql_real_escape_string($grav_url) . " WHERE id='{$_SESSION['sessid']}'"; This should work provided …

Member Avatar for broj1
0
135
Member Avatar for MMadhavi

In the php file first check whether the form was submitted: <?php // assumming you use method=post if(isset($_POST['submit'])) { // do the insert // display thankyou message // end the script die(); } // if the form was not submitted, display it // ... ?> <form action="#" method="post"> ...

Member Avatar for broj1
0
119
Member Avatar for confstu

mysql_fetch_array returns a row of the table in a form of an array. You actually are processing row by row already in the code: while($row = mysql_fetch_array($result)) Within the above while loop you can do anything with the row or the fields of the row. Can you please explain more …

Member Avatar for confstu
0
244
Member Avatar for LastMitch

I use PEAR now and then. Mostly I use MDB2 package for abstraction of access to a database which I thimk is a pretty good collection of code and (hopefully) enable you to switch to another supported database without much changes to your code. Another package I use is Pager …

Member Avatar for LastMitch
0
165
Member Avatar for bLuEmEzzy

Just my guess since I am not using Ubuntu but Fedora. I think scripts and web pages should be in a directory that is defined in a webserver configuration (in Fedora and some other distros the config file is /etc/httpd/conf/httpd.conf and the web pages are in /var/www/html). The directories and …

Member Avatar for bLuEmEzzy
0
368
Member Avatar for andyy121

When you click Register button it will bring you to login.php page which I assume is the code from your second post. Does that answer your question?

Member Avatar for James Donovan
0
152
Member Avatar for memccool

The $time might be undefined if the user does not chose any value. Make a default value (or set the selected attribute) or warn the user that the time has not been selected. if(isset($_POST['hour']) and $_POST['hour'] > 0 and $_POST['hour'] <= 24) { $time = $_POST['hour']; } else { // …

Member Avatar for broj1
0
297
Member Avatar for LastMitch

Many developers (including myself) use Eclipse (http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliossr2). Maybe a bit complicted to install and configure but powerful. Quite many also use Netbeans (http://netbeans.org/). I use it now and then at home and find it very good also. Many text editors also provide syntax checking like Notepad++, KWrite, gedit (both Linux) …

Member Avatar for LastMitch
2
582
Member Avatar for Paul7575

Change line 13 to: echo "$pt, "; mysql_fetch_assoc returns an array (with only one element in above case) and implode returns a string (P1, P2, P3 etc on each iterration).

Member Avatar for broj1
0
72
Member Avatar for jwales

Most common approach is to store the data from each submitted form in a database table and then create an excel file upon a request (e.g. the administrator can download the excel file by clicking a link). I hope you have database connection already set and script made to save …

Member Avatar for broj1
0
706
Member Avatar for mcrbne

The names in the $_POST array have to be the same as the name attributes of form fileds i.e.: <input name="email" type="text" size="30" /> <?php $email = $_POST['email'];?> It is much easier if the name attribtes and the variables are the same.

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

The following is my suggestion (maybe not perfect but works): // first check if the form was submitted if(isset($_POST['submit'])) { // initialize the array that will hold potential error messages $errors = array(); // initialize variables (for filling-in fields in case of errors) $name = $_POST['name']; $email = $_POST['email']; $phone …

Member Avatar for broj1
0
229
Member Avatar for phpDave

Multiple ANDs are legitimate and should work OK. However usually tables are joined on some matching fields so your query should also contain ON keyword. Do you get any errors running the query in phpmyadmin?

Member Avatar for pritaeas
0
88
Member Avatar for sri.

Maybe have look at this: http://www.killerphp.com/tutorials/object-oriented-php/. Haven't checked it myself but looks like a simple introduction.

Member Avatar for rajengg
0
129
Member Avatar for wildplace

And be aware of the difference between `||` and `or` (and also `&&` and `and` ) since they are essentially the same but do get evaluated in different order. See also the following thread: http://www.daniweb.com/web-development/php/threads/424547/-vs-and#post1814451

Member Avatar for wildplace
0
115
Member Avatar for rjony321

Are the two tables somehow related? If yes you can JOIN them and search for both terms. Without knowing the structure of the tables it is hard to tell more.

Member Avatar for diafol
0
129
Member Avatar for phorce

I get the text displayed as H1 (Firefox 12 on Fedora 16). Maybe you should have a look at the HTML code that your browser displays and see if there are any errors elsewhere (right click on page and select View page source in Firefox).

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

This is the principle: for($row=1;$row<=20; $row++){ echo "<tr>\n"; for($col=1;$col<=20; $col++) { $x=rand($min,$max); $random_array[$row][$col] = $x; if($x % 2 == 0) { $char = '*'; } else { $char = '%'; } echo"<td>$char</td>\n"; // add value to the $temp_array $temp_array[] = $x; } echo "</tr>"; }

Member Avatar for <M/>
0
117
Member Avatar for <M/>

In the above code the variables $table and $y are undefined. What is the purpose of those? Also you should not put the `</table>` tag within the foreach loop (see line 23). I am still looking at your code so more follows.

Member Avatar for broj1
0
143
Member Avatar for IJudgeyI

The following code should roughly do it: // add the first div echo '<div id="shelf" class="Magenta_div">'; // initialize the counter for the current table row $current_row = 1; while($row = mysqli_fetch_row($res)) { // echo the image data from the db table row echo "..."; // check if the current row …

Member Avatar for IJudgeyI
0
127
Member Avatar for reggie.dipo

Also where do you get the $_GET['id'] from? Maybe you should test for it whether it contains a valid value like this: if(isset($_GET['id']) and is_numeric($_GET['id'])) { $id = (int)$_GET['id']; } else { die('Error, no ID passed over.'); }

Member Avatar for broj1
0
110
Member Avatar for engrjawad

Put the following on the line 8: die($query); and post what you get. It might be that the $subject_id is empty or not set.

Member Avatar for broj1
0
66
Member Avatar for wajahat.ahmed1
Member Avatar for gurusubramaniam
Member Avatar for broj1
0
90
Member Avatar for nova37

Which linux distro do you have? In Fedora (16) phpmyadmin is in the updates repository.

Member Avatar for thilipdilip
0
200
Member Avatar for aneeqtariq_143

Add a variable that counts record and check in the loop whether is odd or even. If it is odd then you start the row and the cell, if it is even end the cell and the row of the table. function getBookSeller () { $con = mysql_connect(server , userName …

Member Avatar for broj1
0
128
Member Avatar for David2012

You are missing value attributes for each radio button. The chosen value (only one) will get carried over to the abc.php page through $_POST global array. Note that you are also missing a submit button to submit the form. On abc.php start with checking if $_POST['agree'] is set which means …

Member Avatar for David2012
0
16K
Member Avatar for showman13

I use TCPDF for stufflike this. The following is adaption of example from tcpdf.org. Download the library, link to it and check it out. It is not perfect, you can fine tune it. <?php // some test data; you will read it from the database $TEST_LABEL_DATA = array( array( 'title' …

Member Avatar for coolest_987
0
1K
Member Avatar for tjamesp

Here are some hints: - when coding a form use name attributes that match column names - decide whether use post or get method (post is slightly more secure, get can be easily bookmarked or saved) - in any case clean the input before using it in a query (use …

Member Avatar for liquidbroadcast
0
189
Member Avatar for skitband

The following links might help: http://www.php.net/manual/en/book.ibase.php http://www.php.net/manual/en/function.ibase-connect.php

Member Avatar for broj1
0
44
Member Avatar for HasNor

Is the problem that the browser can not open the files with the above extensions? If that is the case you probably do not have the appropriate program to open the files (up to date MS Office version, viewer apps or LibreOffice) or browser component. What is actually the error …

Member Avatar for broj1
0
280
Member Avatar for jckb188

First, do not think of yourself so negatively, mate. No-one is perfect and we all have our weaknesses as far as programming (and everything else) goes. Your question is a bit unclear. What is the code that works and what is the code that does not work? Your queries above …

Member Avatar for broj1
0
199
Member Avatar for matanc244

You do not read any variables for values from the form on previous page in the update_ac.php. You should assign the values from the $_POST array. This should go on top of the pdate_ac.php: // check if the form was submitted if(isset($_POST['Submit'])) { // get the ID (cast it to …

Member Avatar for broj1
0
174
Member Avatar for hwoarang69

I think you should echo the $row['image_id'] value like: <a href='deleteimage.php?imgid=<?php echo $row['image_id'];?>'>Delete</a>

Member Avatar for broj1
0
128
Member Avatar for apanimesh061

Apparently you already have three thumbnails generated for each video and you can just link to them. See http://www.reelseo.com/youtube-thumbnail-image/

Member Avatar for apanimesh061
0
1K
Member Avatar for bigpoppapumpg

Openoffice has been in the Apache incubator for long time now. The availability of languages is very poor which to me indicates the state of the package. Most Linux distributions switched to libreoffice soon after oracle got rid of openoffice. Also many developers switched to OSF. I am not sure …

Member Avatar for tyson567
0
440
Member Avatar for veledrom

This is just an idea (not tested) of how would I do it (I am actually using a PEAR Pager package which is excellent for this task): If your current page is $current then your first key is (floor($current/10)*10) +1 and the last key is first key + 9 (hopefuly …

Member Avatar for veledrom
0
154
Member Avatar for bflack

I'm not using xamp but as far as I know xamp includes phpmyadmin which you can use to export / import databases or tables. In phpmyadmin go to home icon (on the far top left) select the database to export and from the top menu in the right pane select …

Member Avatar for veedeoo
0
204
Member Avatar for adchicago

Change the name attribute to an array <input type="checkbox" name="Project[]" value="... /> and all the checked checkboxes should be in `$_POST['Project']` which will be an array, too. // e.g. you can get a list of project (a string) by imploding the array $Project = implode(', ', $_POST ['Project']);

Member Avatar for adchicago
0
211
Member Avatar for Exaktor

// assuming you use method=post in your form if(isset($_POST['SelectMake'])) { $make = mysql_real_escape_string($_POST['SelectMake']); $query = "SELECT * FROM cars WHERE make=$make"; ... }

Member Avatar for broj1
0
120
Member Avatar for divyakrishnan

Is it that the FTP server is running on RedHat Linux? Have you tried connecting with an ordinary FTP client to test whether user exists and the password is set OK? Do you get a warning form PHP (frp_login should issue a warning if returns false).

Member Avatar for broj1
0
113
Member Avatar for Crow77

This is because mysql_query() function returns an ID for a resource, not a result. To get the result use mysql_fetch_assoc() or mysql_fetch_row(): $res = mysql_query($sql); $row = mysql_fetch_assoc($res); $PINDEX=$row['PREF'];

Member Avatar for Crow77
0
217
Member Avatar for hwoarang69

There are a couple of ways of implementing this. The usual way (from my point of view) is: On the beginning you check for existence of `$_POST['submit']`, which signals that the form was submitted. Then you check if image description exists and is valid. You sanitize/escape it and send it …

Member Avatar for hwoarang69
0
198
Member Avatar for aaloo

Since this function returns false in case of error you can use it this way: $post = mysql_real_escape_string($_POST['post']) or die('ERROR: ' . mysql_error()); If there is an error you will get some description about it. But as MarPlo stated above the link to the database has to be established first, …

Member Avatar for broj1
0
123
Member Avatar for code739

Which input does not print (identify it by name attribute)? The first input is the type of "hidden" and won't print which is what is expected. Other input fields show up normaly.

Member Avatar for broj1
0
214
Member Avatar for harshm027

Put the php block that generates required data at the top or before the form div (this won't change the appearenca of the page).

Member Avatar for harshm027
0
111
Member Avatar for harshm027

The following is a simple example of how to build a SELECT query based on the values typed in a search form. Please note security stuff has ben omitted for clarity. Do not forget to apply security checks. See comments in the code. // check if the form was submitted …

Member Avatar for harshm027
0
3K
Member Avatar for dwlamb

Are your include files OK? Are they wrapped nicely with the `<?php ?>` tags.

Member Avatar for Squidge
0
236
Member Avatar for salii

The `/**` on the end is probbably the missing one from the beginning. Just move it from the last row to the first row and insert a newline immediately after it. `/**` is a beginning of a comment that can be used for documentation purposes. See http://www.phpdoc.de/ or http://phpdoc.org/

Member Avatar for salii
0
1K
Member Avatar for dgibbons82

And before inserting them, check the values and/or escape them. $firstname = trim(mysql_real_escape_string($_POST['firstname'])); ...

Member Avatar for broj1
0
5K

The End.