139 Posted Topics

Member Avatar for aaloo

Add this to the start of your code: [CODE]echo "Post:".print_r($_POST,true); echo "Get: ".print_r($_GET,true); [/CODE] This should give you an idea of what Flash is passing to your script.

Member Avatar for Biiim
0
3K
Member Avatar for shamsidah

Assuming that date_visit is of date or datetime type you can use the BETWEEN operator in mysql. [CODE=sql]... WHERE date_visit BETWEEN '$date_start' AND '$date_end' ...[/CODE]

Member Avatar for suresh ma
0
127
Member Avatar for twitah

If you don't want users to be able to change a value, don't give it to them in a form. Even a hidden input field can be hacked. If filling out the form will always award the user 10 points and 10 coins, for example, then do that in the …

Member Avatar for diafol
0
155
Member Avatar for SummerNight

The examples above don't make mathematical sense to me as @niranga also points out. The average total in your example is $77.50. Anybody who spend more than that is owed money and anybody who spent less owes money to the others. Is that the gist of what you are trying …

Member Avatar for diafol
0
137
Member Avatar for asif49

@asif49 means that MySQL's full-text index feature is designed to accomodate natural language searches that are much more powerful than a simple LIKE statement with wildcards. Check out the MySQL manual for details on how to use them. Here's the manual entry for MySQL 5.0: [url]http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html[/url]

Member Avatar for the_traveller
0
104
Member Avatar for Netsurfers

@momo219 is correct. Don't use LIKE when comparing for a number. LIKE works with strings and the '%' is a wildcard that matches ANY CHARACTER(S).

Member Avatar for Netsurfers
0
148
Member Avatar for Buppy

I tried the statement with a string and it works fine using the format you indicated. Perhaps the file isn't being read in properly? This works, for example: [CODE=php] <?php $filecont ='Name: Some Name 1 Email: some@email.com Name: Some Name 2 Email: some@email.com Name: Some Name 3 Email: some@email.com Name: …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for Mve83

You can solve this using CSS. Advanced CSS Printing - Using CSS Page Breaks : [url]http://davidwalsh.name/css-page-breaks[/url] A List Apart - Going to Print: [url]http://www.alistapart.com/articles/goingtoprint/[/url]

Member Avatar for Mve83
0
1K
Member Avatar for Whilliam

It sort of depends on what jupiter.php actually does and how it would be used. You could access it remotely using an html iframe element.

Member Avatar for Whilliam
0
172
Member Avatar for DariusG

On line 85 of your code, you are using [I]$id_album[/I] which occurs AFTER the initial [I]while[/I] loop, so yes, you should only get the last value it was assigned while in the loop. The first [I]while[/I] is terminated on line 55.

Member Avatar for phoenix_2000
0
189
Member Avatar for dr.4030

Do your results need to be returned as columns/rows like that? It is much easier to return the details as rows and columns instead (also, more legible in my experience.) [CODE][U][B]id | data[/U][/B] 10 | k 9 | a 8 | s [/CODE]

Member Avatar for turt2live
0
118
Member Avatar for Joemeister

There is no MOVE in sql. 1. Select the request from the Requests table. 2. Insert a row in the Friends table with the new friend. 3. Insert another row with the keys reversed (friend_id is also a friend to user_id) 4. Delete the friend request entry in the Requests …

Member Avatar for stoopkid
0
127
Member Avatar for axxxpua

Clients and Work types form a "1 to many" relationship (often 1:n.) This means that for every client (stored in one record) there needs to be 1 or more related worktypes for that client. Usually this is solved with three tables. Two tables will store the data and the third …

Member Avatar for axxxpua
0
205
Member Avatar for stoopkid

Take a look at array_intersect () php.net/manual/en/function.array-intersect.php That function returns an array of elements that match in two (or more) arrays.

Member Avatar for diafol
0
145
Member Avatar for Who me?

As you are clearly very new to php, I'd recommend you read up on [I]arrays[/I] and [I]loops[/I].

Member Avatar for diafol
0
2K
Member Avatar for jacksantho

[I](The previous two posts came in while I was editing this, but maybe it will still be useful to you.)[/I] @jacksantho, Your code is looking better but you haven't integrated what @almostbob demonstrated. You must echo out some html, [ICODE]selected="selected"[/ICODE] for the option that is selected for the entry. What …

Member Avatar for almostbob
0
14K
Member Avatar for klemme

When rewriting, assume the url is already in the form you want and then rewrite it to what the web server and php would expect. For example: [CODE=apache] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(cms|admin|client|public)/(.*) $1/index.php/$2 [PT,L] # Allow any files or directories that exist to be displayed directly …

Member Avatar for madCoder
0
90
Member Avatar for Sorcher

That dash is being interpreted as a minus sign. Try wrapping the table name in back quotes: [CODE=sql] SELECT * FROM `ue-userfile` WHERE id='$imageid' AND userid='$userid' [/CODE]

Member Avatar for Sorcher
0
70
Member Avatar for rom.

What version of php are you using on the new server? What version did it run on before?

Member Avatar for rom.
0
340
Member Avatar for praset

You may be exceeding the maximum file size limit on the upload (not clear from the question if you are doing this.) Check out [url]http://www.php.net/manual/en/features.file-upload.common-pitfalls.php[/url]

Member Avatar for madCoder
0
109
Member Avatar for erik216

Debug by adding the line [code] echo mysql_error();[/code] to see what you get.

Member Avatar for faroukmuhammad
0
221
Member Avatar for srijon

The selected dates will be in $_POST['date'] as an array of those dates selected. If no dates were checked, $_POST['date'] won't exist! So don't just assume an array will be there. You can store the current month and year in hidden fields in your form. After submission, delete ALL entries …

Member Avatar for madCoder
0
119
Member Avatar for john0563

If you don't know the path to your document root you can use [ICODE]$_SERVER['DOCUMENT_ROOT'][/ICODE] [CODE=php] $path = $_SERVER['DOCUMENT_ROOT']."/logs/".date("Y")."/".date("m"); [/CODE] NOTE: DOCUMENT_ROOT is blank on an IIS (Windows) web server.

Member Avatar for ghazanfar381
0
2K
Member Avatar for destroyerx15

I'd recommend you read up on PRIMARY KEYS for databases and see how they are used. It is rare and very inconvenient to do updates based on strings like that. What if two orders contain the same set of checks? You will update MULTIPLE orders. Also, where is the value …

Member Avatar for madCoder
0
91
Member Avatar for RazorRamon

$_post should be $_POST. [I]er...unless there is another, preceding script that is creating $_post as a filtered, cleaned up version of $_POST.[/I] If not, you should filter the form info to prevent potential massive spam abuse.

Member Avatar for sharathg.satya
0
236
Member Avatar for jacob21

A slight correction to Zero13's code. Line 9 will always evaluate to true (except for year 0.) [ICODE]$selected = ($selectedYear == $yr_nam ) ? ' selected="selected"' : "";[/ICODE]

Member Avatar for karthik_ppts
0
2K
Member Avatar for klemme

I like: [I]The Definitive Guide to Apache mod_rewrite[/I] by Rich Bowen Apress Good coverage on the subject and a whole chapter dedicated (early on) on when NOT to use mod_rewrite because there are other Apache modules that do the task better.

Member Avatar for madCoder
0
191
Member Avatar for showman13

Haven't done this in a while but I think you can use count() with HAVING: [CODE=SQL] SELECT a.mem_id, count(b.mem_id) as trackCount FROM members a LEFT JOIN subs_track b USING(mem_id) WHERE a.mem_id = b.mem_id AND b.status = 'A' AND a.mem_status = 'A' GROUP BY a.mem_id HAVING trackCount = 0 ORDER BY …

Member Avatar for showman13
0
114
Member Avatar for designalex

@designalex Sessions are identified by a cookie that is sent to the browser when a session is first initialized. The session_id contains a key that points to the right set of session data. If a user has disabled cookies, this becomes problematic but a session id can also be passed …

Member Avatar for diafol
0
189
Member Avatar for turt2live

I get a broken link for the source code. If you already have a connection established to the database, your class doesn't need to create another one when using the mysql_* functions. The connection, once made exists in any scope like a superglobal.

Member Avatar for turt2live
0
115
Member Avatar for ROTC89

I notice your event table doesn't have a numeric primary key; instead eventid is a date. If you add a primary key to this table (rename current eventid to eventDate or something and add an 'id' column that is primary key, auto_increment.) Having a numeric primary key makes joining tables …

Member Avatar for madCoder
0
99
Member Avatar for klemme

[CODE=sql] SELECT * FROM pages WHERE subjectid = '{$sid}' AND showing='1' ORDER BY pos ASC [/CODE] That will let you filter for just pages keyed to a supplied subject where $sid is the subject id.

Member Avatar for madCoder
0
163
Member Avatar for mightysnake

You can solve this with a series of if statements by working backwards from greatest amount of time to least amount of time. Have a variable store how much time is remaining to be added to the total price. Pseudocode: [CODE] tempTime = totalTime price = 0 if tempTime is …

Member Avatar for madCoder
0
323
Member Avatar for ellenski

Each of your include files is not a complete document, they are snippets/sections of a document that will be included in index.php. Therefore, those other files do not need doctype, html, head, and body tags. If you view the source of your current output, you'll find these are being repeated …

Member Avatar for madCoder
0
202
Member Avatar for dragostone

You are sending the email addresses as the values of the selected entry. So, you can just loop over the results: [CODE=php] <?php if(isset($_POST['emails']) && is_array($_POST['emails']) { foreach($_POST['emails'] as $email) { mail($email, $message); } } else { echo "No email addresses to send to!"; } ?> [/CODE] If the code …

Member Avatar for dragostone
0
860
Member Avatar for dos_killer

It actually does work but not very well. You have to click on the Gallery link to see your results somewhere in the gallery. It converts an image into ASCII art versions of the supplied picture. Unfortunately, I don't really know much about the algorithm that goes behind converting an …

Member Avatar for jkon
0
583
Member Avatar for AndrewSD

Are you coding for a server that only has PHP 4.x or lower. Use of function like [URL="http://php.net/manual/en/function.session-register.php"]session_register()[/URL] have been deprecated in favor of using the $_SESSION super-global. Also, add a die() statement after your redirects. This prevents php from continuing to execute the script after the header is sent. …

Member Avatar for madCoder
0
104
Member Avatar for alanlai
Member Avatar for diafol
0
81
Member Avatar for WebKoller

Returning an array makes most sense for a 'getter' method. You can also create class properties to hold the information: [CODE=php] class Model_Group { public $groups = array(); public function getGroupData() { // Check if property was already initialized earlier. if(!empty($this->groups)) return $this->groups; $return_value = array(); $result = mysql_query('SELECT * …

Member Avatar for pritaeas
0
115
Member Avatar for Xufyan

I'm not at a computer with php installed but I have a hunch. Line 30 includes [icode]$total_rows/$per_page[/icode]. Both of those variables are integers so the rules of integer math are in play -- the result will be an integer, not a float. ceil() is left with nothing to round up. …

Member Avatar for diafol
0
1K
Member Avatar for DiamondCiara

Not at a computer where I can test your code. It would be easier (and the typical way) to key on the customer's id instead of email address. The id is, by necessity, a unique column and using the intval() function you can guarantee you have an integer value.

Member Avatar for DiamondCiara
0
209
Member Avatar for xamonix

So what is the value of $value and where would it come from? Is this a global coming from another file that includes this one?

Member Avatar for diafol
0
931
Member Avatar for mrcniceguy

[CODE] ... FROM friends RIGHT JOIN feeds ON friends.friendid=feeds.sender_id OR feeds.sender_id = '$logged_id' ... [/CODE] (I haven't tested this, not at my computer.) If you right join to the feeds (a feed without a friend that still satisfies the join condition) and store your user events as feed entries this …

Member Avatar for madCoder
0
148
Member Avatar for cristi08

Test for the condition you want to eliminate in your loop. [CODE=php] for($i=0;$i<$limit;$i++){ if(intval($cantitate[$i]) < 1) continue; // skip to next entry in the array; $queryi="insert into livrari_luni ... [/CODE]

Member Avatar for cristi08
0
175
Member Avatar for morteza_ipo

If that first blank line is actually in your source file, that is the culprit. There can be NO OUTPUT before setting a cookie or session (which also sets a cookie.)

Member Avatar for diafol
0
134
Member Avatar for dan1992

I don't see where the photo form field is being generated (I just see code at top where you test it.) If photo is a checkbox set or a multi-select, name the form field as 'photo[]'; [ICODE]<select name="photo[]" multiple="multiple" ...> [[/ICODE] You can then treat $_POST['photo'] as an array. Just …

Member Avatar for madCoder
0
98
Member Avatar for iroyal

str_replace is great for replacements but you have a pattern to find and section of that pattern you want to reuse. In your example, you insert the ENTIRE original string back into each link. YOu also lose the name for description of the link. A [B]regular expression[/B] does the job …

Member Avatar for iroyal
1
144
Member Avatar for muralibobby2015
Member Avatar for madCoder
0
134
Member Avatar for prettyrein

I agree with Shanti Chepuru about the logic. Also, not clear why you call `$this->getDepartmentCode()` in the query building statement when that information is being passed in as a parameter. Is that method returning the right piece of data?

Member Avatar for prettyrein
0
131
Member Avatar for MooGeek

There is an active discussion about that on the [URL="http://php.net/manual/en/function.time.php"]time() page of the php manual[/URL] with several code implementations.

Member Avatar for madCoder
0
88

The End.