-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Do you have display_errors disabled?
-
Function names cannot contain a hyphen: http://www.php.net/manual/en/functions.user-defined.php
-
Ain't too bad! Not sure how it will look when it's full screen though, think that background might get a bit much. Also I think for the style of the design the main text paragraphs are a little too neat / small. The navigation lacks any kind of artistic touch in comparison to other, less-important elements on the page. The footer links also look quite spaced out and hidden away. The 'what can i do for you' text looks quite lost compared to the 'about the author' text, which in truth should be the opposite way round -- you want to make it more seen what you can give them. Overall it's a good start, just think it has a few areas that could be improved.
-
Code for something like the "Relationship status" in facebook
Adam replied to LexHammer's topic in PHP Coding Help
As I was getting at before, I assume you have a member system already in place? We can't help you unless we know how it works. However though this does sound like you're after someone to do this all for you, in which case may be better posting in the freelance section? One method of storing the right data would be to create 2 fields within your users table; `relationship_status` & `relationship_with` (or something along those lines). `relationship_status` could be an integer, varchar or maybe "enum" -- depending on how you want to store the different relationship statuses. `relationship_with` would store the user ID (not display name) of the user they're in a relationship with. Returning and processing that data should be fairly straight forward. -
Did you try Google?? Searching for your actual post title: http://www.google.co.uk/search?q=Can+PHP+create+gif+animations
-
Code for something like the "Relationship status" in facebook
Adam replied to LexHammer's topic in PHP Coding Help
That's like asking how long's a piece of string -- there's no set code for such a thing. I assume you have a user system already in place? -
Do you mean that you want to echo out the 'word' returned by the search results into a link? Kind of like 'word.php?w=word_here'? echo '<tr><td align="left"><a href="word.php?w=' . $r['word'] . '">' . $r['word'] . '</a></td><td align="left">' . $r['sentence1'] . '</td></tr>';
-
Check out my social networking site.
Adam replied to AStrangerWCandy's topic in Beta Test Your Stuff!
Getting a 404 error. -
GET IN ! Edit: Actually almost a year ago to the day I was in a bad smash up as a result of drinking and driving, though I weren't driving! Had to have 4 stitches on my eye lid and broke 3 fingers... Ain't a great idea! I have pictures of my [then] mangled face if anybody's into that kind of thing??
-
I think it's only possible by echoing the json encoded (json_encode) $_POST array into the JavaScript.
-
Actually just found out the file is deleted at the end of the request. In that case then you could move the file to another location, temporarily, while you prompt the user to overwrite the original. Or .. Something as simple as a check box actually as they upload the file could be easier. Edit: Heh, PFMaBiSmAd beat me to it.
-
I assume you mean 'if file exists, overwrite?'.. You could store the temporary file name ($_FILES['tmp_name']) within a session variable, prompt the user, then if they agree "move_uploaded_file". Would it not be better to use a system where you don't get duplicate file names though?
-
Glad it's working, mrMarcus was right then. I'll not give session_register() advice anymore It's actually deprecated as of PHP5.3 - the last 'major version' - I dare say not yours.
-
It's worth giving it a shot! Try removing the session_register() calls.. May as well remove them anyway to be honest! What would make me think against that though is that you're not going back to login.php in between downloads -- are you? So for it to work the first time must mean it's registered the session correctly.
-
Combining $_SESSION with session_register() wouldn't cause any troubles, it's just session_register() is deprecated as of PHP5.3. Edit: Combining $_SESSION with session_register() wouldn't cause any troubles in the way he's using it **
-
I'd have to agree too. The place I work have recently taken on 2 contract Java developers to write the site's search engine (as it has to integrate with MS Dynamics)! We also have Java servlets for a lot of B2B stuff.
-
Yeah sorry, was pretty late there. The second code I provided won't fix your problem though, was merely a suggestion... However if you try dumping out the data, it'll hopefully point out where the problem is.
-
header("location:thanks.php"); Would suggest "thanks.php" doesn't exist. Are they definitely within the same directory?
-
I can't see any reason why this would happen *within this code*. Perhaps when you navigate away from the page other code is being run that is affecting the permissions session variable? Have you tried dumping the session data to see what's there when the download fails? For example: else { /* No permission */ echo "You do not have permission to download this file"; print_r($_SESSION); } Edit: Also to build on mrMarcus' suggestions, you could remove the loop altogether: <?php require_once('connections/mseis.php'); ?> <?php /* This code assumes that users may have mulitple permissions but files will only have one set of permissions Therefore set the lowest permission level ('public') on files which should be available to all and grant 'op' to higher ranking users */ session_start(); if (!isset($_GET['id'])) { echo "No ID specified"; die; } mysql_select_db($database_mseis, $mseis); $selectSQL = sprintf("SELECT * FROM downloads WHERE id = %s", GetSQLValueString($_GET['id'], "text")); $result = mysql_query($selectSQL, $mseis) or die(mysql_error()); if(mysql_num_rows($result) == 1) { $row = mysql_fetch_assoc($result); if (strpos($_SESSION["permissions"], $row["permissions"]) !== false || $row["permissions"] == "public") { /* Start download */ $file = $row["file"]; $dir="downloads/"; $file = $dir . $file; header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".filesize($file)); header("Content-disposition: attachment; filename=\"" . basename($file) . "\""); readfile("$file"); } else { /* No permission */ echo "You do not have permission to download this file"; } } else { /*Not found*/ echo "File not found"; } ?>
-
Could you show the code where these variables are declared? Also echo them out and check they are the values you're expecting.
-
I'd not include the actual email address within the form (for spam reasons) if I were you. Instead just set the check box value to true and check within your PHP code if they have checked sales/support and send accordingly. Without being able to see the bulk of the code, are you correctly setting the $support / $sales vars?
-
I don't see what that proves?
-
That link just times out..
-
Mmm, not for me it doesn't? Do you have a link or anything that states this?
-
You may need to restart the web server for the changes to take effect? Edit: Oh wait. The image you posted shows it off..