627 Posted Topics

Member Avatar for sha1023012

A. at the end of line 17 you have [iCODE]horizontal[fishPos[fishNumber] [/iCODE]. That's a syntax error. You are missing a closing bracket after [iCODE]fishNumber[/iCODE]. B. On line 24 you have [iCODE]setInterval(fish1Swim, 100);[/iCODE], but there is no such thing as [iCODE]function fish1Swin(){...}[/iCODE] declared anywhere, so I don't see how you can claim …

Member Avatar for aquariums
0
219
Member Avatar for foysal2012

try: [CODE=html] <!-- make sure you put the [] at the end of the name --> <input name="searchterm[]" /> <input name="searchterm[]" /> <input name="searchterm[]" /> [/CODE] then try: [CODE=php] <?php //connect to the db first $conn=mysql_connect('...', '...', '...') or die(mysql_error()); mysql_select_db('...') or die(mysql_error()); foreach($_POST['searchterm'] as $i=>$v) { if(preg_match('#\w#',$v)) { $_POST['searchterm'][$i]=mysql_real_escape_string($v); …

Member Avatar for foysal2012
0
148
Member Avatar for Q8iEnG

Load the page in your browser. Then view the source code. Within the source code look for: #D50512 That is the "red" color that you are seeing.

Member Avatar for Q8iEnG
0
267
Member Avatar for learner guy

If the XML file you are retrieving has invalid markup, then on line 20 [iCODE]xmlDoc[/iCODE] will be set to null. If that is the case, then [iCODE]xmlDoc.getElementsByTagName()[/iCODE] will give you the error you are describing. So, you need to make sure that the responseXML is not null. On your XML …

Member Avatar for Troy III
0
1K
Member Avatar for raul8

before you begin the delay, try "capturing/recording" a reference to "[iCODE]this[/iCODE]" in some variable so that your delayed function actually knows what "[iCODE]this[/iCODE]" means: [CODE=javascript] $(".tabButton").click(function() { var self=this; $(self).css("background-color", "white").delay(500, function() { $(self).css("background-color", "black"); }) }); </script> [/CODE]

Member Avatar for ckchaudhary
0
356
Member Avatar for chicnstu012

try: [CODE=php] $result = mysql_query("SELECT * FROM comments") or die(mysql_error()); while( $row = mysql_fetch_assoc($result) ) { echo $row['alias'], ': ', $row['comment'], '<br />', PHP_EOL; } [/CODE]

Member Avatar for diafol
0
100
Member Avatar for gilgil2

`<input name="name"... />` should be `name="username"... />`. You your comment: `// Set cookie / Start Session / Start Download etc...` is inaccurate. You need to start the session BEFORE you even begin sending any output. That means that you cannot start the session after you have send `<html>...` Try the …

Member Avatar for Stefano Mtangoo
0
222
Member Avatar for Nathaniel10

Check your file case. In other words, if your folder/file is named Style (uppercase "S"), make sure you are not using `< (...) href="../style/style.css">` (lowercase "S")

Member Avatar for Nathaniel10
0
226
Member Avatar for gilgil2

try: [CODE=php] <?php session_start(); $redirectTo='http://yoursite.com/page.php'; $DEBUG=true; $SELF=basename(__FILE__); $err=''; $match=0; if(isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) { $link = mysql_connect('localhost', 'username', 'password') or die('Could not connect: ' . mysql_error()); mysql_select_db('database') or die(mysql_error()); $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $sql="SELECT `active` FROM `users` WHERE `username`='".$username."' AND `password`='".$password."'"; $search = mysql_query($sql) or …

Member Avatar for Stefano Mtangoo
0
193
Member Avatar for phoenixfire2

try: [CODE] <?php $datearray=explode('-','1980-09-28'); $days=str_replace('>'.$datearray[2],' selected="selected">'.$datearray[2],preg_replace('#option>(\d+)#','option value="$1">$1','<option>'.implode('</option><option>',range(1,31)).'</option>')); echo '<select name="day">'.$days.'</select>'; ?> [/CODE]

Member Avatar for phoenixfire2
0
436
Member Avatar for geneh23

try: [CODE=php] <?php session_start(); error_reporting (E_ALL ); //connect to db $connect = mysql_connect("*******","*****","*******") or die( mysql_error() ); mysql_select_db("******") or die( mysql_error() ); $get = mysql_query("SELECT * FROM `users` WHERE `username`='".$_SESSION['username']."'") or die(mysql_error()); while($row = mysql_fetch_array($get)) { $admin = $row['user_level']; if ($admin == 0) { header("Location: index.php"); exit; } elseif ($admin …

Member Avatar for geneh23
0
218
Member Avatar for manc1976

try changing: [CODE]<input type="button" value="SAVE" onclick="submit();" />[/CODE] to: [CODE]<input type="submit" value="SAVE" />[/CODE]

Member Avatar for Troy III
0
103
Member Avatar for ferrari77

try: [CODE=php] <?php header('Content-Type: application/json'); $a = array('data' => 'Hello'); echo json_encode($a); exit; ?> [/CODE]

Member Avatar for Airshow
0
133
Member Avatar for labise

Do you actually see the message "Your password has been changed..."? If yes, then try adding a "To" header as well: [CODE] ... if (mysqli_affected_rows($dbc) == 1) { // If it ran OK. $headers=""; $headers.="From: northherner@hotmail.com".PHP_EOL; $headers.="To: ".$_POST['email'].PHP_EOL; // Send an email: $body = "Your password to log into <whatever …

Member Avatar for labise
0
378
Member Avatar for sirlink99

That error typically indicates that your query did NOT succeed. To find out what was any error, change `$sql = mysql_query ("SELECT * FROM 'Product'");` to `$sql = mysql_query ("SELECT * FROM 'Product'") or die(mysql_error());` On the code you posted, the query is wrong. It should be `Product` (using backticks …

Member Avatar for sirlink99
0
98
Member Avatar for tqmd1

try: [CODE=javascript] function checkpostal(){ var re=/^[a-zA-Z]+$/; var result=re.test(myform.myinput.value); if( result ) { alert("Good") }else{ alert("Bad") } return result; } [/CODE]

Member Avatar for hielo
0
170
Member Avatar for drsmith

When an AJAX request is complete, the connection between the script and the server is closed. The communication dynamics is just like that between the browser and the server. Once the connection is closed, the server does not know who just asked for whatever resource, so it cannot notify any …

Member Avatar for twoclicks
0
530
Member Avatar for maria_megha

[CODE] <script> var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec']; function populatedropdown(dayfield, monthfield, yearfield){ var today=new Date() var dayfield=document.getElementById(dayfield); var monthfield=document.getElementById(monthfield); var yearfield=document.getElementById(yearfield); for (var i=0; i<31; i++) dayfield.options[i]=new Option(i+1, i+1) dayfield.options[today.getDate()-1].selected=true; for (var m=0; m<12; m++) monthfield.options[m]=new Option(monthtext[m], monthtext[m]) monthfield.options[today.getMonth()].selected=true; var thisyear=today.getFullYear() for (var y=0; y<20; y++){ yearfield.options[y]=new Option(thisyear, thisyear) thisyear+=1 } yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), …

Member Avatar for hielo
0
2K
Member Avatar for CaffeineCoder

Read comments in code: [CODE=vbscript] Dim strSQL Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") objConn.ConnectionString = "Provider={SQL Server};Server=server;Database=db;User ID=id;Pwd=pw" strSQL = "SELECT * FROM table" 'open connection first objConn.open 'execute the sql on the Recordset object objRS.Open strSQL, objConn, 1,3 If Not objRS.EOF Then 'iterate through records here Else …

Member Avatar for CaffeineCoder
0
4K
Member Avatar for vaanipala

I think you meant [iCODE]nextSibling()[/iCODE], not [iCODE]next_sibling()[/iCODE]: [url]http://www.php.net/manual/en/class.domnode.php[/url]

Member Avatar for hielo
0
155
Member Avatar for niche1

[CODE] //connect to db first ... $expdat='July 20, 2012'; $theValue='<span style="background-color:yellow">Expires ' . $expdat . '. </span>'; //escape the value you are about to insert into the table: $theValue = mysql_real_escape_string($theValue); //provide the correct name for your table and your field mysql_query( "INSERT INTO `tableName`(`fieldName`) VALUES('" . $theValue . "')" …

Member Avatar for hielo
0
201
Member Avatar for kira_

try: [CODE] $sql = mysql_query("UPDATE joke SET joketext='$text' WHERE id='$id'") or die( mysql_error() ); [/CODE] notice the apostrophes around the value of [iCODE]$id[/iCODE]

Member Avatar for faroukmuhammad
0
195
Member Avatar for bibiki

[CODE=xsl] ... <a href="http://{target}"><xsl:value-of select="name" /></a><br /> ... [/CODE]

Member Avatar for bibiki
0
145
Member Avatar for MDanz

if you are going to use [iCODE]mysql_real_escape_string()[/iCODE], then [iCODE]stripslahses()[/iCODE] first since magic_quotes are enabled - ex: [CODE]$search = "q test'yes"; $search = mysql_real_escape_string( stripslashes($search) ); mysql_query("SELECT * FROM block WHERE name LIKE '%$search%' ORDER BY `id` DESC",$this->connect);[/CODE]

Member Avatar for urtrivedi
0
2K
Member Avatar for Chimunda

>>I was able to do some of this Using what exactly VBSCRIPT, PHP, XSL? Post what you have thus far.

Member Avatar for hielo
0
185
Member Avatar for itisnot_me
Member Avatar for tstory28

if [iCODE]$email[/iCODE] equals 'joe@gmail.com' and [iCODE]$level[/iCODE] equals 1, Then if you are TRYING to set: [iCODE]$_SESSION['joe@gmail.com.1']='...'[/iCODE], then the above will not work. You need to use DOUBLE quotes so that the variables are evaluated: [iCODE]$_SESSION["$email.$level"][/iCODE] Perhaps what you are after is something like: [CODE] $_SESSION['email_level']=$email.PHP_EOL.$level; Then later on if you …

Member Avatar for hielo
0
100
Member Avatar for rayidi

[QUOTE]toggle(this)[/QUOTE] [B]this[/B] [U]IS[/U] the [B]<a>[/B] tag so you do NOT need: var ele = document.getElementById(int); all you need is: [CODE] <script language="javascript"> //function toggle(int) { //var ele = document.getElementById(int); function toggle(ele){ if(ele.style.display == "block") { ele.style.display = "inline"; } else { ele.style.display = "block"; text.innerHTML = "hide"; } } </script> …

Member Avatar for ko ko
0
2K
Member Avatar for souravsikka

provid the protocol in the url as well: [iCODE]$url="[B]http://[/B]abksms.com...";[/iCODE]

Member Avatar for hielo
0
1K
Member Avatar for scarcella

are you having trouble sending/submitting all the fields? If so, try: [CODE] $('#contactform').submit(function(){ var action = $(this).attr('action'); $("#message").slideUp(750,function() { $('#message').hide(); // http://api.jquery.com/serialize/ $.post(action, $('#contactform').serialize(), function(data){ document.getElementById('message').innerHTML = data; $('#message').slideDown('slow'); $('#contactform img.loader').fadeOut('fast',function(){$(this).remove()}); if(data.match('success') != null) $('#contactform').slideUp('slow'); } ); }); return false; }); [/CODE]

Member Avatar for scarcella
0
175
Member Avatar for MavrickIT

change: [iCODE]$mark = mysql_query("select * from product order by product_id DESC");[/iCODE] to: [iCODE]$mark = mysql_query("select * from product order by product_id DESC") or die( mysql_error() );[/iCODE] It should tell you WHY the query is failing.

Member Avatar for ko ko
0
195
Member Avatar for abhi10kumar

well, I see three function calls bolded, but what you need to do is call just ONE function and from that function you do your first ajax call. On that first ajax call, you should have a callback function - the function that executes upon completion of the ajax request. …

Member Avatar for diafol
0
558
Member Avatar for mrhankey

[CODE=sql] Part id autonumber name varchar Supplier id autonumber name varchar SupplierPart Supplier_id int Part_id int quantity int [/CODE]

Member Avatar for hielo
0
64
Member Avatar for slrobinson1983

[CODE] function toSeconds(str){ str=str.split(':'); switch( str.length ) { case 2: return str[0]*60 + str[1]*1; case 3: return str[0]*3600 + str[1]*60 + str[2]*1; } } alert( toSeconds("2:15") ) [/CODE]

Member Avatar for slrobinson1983
0
297
Member Avatar for extemer

[CODE] $sql=mysql_query("SELECT * FROM `expense` WHERE `date` BETWEEN '2011-04-26' AND '2011-04-28'") or die(mysql_error()); $r=mysql_fetch_assoc($sql); //SELECT * ... assuming that the * includes some field named `id`, then the following //will print it's contents: echo $r['id']; //if you want to see everything at once, use: print_r($r); [/CODE]

Member Avatar for jonnysmiths
0
139
Member Avatar for MrCapuchino

Point the link to the XML file (not the XSL). The top of the XML should look SIMILAR to the following (you need to provide the correct path to your file): [iCODE]<?xml version="1.0" encoding="ISO-8859-1"?>[/iCODE] [iCODE][COLOR="Red"]<?xml-stylesheet type="text/xsl" href="[COLOR="Green"]Catalog.xsl[/COLOR]"?>[/COLOR][/iCODE] Also, at the top of the [B]XSL[/B] file make sure you declare the …

Member Avatar for MrCapuchino
0
152
Member Avatar for jacob21

assuming the field you inserted the data into is named info, then instead of something like: [iCODE]echo $row['info'];[/iCODE] try: [iCODE]echo '<div style="white-space:pre">' . htmlentities($row['info'],ENT_QUOTES) . '</div>';[/iCODE] OR: [iCODE]echo '<pre>' . htmlentities($row['info'],ENT_QUOTES) . '</pre>';[/iCODE]

Member Avatar for jacob21
0
154
Member Avatar for jdavenport

since you seem to be passing very minimal data, try setting some cookies instead of passing the data via url. Then on the server retrieve the data from the cookies. In "The Scripts" section of [url]http://www.quirksmode.org/js/cookies.html[/url] you will find three very useful functions. Save them as cookies.js and import them …

Member Avatar for Airshow
0
6K
Member Avatar for samalpramod

try creating a different http object for each request. If you are still having problems, post your code.

Member Avatar for hielo
0
146
Member Avatar for turt2live

[quote]...i would like it to return a result whether only a name was found, just an owner, or both.[/quote] You don't need to AND. The OR should give you what you want even when both are true: [code=php] $sql="SELECT `name`, `owner` FROM Table WHERE `name` LIKE '$%term%' OR `owner` LIKE …

Member Avatar for hielo
0
118
Member Avatar for jpadgett

on line 29 of first block and line 39 of second block you have: [iCODE]$result=mysql_[COLOR="Red"]db_[/COLOR]query([COLOR="Red"]errorfile[/COLOR],"$SQL");[/iCODE] a. [iCODE]mysql_db_query()[/iCODE] is deprecated. Use [iCODE]mysql_query()[/iCODE] instead. b. Regarding the first argument to the function did you mean [iCODE][COLOR="Red"]$[/COLOR]errorfile[/iCODE]? c. Also, (assuming you "insist" on sticking with [iCODE]mysql_db_query()[/iCODE]) you connect to the db, but you …

Member Avatar for MariahGwen
0
155
Member Avatar for veledrom

try: [CODE]content.value = content.value.substring(0,content.selectionStart) + url + content.value.substring(content.selectionEnd);[/CODE]

Member Avatar for veledrom
0
95
Member Avatar for Stefano Mtangoo

On another note, [CODE]...if($stmt==-1) {...[/CODE] when will that be true? prepare() and execute() methods return [iCODE]FALSE[/iCODE] upon failure. If you are relying on FALSE to be defined as -1, that may not be a good idea. I suggest you consider revising that statement. Regards, Hielo

Member Avatar for hielo
0
148
Member Avatar for jayreis

Have you tried using [iCODE]REQUEST_URI[/iCODE] instead of [iCODE]REQUEST_FILENAME[/iCODE]? Try: [CODE]RewriteEngine On RewriteBase /~jn/ RewriteCond %{REQUEST_URI} !-d RewriteCond %{REQUEST_URI} !-f RewriteRule ^([^\.]+)/?$ /~jn/$1.php [NC,L][/CODE]

Member Avatar for hielo
0
130
Member Avatar for bobgodwin

When you pass the data to a script via a URL - ex: [iCODE]<a href="?act=view&title=".$row['title'].""\">".$row['title']."</a> [/iCODE] OR via a <FORM> set to get - ex: [iCODE]<form method="get"...>[/iCODE] then on the server you should make use of [iCODE]$_GET['variableName'][/iCODE] to extract the data you want/need. To clarify, given the URL you posted …

Member Avatar for hielo
0
145
Member Avatar for jfunchio

executing [iCODE]DELETE FROM `customer`;[/iCODE] will remove all the records from the table, but it will NOT reset the auto-increment counter. Imagine that you start with [iCODE]customer=(1, 'Bob', 'Smith', '330-678-2732', 'Smith22@live.com')[/iCODE] (where 1 is the [iCODE]customer_id[/iCODE]) and this customer exists in the rental table. If you delete all the records from …

Member Avatar for hielo
0
350
Member Avatar for sunny124

[QUOTE]detached_fields += $(this).remove();[/QUOTE] that's your problem. You can concatenate STRINGS, but NOT objects. [iCODE]remove()[/iCODE] returns an object. Since you are issuing a concatenation operator, javascript calls its [iCODE]toString()[/iCODE] method which simply returns a string whose value is [iCODE][object Object][/iCODE]. What you need is the ACTUAL objects. Make detached_fields an array, …

Member Avatar for sunny124
0
120
Member Avatar for tcollins412

[url]http://www.php.net/manual/en/functions.variable-functions.php[/url] [CODE] $goto=$_GET['goto']; $sections= array('fail','success'); if(in_array($goto,$sections)) { $goto(); } [/CODE]

Member Avatar for Killer.bee
0
126
Member Avatar for flynismo

[QUOTE]But if the item contains more than one word, or special characters, like a single quote, the delete does not work...[/QUOTE] Most likely you have: [iCODE]<input type=checkbox value=White Bread >[/iCODE] instead of: [iCODE]<input type=[B][COLOR="Red"]"[/COLOR][/B]checkbox[B][COLOR="Red"]"[/COLOR][/B] value=[B][COLOR="Red"]"[/COLOR][/B]White Bread[B][COLOR="Red"]"[/COLOR][/B] >[/iCODE] You need to quote the values of the attributes - particularly, the [B]VALUE[/B] …

Member Avatar for hielo
0
154
Member Avatar for jonsan32

When "importing" javascript, never use the "short" syntax: [iCODE]<script src="..." type="text/javascript" [COLOR="Red"]/>[/COLOR][/iCODE] Use the "long" syntax: [iCODE]<script src="..." type="text/javascript"[B][COLOR="Green"]></script>[/COLOR][/B][/iCODE] some browsers "choke" if you use the "short" syntax. Having said that, on the FIRST block of code, fix line 1 so that it uses the "long" syntax. On the SECOND …

Member Avatar for jonsan32
0
186

The End.