-
Posts
489 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by MrAdam
-
-
In your insert query, you didn not include the field names:
mysql_query("INSERT INTO users-online (field1,field2) VALUES ('".$random."', '".$_SERVER['REMOTE_ADDR']."')");
Rename field1 and field2 obviouslly. I assume you have connected to the internet earlier in your script?
-
Before a freind reccomended me xampp, i was messing round following a tutorial to try and install apache, php and mysql all sperate, then get them all working with each other - and i was completely lost. Xampp is really simple, just download it and everything is sorted out in one simple installation. There are a few extra things available with it, like "Mercury" and "FileZilla", but i had no idea what they were, so had no use for them.Good luck !
-
you could create a sort of php image template file. when you open the window, open it with a url like:"image.php?img=images/img1.jpg"that way there will only be 1 file for all the images, and you could still use the auto resize script on that webpage.a script i made not so long ago to do almost the same thing:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title>Image: <?php print $_GET['img']; ?></title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">body { margin: 0px;}</style></head><body><img src="<?php print $_GET['img']; ?>" alt="" /></body></html>
...it's fairly basic, but does the job! Just remember you need to have PHP enabled on your webserver/host - and save it as a ".php" file.Adammm
-
quoting myself, in the code you supplied, session_start(); was written after some HTML .. and if errors are off .. you won't realise it's not actually starting the session.session_start(); must be sent before anything is outputted to the page.. -
oh right, just that in the url, if you have "?var1=Hello&var2=" it will recognise var2 as not set. i pressumed it would be the same in other circumstances too.
-
-
<?php$con = mysql_connect("host", "user", "pass") or die("Could not connect to database because ".mysql_error());if(!mysql_select_db("database",$con)) die("Could not connect to database because ".mysql_error();$query = mysql("SELECT * FROM table ORDER BY unique_field DESC LIMIT 10");while ($rows=mysql_fetch_array($query)) {print $rows['field_name'].'<br />'.$rows['another_field'].'<br /><br />';}?>i've not tested it, but it should work. Just replace host, user, pass and database to connect. Then obviouslly change the values in the query.
-
however, there are ways of making it secure by making it so hard to understand, take a look at this script.- that was the first I found, though I don't know if it works properly or w/e - i put in some sample code and it looks damn dodgey!
-
-
haha. i don't even think that's right - it will be looking for braces to know when the if ends, unless you only have one statement and therefore do not need braces.
-
Just let me get it straight, you are setting an event which is yet to happen, by a date & time? then calculating the time until that event?You see, you have:
- futureand then the text your printing says:I am trying to show a time left until a certain event
- pastTime until last signup -
haha okay! - Though i would have thought in that situation it would be recognised as not set. Meh!
-
you want to install PHP onto your computer? (I'm not sure what it was you meant).if so, I used: xampp. real simple to install and use.
-
could be something simple; do you have "session_start();" before anything is printed to the page ?
-
'secure files' would probably be the only way of doing it... (Google it )
-
window.print() should print the current page ..
-
-
Login system
in PHP
I'd use sessions for while they are logged in, and cookies to remember them.
-
session_start(); must be sent before anything is outputted to the page..
-
as far as i know you can't use ";" to seperate them. There may be a way of allowing it i'm not aware of though. Where did you see it being used? I've seen it being used on .cgi files before?
-
that counter was very useful 'justsomeguy' - cheers. yeah, I kept increasingly adding js as I added more to the basic website. Mainly it's just an image in place of a submit button. Thanks for the feedback!
-
you could use php ..when setting the frames, your banner thing across the top could contain a link that is generated using PHP.for example:"toppage.php?url=http://www.google.co.uk"then in between the link have like:
<a href="<?php print $_GET['url']; ?>" target="_top">Remove this frame</a>
<?php => opens the php scriptprint => prints text to the page$_GET['url']; => the value of the 'url' parameter within the url?> => closes the php scriptsorry if you think i was being too condescending there.
-
you can do that in HTML, just set the target attribute of your link to "_top" ..
-
Installation Issues:
in PHP
Posted
haha. i had very similar problems installing them ! My friend reccomended i uninstalled them and used xampp. It installs everything in one and has it's own control panel. Far better I thought!Also i've found that it doesn't slow my computer down at all - and im using a pretty.. poo.. computer.Good luck !