No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi all, I have the following code:[CODE]$Connection = mysql_connect("127.0.0.1", "user", "pass") or die(mysql_error()); $Database = mysql_select_db('db', $Connection) or die(mysql_error()); $Url = mysql_real_escape_string("exampleurlwithonlycharacters"); $Query = "SELECT `col` FROM `table` WHERE `url` = '$Url';"; $Resource = mysql_query($Query, $Connection) or die(mysql_error()); $Result = mysql_fetch_object($Resource); var_dump($Result);[/CODE]and was expecting to see the Col => 1 … |
|
I've been following a few tutorials to create Makefiles and came across one at [URL="http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/"]http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/[/URL] which I managed to get working across some simple functions and programs:[CODE]IDIR = include CC=g++ CFLAGS=-I$(IDIR) ODIR=obj _DEPS = hellomake.hpp DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS)) _OBJ = hellomake.o hellofunc.o OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) $(ODIR)/%.o: %.cpp $(DEPS) … |
|
I am working through Accelerated C++ and am on exercise 3-5. The question is:[QUOTE]Write a program that will keep track of grades for several students at once. The program could keep two vectors in sync: The first should hold the student's names, and the second the final grades that can … |
|
I've been trying to learn C++ for about a year now and came across [URL="http://openbookproject.net/thinkcs/cpp/english/chap04.htm"]this excellent tutorial[/URL]. I can't leave anything alone so I changed some single quotes to double quotes and have the following code:[CODE=C++]#include <iostream> void printTwice(char phil) { std::cout << phil << phil << std::endl; } int … |
|
I have the following script saved as 'index.php':[CODE=php]<?php $implementation = new DOMImplementation(); $doctype = $implementation->createDocumentType('html'); $document = $implementation->createDocument('http://www.w3.org/1999/xhtml', 'html', $doctype); $head = $document->createElement('head'); $document->documentElement->appendChild($head); echo $document->saveXML();[/CODE]Now when I run the script, I get nothing at all (i.e. no source XML is being received by the browser). Error reporting is set … |
|
I have the following code:[CODE=php]<?php $implementation = new DOMImplementation(); $document = $implementation->createDocument('http://www.w3.org/1999/xhtml', 'html', $implementation->createDocumentType('html')); echo $document->saveHTML(); ?>[/CODE]which returns:[CODE=html]<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"></html> [/CODE]...exactly as I wanted it to. However, when I run the following: [CODE=php]<?php $implementation = new DOMImplementation(); $document = $implementation->createDocument('http://www.w3.org/1999/xhtml', 'html', $implementation->createDocumentType('html')); $head = $document->createElement('head'); $document->appendChild($head); echo $document->saveHTML(); ?>[/CODE]I … |
|
Re:
Is it possible to name a cookie in javascript? i've got a web program that will display "name:undefined Name:Jack Grade:32" whenever i display the contents of a cookie i create. i'm assuming th first bit is the cookie name itself and then the other two bits are the contents? also, … |
|
In order to make sure my site works for a user I need to check that both JSON and XMLHttpRequest() are defined as objects by their browser. Rather than if/else I thought I'd use the ternary operator:[CODE=javascript]condition ? true : false.[/CODE] I tried the following and it doesn't work correctly. … |
|
Hi all, I am trying to get an object to be aware of its own changes e.g. have it execute one of its functions but only when a variable has been changed from outside the object. Google gave me lots of references to XMLHttpRequest.onreadystatechange and this resource at MSDN: [URL="http://msdn.microsoft.com/en-us/library/ms536957%28VS.85%29.aspx"]http://msdn.microsoft.com/en-us/library/ms536957%28VS.85%29.aspx[/URL]. … |
|
Hi all. I have the following form: [CODE=html]<form id="registrationForm"> <input id="forename" type="text"></input> <input id="surname" type="text"></input> <input id="emailAddress" type="text"></input> <input id="password" type="password"></input> <input id="confirmPassword" type="password"></input> <input id="agreeToTerms" type="checkbox"></input> <input id="clickToRegister" type="button" onClick="javascript:SpeakAtServer(FormToJson('registrationForm'))" value="Register"></input> </form>[/CODE] ...with the following JavaScript... [CODE=javascript]FormToJson = function(sourceElement) { var JsonToServer = new Object(); if (document.getElementById(sourceElement).childNodes) { var … |
|
I have the following in "home.html": [CODE=html]<html> <head> <script type="text/javascript" src="sandbox.js"></script> </head> <body onload="compatibilityCheck();"> <div id="content"> <p>You need to enable JavaScript to use this site</p> </div> .....[/CODE] where "sandbox.js" is: [CODE=javascript]function compatibilityCheck() { var compatibilityCheck = new compatibilityCheck; compatibilityCheck.browser; compatibilityCheck.cookies; } var compatibilityCheck { browser : function() { switch(navigator.appName) { … |
|
Re:
OK! This will probably reveal my IQ , but here goes. I am new to PHP and MySQL--I am learning from a ton of books--and I am struggling with many-to-many relationships. All of the books make a lot of assumptions. I get the concept just not the mechanics. Say I … |