|
Yes and that fixed it. Thank you so much! Something so simple.
|
# ? Mar 31, 2010 19:10 |
|
|
# ? Jun 7, 2024 08:28 |
|
Munkeymon posted:There are plenty of ways to do it, but I doubt they're all that easy: Thanks. I've tried a few of the classes on PHP Classes which have proven to be pretty clunky. Maybe it would be easier to write a script to tree through the network folder and list all of the PDFs, which brings me to another question. Does anyone know of a way to automate PDF creation through folders either with a script or program or some type of cron job? e. Adobe Acrobat Pro will let me batch create PDFs but it won't tree through a folder structure.
|
# ? Mar 31, 2010 19:21 |
|
rotaryfun posted:Yes and that fixed it. Thank you so much! Something so simple. Those are invariably the things that take the longest to figure out and cause the most frustration
|
# ? Mar 31, 2010 20:09 |
|
I'm trying to attach some basic Javascript validation using this code:code:
I can't seem to get the textareas to validate (via javascript) in conjunction with the PHP, does it make sense that it doesn't work? I can't think of a reason why it wouldn't. Does Javascript have any problems with PHP at any time? Thirteenth Step fucked around with this message at 01:32 on Apr 1, 2010 |
# ? Apr 1, 2010 01:27 |
|
Thirteenth Step posted:I'm trying to attach some basic Javascript validation using this code: You need <form onsubmit="return isAlphanumeric(...);" (returning false stops the submit from proceeding). Edit: change onclick to onsubmit and add it to the form tag. I always forget that. Edit2: \/\/ It's been a long day. Also I think this is the first time I had to edit my "Edit:". Tad Naff fucked around with this message at 03:56 on Apr 1, 2010 |
# ? Apr 1, 2010 02:02 |
|
You don't want onclick in your form tag, you want onsubmit.code:
|
# ? Apr 1, 2010 02:34 |
|
Lumpy posted:Your convoluted PHP is actually protecting you somewhat. If you really want to gently caress things up, try putting in usernames with fun stuff like this: aaa';DELETE FROM users WHERE 1 or aaa';UPDATE users SET password = 'z' WHERE 1; http://dev.mysql.com/doc/refman/5.1/en/c-api-multiple-queries.html
|
# ? Apr 1, 2010 08:45 |
|
DoctorScurvy posted:Just for info: by default, mysql_query does NOT support using semicolons to separate multiple statements, so this sort of injection isn't an issue. The only way this can be done is by manually enabling options that allow it. Thanks for the info. It's been a loooong while since I have done "manual" queries and couldn't remember if that stuff worked or not ( did it ever? )
|
# ? Apr 1, 2010 13:52 |
|
FeloniousDrunk posted:You need <form onsubmit="return isAlphanumeric(...);" like: code:
|
# ? Apr 1, 2010 16:47 |
|
Thirteenth Step posted:like: Looks reasonable, except for that crazy <form> and <p> intermingling. <form> and <p> are both blocks by default so probably you don't need the <p>.
|
# ? Apr 1, 2010 20:59 |
|
FeloniousDrunk posted:Looks reasonable, except for that crazy <form> and <p> intermingling. <form> and <p> are both blocks by default so probably you don't need the <p>. And if you do, the P should be either inside the form or wrapping it: code:
|
# ? Apr 1, 2010 21:32 |
|
Lumpy posted:And if you do, the P should be either inside the form or wrapping it: code:
|
# ? Apr 1, 2010 22:16 |
|
I'd just use a list if it was just label/input pairs.code:
duz fucked around with this message at 23:02 on Apr 1, 2010 |
# ? Apr 1, 2010 22:59 |
duz posted:I'd just use a list if it was just label/input pairs. Doesn't quite do what he intended, lining up labels and stuff. My answer: just use a drat table. Maybe it's not the most semantic, but it works, and you can get back to worrying about more important parts of your site. I googled around the other day looking at various ways of doing forms, and it seemed like everybody just had all sort of solutions like using dd/dt tags. Then you have to use a bunch of CSS, all just to get it to look like a table!
|
|
# ? Apr 1, 2010 23:08 |
|
I am pretty sure it is acceptable to have a structure like this:code:
|
# ? Apr 1, 2010 23:16 |
|
Yeah, I was just asking out of curiosity about how Lumpy felt it should be done. I got the impression that he thinks it "best" not to have block elements inside a <form>, so I wasn't sure what he thought was the best way of doing it. I've used <form><table></table></form> on some of my pages and they valudate as 401 transitional, which is all I really want.
Hammerite fucked around with this message at 23:45 on Apr 1, 2010 |
# ? Apr 1, 2010 23:41 |
|
Hammerite posted:Yeah, I was just asking out of curiosity about how Lumpy felt it should be done. I got the impression that he thinks it "best" not to have block elements inside a <form>, so I wasn't sure what he thought was the best way of doing it. I've used <form><table></table></form> on some of my pages and they valudate as 401 transitional, which is all I really care about. Blocks inside blocks are fine, if they actually *do* something. I was more pointing out that having a block who's only child element is another block is pointless. I tend to structure my forms along these line, but it's not set in stone obviously because not every UI has the same requirements: code:
|
# ? Apr 1, 2010 23:51 |
|
Lumpy posted:Blocks inside blocks are fine, if they actually *do* something. I was more pointing out that having a block who's only child element is another block is pointless. Oh right. That makes more sense! I see your point now.
|
# ? Apr 1, 2010 23:55 |
|
I found out what was stopping it, i forgot to enter the 'id=textboxname' into the code, i presumed it would operate from this "name=textboxname" thanks for that help guys, and i'm not usually this messy with code, it'll get tidied up soon! Sorry for talking about javascript in a PHP thread too... I'll be back on the PHP soon...
|
# ? Apr 2, 2010 01:28 |
|
fletcher posted:Doesn't quite do what he intended, lining up labels and stuff. That's presentational, which is what CSS is for: code:
|
# ? Apr 2, 2010 02:51 |
|
This is some code I found on the Internet and am trying to get it work. I've played with it a number of ways and can't make it work right. The problem I'm having is that the variable 'fvalue' doesn't seem to be making it where it needs to be. I'm sure the problem is a simple one, but it has me stumped. I tried googling PHP variables with no success. My server is running Debian and has PHP5 installed on it. parallel.php: code:
code:
AbsentMindedWelder fucked around with this message at 04:02 on Apr 2, 2010 |
# ? Apr 2, 2010 03:47 |
|
dv6speed posted:This is some code I found on the Internet and am trying to get it work. I've played with it a number of ways and can't make it work right. The problem I'm having is that the variable 'fvalue' doesn't seem to be making it where it needs to be. Looks like parallel.php is expecting $fvalue to be part of global variables or something... although he uses $_GET properly for 'do'. $fvalue needs to be read in from $_POST. So at the top of parallel.php, change it to this: php:<? ?php /* Program: parallel.php * Desc: Takes data from the form and sends it to the * parallel port program (lptout). * Values should be given in hex (0 - ff) * requires lptout placed in /usr/sbin/ * * By Andrew Nickson ([url]www.re-mastered.co.uk[/url]) */ ?> <?php switch (@$_GET['do']) { case "update": { $fvalue = $_POST['fvalue']; // now it's assigned what was passed in POST. /// rest of code follows as-is ?>
|
# ? Apr 2, 2010 04:02 |
|
Lumpy posted:
I (thought) I had tried something like that as a result of my googling, but I guess I had put it in the wrong place or had the syntax off.
|
# ? Apr 2, 2010 04:11 |
|
duz posted:That's presentational, which is what CSS is for: To continue derailing, I did this in a recent project but was never satisfied about making labels fixed-width, especially if they run over the allotted width. Also you can't do this trick which lets you have clickable labels without assigning everything an id: code:
code:
Tad Naff fucked around with this message at 06:11 on Apr 2, 2010 |
# ? Apr 2, 2010 04:12 |
FeloniousDrunk posted:To continue derailing, I did this in a recent project but was never satisfied about making labels fixed-width, especially if they run over the allotted width. Also you can't do this trick which lets you have clickable labels without assigning everything an id: Ugly! Those should be siblings anyway.
|
|
# ? Apr 2, 2010 05:20 |
|
Anyone have suggestions on where to look for hiring someone to help with a few seemingly easy wordpress pages? The basic premise is a blog with digg-like voting for articles. I'm trying to get this done: http://wordpress.org/support/topic/345017 for both the main page and each category page, as well as the ability to filter it down by date (like digg: recent, 24 hours, 7 days, etc). How much should I expect to pay to get this coded? It seems like the coding itself is done, just needs some tweaking. hayden. fucked around with this message at 06:46 on Apr 2, 2010 |
# ? Apr 2, 2010 06:33 |
|
hayden. posted:Anyone have suggestions on where to look for hiring someone to help with a few seemingly easy wordpress pages? http://forums.somethingawful.com/showthread.php?threadid=3246449
|
# ? Apr 2, 2010 07:04 |
|
PHP ctype_digit posted:Return Values
|
# ? Apr 4, 2010 12:34 |
|
Hammerite posted:What is going on in the heads of the people who wrote this? So before PHP 5.1.0 this function behaved as per its description, but from 5.1.0 onwards they changed it so that it behaves differently to its description? To me it sounds like in 5.1.0 onwards they fixed a bug where it would incorrectly return TRUE for an empty string.....
|
# ? Apr 4, 2010 14:39 |
|
Lumpy posted:To me it sounds like in 5.1.0 onwards they fixed a bug where it would incorrectly return TRUE for an empty string..... The description says, "Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise." If there are no characters in the string, then certainly it is true that every character in the string is a digit.
|
# ? Apr 4, 2010 15:06 |
|
Or as a university prof of mine put it, "'all the elephants in the room are pink' is a true statement".
|
# ? Apr 4, 2010 15:46 |
|
epswing posted:Or as a university prof of mine put it, "'all the elephants in the room are pink' is a true statement". I was confused as to Hammerite's argument, but this actually makes sense and cleared it up for me.
|
# ? Apr 5, 2010 14:31 |
|
Begby posted:I was confused as to Hammerite's argument, but this actually makes sense and cleared it up for me. This is why all documentation should be written by a law firm! Intent be damned!!
|
# ? Apr 5, 2010 14:37 |
|
epswing posted:Or as a university prof of mine put it, "'all the elephants in the room are pink' is a true statement". Was this in a MACM class and was he Russian and awesome? I think I know who you're talking about.
|
# ? Apr 5, 2010 23:37 |
|
Naw it was Charlie Rackoff, CS program at the University of Toronto. I guess it's a common phrase, because it does get the point across rather well.
|
# ? Apr 6, 2010 03:51 |
|
epswing posted:Naw it was Charlie Rackoff, CS program at the University of Toronto. I guess it's a common phrase, because it does get the point across rather well. His wiki is both hilarious and awful. Also, greetings fellow Canadian goon
|
# ? Apr 6, 2010 05:17 |
|
How horrible is my login process? Am I missing something that will clean it up or optimize it?php:<?php session_start(); $usernamePost = $_POST['username']; $passwordPost = $_POST['password']; if ($usernamePost == '') { header("Location: fail.php?reason=username"); exit; } //!!!!!!!!!!! Connect to DB!!!!!!!!!!!!!!!// $server= "localhost"; /* Address of database server */ $user= ""; /* Database username */ $password= ""; /* Database Password */ $database= ""; $link = MYSQL_CONNECT($server, $user, $password) or die ( "Server is unreachable. Contact IT at x256 with this error message."); MYSQL_SELECT_DB($database) or die ( "Database not existent. Contact IT at x256 with this error message."); //!!!!!!!!!!! END Connect to DB!!!!!!!!!!!!!!!// $nameQuery = mysql_query("SELECT username, password FROM users WHERE username = '$usernamePost'"); $pullInfo = mysql_fetch_array($nameQuery); $usernameSQL = $pullInfo['username']; if ($usernameSQL == '') { header("Location: fail.php?reason=baduser"); exit; } $passwordSQL = $pullInfo['password']; if($passwordPost == $passwordSQL) { $_SESSION['username'] = $usernamePost; header("Location: main.php"); exit; } else { header("Location: fail.php?reason=badpass"); } ?>
|
# ? Apr 8, 2010 14:05 |
|
You don't appear to be sanitising user input - what happens if someone submits as "Name" the stringcode:
Hammerite fucked around with this message at 14:49 on Apr 8, 2010 |
# ? Apr 8, 2010 14:44 |
|
To follow up on that, a simple way to avoid SQL-injection is to use prepared statements, though that'd mean you'd either have to switch over to using PDO or MySQLi. It's pretty simple to do and will save you a lot of grief when it comes to sanitizing input.
|
# ? Apr 8, 2010 14:56 |
|
|
# ? Jun 7, 2024 08:28 |
|
Use PDO, which will protect from sql injections (as long as you use it correctly). Make a header file that does all the bootstrapping, such as starting the session and connecting to the db. Add require('header.inc.php') at the top of other files to load it. What happens if two users have the same username?
|
# ? Apr 8, 2010 14:58 |