627 Posted Topics

Member Avatar for gunnarflax

Read the manual: [url]http://us.php.net/manual/en/mysqli.real-connect.php[/url] The second example clearly shows you: [iCODE]parent::init()[/iCODE]

Member Avatar for gunnarflax
0
133
Member Avatar for roachae

in php just use strtotime(): [CODE]echo date('Y-m-d', strtotime("now -30 days") );[/CODE] In your case INSTEAD of now you would use whatever date you have.

Member Avatar for hielo
0
365
Member Avatar for newweb

try: [CODE] foreach($_SESSION['varukorg'] as $index=>$cart) { echo "<p>" . $cart['art'] . "</p>"; echo "<p>" . $cart['product'] . "</p>"; echo "<p>" . $cart['qte'] . "</p>"; echo "<p>" . $cart['price'] . "</p>"; echo "<p><a href=#><img src=\"/images/produkter/ $cart['image_cart'] \" width=100 height=100/></a></p>"; echo sprintf("<p><a href='%s?id=%s&action=d'>delete</a></p>",$_SERVER['PHP_SELF'],$index); } [/CODE] so when you click on the Delete …

Member Avatar for newweb
0
3K
Member Avatar for avinash_545

On line 115 you missed a closing ">" for your checkbox. [iCODE]<td><input type="checkbox" name="delFriends[]" value="<?php echo $rows['receiver_username'];?>" [COLOR="Red"][B]>[/B][/COLOR]</td></tr>[/iCODE] Also, line 23 is wrong. The name of your element is NOT "delFriends". Use the exact name you gave the element

Member Avatar for mohanrajit.88
0
106
Member Avatar for raf08

you would need a primary key in your table `mobilephones`. Do you have a primary key? If yes, what is it? Also, for effiency purposes, try to avoid [iCODE]SELECT *[/iCODE] if you are NOT going to use all the fields/columns in your table. Instead list only the fields/columns you need.

Member Avatar for Caeon
0
176
Member Avatar for Vidgie65

javascript is case sensitive. To clarify, [iCODE]var greeting="...";[/iCODE] is different from: [iCODE]var Greeting="...";[/iCODE] In your case you declared and initialized a variable named allSelect (with uppercase "S"), but in the for you are using [iCODE]... < all[color="Red"][b]s[/b][/color]elect.length[/iCODE] (notice the lowercase "s"). The same problem exists in [iCODE]if (all[COLOR="Red"][B]s[/B][/COLOR]elect[i].className[/iCODE]

Member Avatar for Vidgie65
0
184
Member Avatar for tobeye

You are currently executing 10 queries (one in every iteration). Instead, do NOT use a [iCODE]for[/iCODE] construct and instead execute ONE query. IF you want ALL the records, do NOT use a [iCODE]WHERE [/iCODE] clause - simply execute: [iCODE]Select cat_id, cat_name from tovanu.categories[/iCODE] If you want only the records with …

Member Avatar for hielo
0
149
Member Avatar for lit108

On line 20 you are using a single "|" to mean "or". You need TWO since you are not doing bitwise OR-ing. Furthermore, that line should be: [iCODE]if(!isset($_POST['email']) || empty($_POST['email']) || !isset($_POST['pass']) || empty($_POST['pass']) )[/iCODE] Also, change [iCODE]mysql_fetch_array()[/iCODE] to [iCODE]mysql_fetch_assoc()[/iCODE] Lastly, IMMEDIATELY after the [iCODE]header("Location: account.php");[/iCODE] put [iCODE]exit();[/iCODE]

Member Avatar for lit108
0
179
Member Avatar for mbarandao

try: [CODE] <td><textarea name="text" id="text" rows="26" cols="61" ><?php echo preg_replace('#<br\s*/?>#i', "\n", html_entity_decode($edit_servicedesc2));?></textarea>&nbsp;</td> [/CODE]

Member Avatar for mbarandao
0
223
Member Avatar for theG-Scott

try: [CODE] if( isset($_POST['btnSubmit']) ) { //......... foreach ( $_FILES['small_tn_']['name'] as $key=>$value1 ) { $smallImage=$_FILES['small_tn_']['name'][$key]; $largeImage=$_FILES['large_image_']['name'][$key]; $sql_small_tn = sprintf("INSERT INTO `overlay`(`small_tn`,`large_img`) VALUES ('%s','%s')",$smallImage, $largeImage ); $db->query($sql_small_tn); } } [/CODE]

Member Avatar for theG-Scott
0
286
Member Avatar for Aventurine

You are currently have the following (on line 164): [CODE]<input type='hidden' name='unit_price_". $row['pid'] ."' />[/CODE] The js function needs to compute: [iCODE]unit_price_X * qty_X[/iCODE] (where X is whatever value is in [iCODE]$row['pid'][/iCODE]) but you have NOT assigned a value! Since it is a hidden field, the user cannot enter anything …

Member Avatar for Airshow
0
1K
Member Avatar for daneuchar

Instead of: [iCODE]$(this).closest('form').submit()[/iCODE] try: [iCODE]$('#login_form').submit()[/iCODE] AND make sure that there is NO html element with [iCODE]name="submit" [/iCODE](nor [iCODE]id="submit"[/iCODE])

Member Avatar for daneuchar
0
97
Member Avatar for Setvir

you may want to use preg_replace_callback() for this. For the sake of clarity, let's say you have the following TWO (separate/independent) input strings a;b\";\"c;d';'ef\;g a;b\";'\"c;d';'ef\;g what results do you expect? Do you have a sample of an actual/realistic input string?

Member Avatar for Setvir
0
163
Member Avatar for pietpiraat

You need to be more specific about what you are looking for. Assuming that the following dates are free (status==1): 2010-11-02 through 2010-11-10 2010-11-16 through 2010-11-20 and the person plans to stay for 4 days, are you looking for a two element array that states: 2-10 16-20 or ALL the …

Member Avatar for hielo
0
72
Member Avatar for mark2326l

make sure that is no element with name="location" either. As an example, the following would not work as you expect in IE: [CODE]<script type="text/javascript"> window.onload=function(){ document.getElementById('location').innerHTML='hi' }; </script> <input name="location" /> <div id='location'></div> [/CODE] the getElementById() incorrectly returns a reference to the [B]INPUT[/B] instead of the [B]div[/B].

Member Avatar for samaru
0
109
Member Avatar for Xtremefaith

On your first block of code above, this is wrong: [iCODE]<tr id="data">...</tr>[/iCODE] If your query yields three records you will see the same id three times: [CODE] <tr id="data">... <tr id="data">... <tr id="data">...</tr> [/CODE] You are NOT allowed to have an id multiple times. It MUST be unique throughout the …

Member Avatar for hielo
0
4K
Member Avatar for djcrab

In your constructor, [B]make, model and drive[/B] are all wrong. You MUST put apostrophes (or double quotes) around the values because those values are STRING values - ex: WRONG: [iCODE]this.drive = 4X4;[/iCODE] CORRECT: [iCODE]this.drive = '4X4';[/iCODE] So fix the above three statements first. As for lines 19-23, you CANNOT use …

Member Avatar for hielo
0
109
Member Avatar for melodopolis

assuming you have: [CODE]<form id="theForm"...>[/CODE] on your SECOND block of code you posted, in line 6 - instead of: [iCODE]data: ...monstrosity of statements your currently have here...[/iCODE] simply use: [iCODE]data: $('#theForm').serialize()[/iCODE] The serialize() method should be able to determine accurately which of your radio buttons is actually checked. The problem …

Member Avatar for melodopolis
0
224
Member Avatar for aftong

It looks like you are creating a RADIO AND a TEXT field with the SAME name every time. Give them different names. For example, try using this for line 15: [CODE] document.getElementById('segment_form').innerHTML += "<input type='text' name='[COLOR="Red"]txt_[/COLOR]segment_type_"+j+"' size='10' onFocus='check_other()' />"; [/CODE]

Member Avatar for aftong
0
77
Member Avatar for Xtremefaith

the easiest approach would be NOT to use [iCODE]SELECT * ...[/iCODE]. Instead, mention explicitly which fields you want AND make sure the ones you want to hide appear first: [iCODE]SELECT ID, Code, Account Info, Ph#, User, PW, Web, Active[/iCODE] That way if you wanted to "hide" bod [B]ID[/B] and [B]Code[/B], …

Member Avatar for Xtremefaith
0
167
Member Avatar for balle

it should be [iCODE]while ([COLOR="Green"][B]$row[/B][/COLOR] = mysql_fetch_assoc($gar))[/iCODE]

Member Avatar for hielo
0
56
Member Avatar for JenniO

line 11 should be "[B]less than[/B] day.length" NOT "less than or equal to": [iCODE]for (i=0; i [COLOR="Green"][B]<[/B][/COLOR] day.length; i++)[/iCODE]

Member Avatar for hielo
0
82
Member Avatar for mbhanley

what is NOT working on the code you posted? Are you NOT getting any results? Are you getting the ENTIRE table? Are you getting the WRONG id? Have you tried to echo your sql statement to verify what sql command is actually being executed?

Member Avatar for hielo
0
221
Member Avatar for simirnov

The problem is that when you provide an email, then the following IS executed: [CODE] else if ($_POST[email]) { $email = $_POST[email]; if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { $err = 'Email invalid because wrong number of characters!<br />'; } } [/CODE] In other words, it goes INTO the email [b]else if[/b] clause and …

Member Avatar for hielo
0
10K
Member Avatar for mrclark

If I understood correctly, what you need is: [CODE] <a href="images/image1.jpg"><img src="thumb_image1.jpg"></a> <a href="images/image2.jpg"><img src="thumb_image2.jpg"></a> [/CODE]

Member Avatar for mrclark
0
88
Member Avatar for rajesh4u2u
Member Avatar for hielo
0
123
Member Avatar for freiheit

In all three if statements you have the same error - on equal sign instead of two. EX: [iCODE]...&& ($site_type [COLOR="Red"][B]=[/B][/COLOR] "...")[/iCODE] it should be: [iCODE]...&& ($site_type [COLOR="Green"][B]==[/B][/COLOR] "...")[/iCODE]

Member Avatar for hielo
0
178
Member Avatar for fuston05

[CODE=html] <script type="text/javascript"> function setValue(field) { if(''!=field.defaultValue) { if(field.value==field.defaultValue) { field.value=''; } else if(''==field.value) { field.value=field.defaultValue; } } } </script> <input type="text" value="Enter Title" onfocus="setValue(this)" onblur="setValue(this)"/> [/CODE]

Member Avatar for fuston05
0
128
Member Avatar for TechySafi

try: [CODE] $sql="select * from users where twitter_id IN (" . implode(',',$friends) . ") AND status=1"; $result=mysql_query($sql) or die( mysql_error() ); $total=mysql_num_rows( $result ); [/CODE]

Member Avatar for TechySafi
0
137
Member Avatar for alanlee9898

On the SECOND block of code you posted you are initializing [iCODE]$item_id[/iCODE] on line 6. You need to put the FIRST code of block AFTER line 6 of the second code of block.

Member Avatar for hielo
0
140
Member Avatar for ivan3510

[QUOTE]You can change the CSS of image opacity and border style, but you cannot change the image's background color using CSS[/QUOTE] You can if you have the right type of image. What you need is to use images with TRASPARENT backgrounds. [CODE=html] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML …

Member Avatar for hielo
0
119
Member Avatar for andrewliu

are you trying to execute the sql statement from WITHIN a function in main.php? If so, in your function you need to declare $new_id: [CODE] function(){ global $new_id; ... mysql_query('INSERT INTO comments (id) VALUES ($new_id)'); } [/CODE]

Member Avatar for hielo
0
312
Member Avatar for killbill07

Try: [CODE=php] $f=scandir('/Images/'); foreach($f as $p) { echo '<img src="/Images/'.$p.'" />'; }[/CODE]

Member Avatar for monica singh
0
158
Member Avatar for ivan3510

[QUOTE]But what if the user write it with inversion?[/QUOTE] You would need to write ANOTHER expression that would try to do a match based on the reverse order. Basically execute back-to-back replace() operations: [CODE] function tables(str){ var t={}; t["<table border='$2' width='$4'>"]=/\[table(:|\s+)border=(.+?)(\s+|;)width=(.+?)\]/ig; t["<table width='$2' border='$4'>"]=/\[table(:|\s+)width=(.+?)(\s+|;)border=(.+?)\]/ig; t["<table border='$2'>"]=/\[table(:|\s+)border=(.+?)\]/ig; t["<table width='$2'>"]=/\[table(:|\s+)width=(.+?)\]/ig; t["<table>"]=/\[table\]/ig; for( …

Member Avatar for ivan3510
0
87
Member Avatar for JayGeePee

lines 15 and 16 should be: [CODE] $user = mysql_real_escape_string($_POST['username']); $pass = mysql_real_escape_string($_POST['password']); [/CODE] As for your ACTUAL problem, the reason for the error is that you are putting APOSTROPHES around the table and field names. That is wrong. You need backticks (On a standard English keyboard, it is on …

Member Avatar for smantscheff
0
197
Member Avatar for vivi288

try parenthesizing your selects: [CODE] ... else { $query .= "(select * from `table1` WHERE `year`='$cat') union (select * from `table2` where `year`='$cat') order by `year` desc "; } ... [/CODE] As for the second part of your question, you could put a dropdown with the list of available categories …

Member Avatar for vivi288
0
142
Member Avatar for kesh1000

Do NOT give an element a name and/or id that is the same as a javascript function. This would result in a name collision. Rename your function to Calculate (upper case "C") and update the onclick attribute on line 111. Also, in checkplan() it looks like this: [iCODE]var but = …

Member Avatar for kesh1000
0
90
Member Avatar for avocado_juice

Based on what you posted, it looks like what you are actually doing is: a. send some HTML markup by including admin_homepage.php'(probably the <html><head>...</head><body>...) b. query the db c. download excel file The problem is that if you are going to force a download, you cannot send any HTML markup …

Member Avatar for avocado_juice
0
840
Member Avatar for TLCJohn

REMOVE those "invalid" definitions from your initial CSS file. Instead, add them dynamically through javascript (by importing a "supplemental.css" file - [url]http://www.hunlock.com/blogs/Howto_Dynamically_Insert_Javascript_And_CSS[/url]). The validator will not execute javascript so it should validate only the "good" css.

Member Avatar for diafol
0
118
Member Avatar for caitlins5

try changing: [iCODE] if($("#Rep_Email_Address1").length > 0){[/iCODE] to: [iCODE] if($("#Rep_Email_Address1")[COLOR="Green"][B].val()[/B][/COLOR].length > 0){[/iCODE] if the problem persist, go the addOns page for Firefox and look for Firebug. Install it, restart Firefox and go back to your page. Then specify on which line the error is happening.

Member Avatar for ArtistScope
0
202
Member Avatar for ivan3510

try: [CODE] function links(str){ return str.replace(/\[link\s*=\s*(['"])?(.*?)\1\s*\](.+?)\[\/link\]/ig,'<a href="$2">$3</a>').replace(/\[link\](.+?)\[\/link\]/ig,'<a href="$1">$1</a>'); } [/CODE]

Member Avatar for ivan3510
0
149
Member Avatar for Ritzlore

Try the following: [CODE] <?php if(isset($_POST['email'])) { // recipient and subject $email_to = "gathering@sixcrows.org"; $email_subject = "OJAJA Talent Shindig Registration"; function died($error) { // error code here echo "Sorry, some of the required information is missing. "; echo "Note the red asterists for required fields.<br /><br />"; echo $error."<br /><br …

Member Avatar for hielo
0
449
Member Avatar for sha11e

[QUOTE]preg_match() returns the number of times pattern matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match... [url]http://php.net/manual/en/function.preg-match.php[/url] [/QUOTE] try simply [iCODE]if($fname_match)[/iCODE] Or if you want to be more "clear": [iCODE]if($fname_match > 0)[/iCODE]

Member Avatar for hielo
0
107
Member Avatar for tobeye

On line 12 you have [iCODE]$q = $db->exec($checkUsername);[/iCODE]. That tells me that you have a custom class (you are possibly executing something like [iCODE]$db=new MDB2(....);[/iCODE] somewhere) that has its own execute method (named exec). Within that method try putting/attaching [iCODE] or die( pg_last_error($conn) )[/iCODE] (refer to [url]http://www.php.net/manual/en/function.pg-last-error.php[/url]) to your actual …

Member Avatar for hielo
0
337
Member Avatar for Craig2231

IF you run the code you posted and look at the browser's source code (CTRL+U in Firefox an Chrome; View -> Source in IE) you should be seeing: [CODE] <FORM action='delrec.php?id='. mysql_insert_id() .'' method='post' <table...> [/CODE] There are a few issues with this: a. The [iCODE][B]FORM[/B][/iCODE] tag is NOT closed! …

Member Avatar for hielo
0
120
Member Avatar for philmetz

the problem is due to a missing apostrophe after [iCODE]$name[/iCODE]: [iCODE](NULL, '$name[COLOR="Red"][B]'[/B][/COLOR], '$username', '2010-10-23', '$password')[/iCODE] But I suggest you try the following: [CODE]<html> <head> <title>Using Default Checkbox Values</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript" > $(function() { $(".submit").click(function() { var name = encodeURIComponent($.trim($("#name").val())); var username = encodeURIComponent($.trim($("#username").val())); var password = encodeURIComponent($.trim($("#password").val())); …

Member Avatar for hielo
0
134
Member Avatar for Danny247

[iCODE]$users[$uid]['userName'] = [COLOR="Red"]'[/COLOR]$username[COLOR="Red"]'[/COLOR];[/iCODE] should be: [iCODE]$users[$uid]['userName'] = $username;[/iCODE] No apostrophes around [iCODE]$username[/iCODE]. Other than that, make sure that the AJAX_CHAT_XXX CONSTANTS you are using are defined.

Member Avatar for Danny247
0
183
Member Avatar for changeco

On your INITIAL post, try: [CODE]$sql = "SELECT CDID, COUNT(*) AS total FROM rtnUser GROUP BY CDID"; [/CODE]

Member Avatar for changeco
0
165
Member Avatar for jrhitokiri

do your includes do includes as well? Read the following comment: [url]http://www.php.net/manual/en/function.dirname.php#91208[/url]

Member Avatar for jrhitokiri
0
3K
Member Avatar for persianprez

are you saying that you want to "read" the "X" from the url and make it into a JS variable?

Member Avatar for persianprez
0
343

The End.