currentlevel is always 1 in changelevel(), the if(currentlevel == 1 &&
code must not be executing. ;)
peter_budo commented: Bumppp, mind your's manners -1
ShawnCplus commented: Don't be so impatient -1
currentlevel is always 1 in changelevel(), the if(currentlevel == 1 &&
code must not be executing. ;)
if you mean CAPTCHAs, it's done by PHP not Javascript.
and you can't set php variables from within JS. your code sets $impt to 'Y'.
yeah, 'vall' isn't a constant - you need to change it to $vall and declare it before.
bumppp
oh screw it you guys suck
I mean your idea of automatically logging in to a website from a web page on click of a link is insecure. Google would not notice that as being an insecurity. It will find the page and list it.
You can't have a "hidden" page on your website that only you can access. Google will find and index all pages on your web space. I put one in, just to keep from using my Yahoo download bandwidth when I start browsing (instead of loading my full homepage). Nothing links to it except the homepage setting in my Firefox. Yet, I found it on Google while looking for something else.
Wrong. :P
You can use a robots.txt file to tell search engines not to index it, or you can put HTTP encryption on it.
file:///C:/AdminFiles.xml
your problem is you're pointing to a Linux location in a Windows environment.
Install curl (if not installed), change the path to point to it, or check if curl is bundled with the PHP install.
err, I dunno if this is the problem, but you don't have any semi-colons terminating ANYTHING?
also, you might want to use css for the onmouseover
Okay, so I'm parsing the map file, looping through the nodes, and adding an image based on the XML file:
for(var i=0;i<map_node.childNodes.length;i++) {
var node = map_node.childNodes[i];
if(typeof node.tagName == "undefined") continue;
if(node.tagName == "tile") {
var tile = document.createElement("IMG");
tile.src = "tiles/" + node.getAttribute("type");
tile.setAttribute("width", "32");
tile.setAttribute("height", "32");
tile.className = "brick";
map.appendChild(tile);
}
if(node.tagName == "br") map.appendChild(document.createElement("BR"));
}
}
"map" is blanked, then that code executes & adds those images.
I still see no reason for it to break.
Why would you create multiple instances of the same image with DOM manipulation instead of just setting the background image on the div with css which will automatically tile the image?
because it's an XML map, it can have different images. ;)
come on, someone has to know
way to not deliver. you fail.
Hello.
I'm using JS/DOM to create a map in a <div>, named map, like this:
var tile = document.createElement("IMG");
tile.src = "tiles/" + node.getAttribute("type");
tile.setAttribute("width", "32");
tile.setAttribute("height", "32");
tile.className = "brick";
map.appendChild(tile);
It works, but the image breaks on a <br/>
(screenshot: http://i28.tinypic.com/6ynu3o.png)
the image is a 32x32 tile of grass.
It shouldn't have those breaks.
I've tried
map.innerHTML = "<img src=\"tiles/grass.gif\" width=\"32\" height=\"32\" class=\"brick\">";
also, same thing.
Any ideas?
I'm using MySQLdb.
Alright, I'm doing
import MySQLdb as mysql
db = mysql.connect("localhost", "root", "password", "database")
cu = db.cursor()
rows = cu.execute("INSERT INTO users (user, pass) VALUES ('test', 'test')")
print "rows affected:", rows
cu.close();db.close()
Well, what happens is, it gets executed and prints "rows affected: 1" BUT when I check in my MySQL console no rows are there.
What's the problem? My SQL query is fine, and it works when I do it on the MySQL command line.
EDIT: okay, it works if I add a
db.commit()
. -.-
How can I make it auto-commit? I don't feel like doing that after every query, and my app is always using the same cursor for a long period of time
For an SQL query, use something like
$var = mysql_real_escape_string(htmlspecialchars($_GET['param']));
mysql_query($var);
I dunno, that's what I use. Let a real expert tell you. :P
use mysql_error()...
oh, and you named your vars wrong.... ;)
see if it works now
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpassword = "spewguts";
$dbdatabase = "productsdb";
$db = mysql_connect($dbhost, $dbuser, $dbpassword) or die("Error: ".mysql_error());
mysql_select_db($dbdatabase, $db);
$sql = "SELECT * FROM products";
$result = mysql_query($sql) or die("Error: ".mysql_error());
while ($row = mysql_fetch_assoc($result)) {
echo $row['product'];
}
?>
Why can't you do it? You gotta post the problem.
OS? Web server?
If it doesn't work, you're not doing it right. Learn basic PHP skills before you post.
@ryan_vietnow: you might want to simplify that; the function returns what is_numeric does on it's own.
Just do something like
$x = $_GET['foo']; echo is_numeric($x);
@lydia21: you posted this same thread 3+ times...
Here's some code that worked for me.
from Tkinter import *
root=Tk()
class Calculator(Frame):
def __init__(self, master=root):
Frame.__init__(self, master)
self.grid()
self.master.title("CalculatorGUI")
self.f = Frame(master=self)
self.f.pack()
self.g = Frame(master=self)
self.g.pack()
self.display = StringVar()
self.ent=Entry(master=self.f, textvariable=self.display)
self.ent.grid(row=1, column=1)
btn_list = [
'7', '8', '9', '*', 'C',
'4', '5', '6', '/', 'M->',
'1', '2', '3', '-', '->M',
'0', '.', '=', '+', 'neg'
]
r = 2
c = 0
for b in btn_list:
rel = 'ridge'
cmd = lambda x=b: self.click(x)
Button(self.g,text=b,width=5,relief=rel,command=cmd).grid(row=r,column=c)
print "Added button '",b,"' w/ grid",r,c
c += 1
if c > 4:
c = 0
r += 1
print "Done adding buttons"
def click(self, x):
if x == "=":
self.display.set(eval(self.display.get()))
elif x == "C":
self.display.set("")
else:
self.ent.insert(END, x)
Calculator().mainloop()
From what I read, he's probably looking for something like http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
Instead of "self.ent.get()=solution"
are ya wanting to do
self.ent.set(solution)
?
Happy coding.
Actually a few days ago i got bored and thought since they block anything fun at school I would make a chat program to talk with friends. It uses php, mysql database, and a little ajax. Its very simple to do in fact.
I've done that, too.
I'd like to rewrite one with better AJAX, but I can't write a script to cache everything. Plus, takes too much bandwidth SELECTing every [last] messages from the database. :/
I can do the AJAX & JS, but the PHP... well, it'd be hard to specify each position for each pose for every item....
If you could make the actual PHP class/script that generates the avatar from art (item placements, etc.) then I could do the rest.
I was thinking about making an avatar system (like Gaia Online; I've tried befor but it's hard).
Can anybody help me with one? I'm gonna make an open source site like Gaia... I can't do it by myself, though.
Try it like this,
<h2>View my GuestBook!!</h2>
<?php
require_once("dbconnect.php");
$exe=mysql_query("select * from guestbook")
or die("SQL Error: ".mysql_error());
while ($r=mysql_fetch_array($exe))
{
echo "<b>Name: {$r['name']}<br>\nLocation: {$r['location']}<br>\nEmail: {$r['email']}<br>\nURL: {$r['url']}<br>\nComments: {$r['comments']}<br>\n</b>";
}
?>
If that doesn't work, open up a MySQL console and do
use guestbook;
select * from guestbook;
If there is messed up HTML, then theres your problem.
For Windows, I recommend Dev-C++, or even Visual C++ 6
For *nix, I use G++
But yeah, it's best to get started by reading the stickied topics.