Northern Flame
-
Posts
816 -
Joined
-
Last visited
Never
Posts posted by Northern Flame
-
-
alright thanks
-
their is three lines that you may need to change,
change your SQL to this:
$query = "SELECT `user_username`, `user_password`, `user_level`, `user_active` FROM l`s12_users` WHERE `user_username` = '".$username."'";
and change $row to:
$rows = mysql_num_rows($result);
and finally, change $array to:
$array = mysql_fetch_array($result);
-
obviously
I am using mysql_fetch_array..
lol just making sure,
you'd be surprised with the questions I've seen before,
try running the query with mysql_error() to see if you get any
errors reported back,
mysql_query("SELECT * FROM usertable WHERE s1='skupina' AND a='1' ORDER BY var1 DESC, var2 ASC LIMIT 42, 4")or die("Error: ". mysql_error());
and if that doesn't work, try taking off the LIMIT statement just to see
if anything gets reported back,
mysql_query("SELECT * FROM usertable WHERE s1='skupina' AND a='1' ORDER BY var1 DESC, var2 ASC")
-
do you get any errors?
-
or you can try:
<?php $saveName = stripslashes($_GET["name"]); $savePath = stripslashes($_GET["path"]); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=$saveName"); header("Content-Transfer-Encoding: binary"); header("Content-length: " . filesize($savePath)); readfile($savePath); ?>
save that file as download.php
then just type
http://www.mywebsite.com/download.php?name=File.jpg&path=file.jpg
name = the name its going to be downloaded as
path = the url of the file
EDIT:
oh sorry,
I didnt notice that you were trying to get the file off a
different server. This script only works for downloading
off of your server.
-
wow I've been at this forum for a long time and still
haven't introduced myself!
I'm 17 years old and live in the bay area.
For as long as I could remember I've wanted
to be a pilot and now that I have a job I've
decided to save up so I can get my pilots
license. Pretty much all I do is work, go to
school, hang out with friends, and when I'm
at home I go on here, I guess coding has
become a hobby of mine.
About a year and a half ago I got into trouble
and was forced by my parents to stay home
and not go out into the streets, and so I had
nothing to do but go on myspace all day. I
started wondering how people changed there
pages and added different colors and stuff.
I started looking it up and thats when I got
introduced to CSS and HTML. I started playing
around with it and soon got pretty good at it.
I signed up to a free web host (bravenet.com)
and made a few practice websites to test my
skills. Later on I wanted to do more "advanced"
stuff and thats when i got introduced to PHP.
I have been coding in PHP for about a year now.
Along the way I have also learned javascript/AJAX,
how to organize data with XML, and I want to
start doing flash too but programs such as
Adobe Flash are too expensive and I would
rather save up for my pilots license lol -
well first off you might want to post
this in the Apache Server section,
might get better responses there,
and as for changing localhost to mydomain,
im not too sure about that, but delete this
post and post this in the Apache Server
section and maybe someone else can
better answer your question.
-
alright thanks,
By the way, the posts wrap automatically, so there is no need to make line breaks yourself...
I know,
but im just used to doing this myself
I dont know why lol
-
you mean something like this:
<?php $myFile = "testFile.txt"; $fh = fopen($myFile, 'r'); $fw = fopen($myFile, 'w'); $id = $fh + 1; echo "Your id is $id"; fwrite($fw, $id); fclose($fh); fclose($fw); ?>
be sure to make testFile.txt writable
-
oops i meant to put the ahref tag
around the image in my post,
but yea, thats how you would do it
echo "<td><a href="http://somesite.com"><img src =\"upload/" . $row['name']."\"></a></td>";
Edit:
oh I didnt see south of somewhere's post
-
then it would be:
echo "<td><a href="http://somesite.com"><img src =\"upload/" . $row['name']."\"></a></td>";
-
how are you trying to output it?
are you using mysql_fetch_array
or mysql_fetch_object?
just by running the query,
you will not display any
results.
-
Hello phpfreaks staff,
I have a question about the tutorials,
why can't we post tutorials on the
tutorials section? sometimes when I'm
bored I like to test my PHP skills by
making tutorials for others, and the
tutorials section doesn't have many
tutorials right now. Are only the staff
allowed to post tutorials? or do we
have to send them to someone?
-
well first off,
there is a few HTML errors in your coding,
replace:
echo "<p><h2>" . $collectionnametitle ."</h2></p>";
with:
echo "<h2>" . $collectionnametitle ."</h2>";
try this code:
$sql = "SELECT * FROM $chosencollection"; $result = mysql_query($sql); $result2 = mysql_query($sql); $cols_num = mysql_num_fields($result2); ?> <h1>View Collection</h1> <? echo "<p><h2>" . $collectionnametitle ."</h2></p>"; while($row = mysql_fetch_row($result)) { foreach($row as $cell) { $col = mysql_fetch_field($result2); $col_name = str_replace("_", " ", $col->name); echo "<b>$col_name</b>: $cell<br>"; } echo "<br>"; }
-
be patient,
i have been programming in PHP for more or less a year now
and I am just now getting at a level that is "good" in my
opinion. Like others mentioned before, there are a bunch of
other stuff needed as well such as javascript ajax flash etc.
Pace yourself and once you think you get good at one thing,
move on to the next while still practicing and improving your
other skills. And in time, you will get to a level that you will
feel is "good". And remember, no matter how good you get,
there is ALWAYS room for improvement.
You might also want to check out the PHP Help section of
the forums, that has helped me a lot, not only by posting my
problems, but with working with others on their problems.
By working on other peoples problems, you learn how different
things apply to real-life PHP coding and it also gets you
thinking differently, as mentioned before, PHP has A LOT
to do with logic and problem solving.
-
i dont know of any free scripts out there that can do that for you,
you might want to try the freelance section if you cant find anything.
or if you want to learn how to do this yourself, it shouldn't be too
difficult.
heres one tutorial i found by doing a simple google search
(its using PHP and MySQL)
-
if mysql left linux,
do you know how many websites would be affected!
do you know how many websites would have to alter their scripts
to make them run with whatever other database they decide to
go with!
It would be madness! LOL
-
well do you have any important information to put in the top level
index page? or is it just gonna be a basic page with some sort of
link to the forums page? if its just going to be a link to the forum,
then yea go ahead and make the forum in the root level, but if you
are going to have important information on the root level index, keep
it. Because from what I've learned, robots look for the keywords in
you content, so if you will have a bunch of important content, you
can fill it up with keywords and the robots will still find your forums.
and like TheFilmGod mentioned, be sure to not only be appealing to
the robots, but your website has to be appealing to your guests as
well
-
looks good to me,
and like they mentioned the footer does not go with the website,
and you might want to add some padding or a <br /> tag
between the fusion bookmark button and the text on this page:
http://www.fusionrobotdesign.com/login.php?next=1&checkmeout=0
as you can see the button almost collides with the "Forgot Password"
link.
-
well first off it took awhile to load,
and once it loaded the menu on the top right was a bit
slow but once i clicked on one of the items it started
running normally.
Anyways, the over-all design looked good to me,
it was very....colorful lol,
but as for the concept of the website,
I didnt like it so much,
its pretty much like a "gossip" website
and im not too much into gossip,
but thats just me....
-
However if the random thought is 2 or 3 lines long, then the text at the bottom of the box disapears off the edge
i liked the site,
but yea if the text is too long the bottom of the application is not visible.
-
I have a flash music player that plays mp3's and gets the information
from an XML file. Lets call that file mp3.xml
If I link to the xml file in my music player with this url:
it works fine,
but if i add this code to an .htaccess file in /media/mp3/
.htaccess:
RewriteEngine on RewriteRule ^bin/([^/\.]+)/?$ music.swf?playlist_url=http://www.mywebsite.com/media/mp3/playlists/$1.xml [L]
and have this in the music player code:
data="http://www.mywebsite.com/media/mp3/bin/mp3"
the swf file loads and I see the music player,
but the XML file does not load. Can anyone
help me get my XML file to load with my
swf player?
-
try:
<?php // Configuration - Your Options $allowed_filetypes = array('.pdf','.js','.asp','.txt','.jpg','.gif','.png','.html','.php','.htm','.css','.zip'); // These will be the types of file that will pass the validation. $max_filesize = 99999999999; // Maximum filesize in BYTES (currently 0.5MB). $upload_path = './mine/'; // The place the files will be uploaded to (currently a 'files' directory). $filename = "id_XXX$ext"; $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename. // Check if the filetype is allowed, if not DIE and inform the user. if(!in_array($ext,$allowed_filetypes)) die('<meta http-equiv="refresh" content="0;url=index.php">'); // Now check the filesize, if it is too large then DIE and inform the user. if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize) die('The file you attempted to upload is too large.'); // Check if we can upload to the specified path, if not DIE and inform the user. if(!is_writable($upload_path)) die('You cannot upload to the specified directory, please CHMOD it to 777.'); // Upload the file to your specified path. if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)) echo "<a href='" .$upload_path . $filename . "' title='Your File' > Full Preview </a> <br /><br /> <div class='big'> Preview </div> <iframe src='" .$upload_path . $filename . "' ></iframe>"; else echo '<meta http-equiv="refresh" content="0;url=index.php">' ; // It failed . ?>
-
well yea my website still works without ajax,
the ajax is only for validating usernames before
registering and logging in. which my PHP script
does anyway when the user submits the form.
theres only one section that needs ajax
in order for it to really work and thats my
music player section.
Money and Employment Community
in Website Critique
Posted
as far as coding,
you seem have coded it in a way
thats valid, but one error was found,
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.drysnot.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0
it recommends that in your title you replace & with &
as far as the design,
I like your menu,
and I like how the images blur when I
go over them with my mouse,
but the main body text seems a little
boring, try changing fonts.
also, you don't have any footer,
thats not that big of a deal but you
might want to add some kind of footer