-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
How many files exactly do you combine into a single file??
-
You'd have a cluttered file? Personally if I were to pass the page name in like that I'd use templates, and a neat file structure.
-
Could shorten it a bit, looks best way to go using an array though... if (!in_array($player->staff, array(1, 4, 5))) {
-
Take a look here: http://www.php.net/manual/en/language.variables.external.php
-
Seems better, though that background still has to go in my opinion. Don't like how the boxes get wider further down the page. When you login and go to the members lounge, everything's really dotted around, doesn't look planned out. There's also text that's impossible to read without highlighting. Sorry but, think it still needs fair bit of work doing to it...
-
Try this: foreach($files as $ind_file){ if ($ind_file != '.' && $ind_file != '..') { echo '<img src="'.$dir.'/'.$ind_file.'" width="120">'; } } http://us.php.net/manual/en/function.scandir.php If you look at the manual you'll see two directories in there as well: '.' & '..' I bet if you look at the source of your page you'll notice the images where trying to use these as the 'src'.
-
Take screen shot of the webpage for a given url
Adam replied to sunil_23413's topic in PHP Coding Help
The links and images won't work as what's probably happening is the email client is rendering the HTML taken from the web page - it's not taking an actual screen shot. As for taking a screen shot, I can't really help you. Google's probably best way to go... -
The best things in life are free! http://phpmygraph.abisvmm.nl/ I've never used it, but looks pretty good.
-
Try this... $pattern = '%(0?[1-9]{1}|1[0-2]{1})/([0-2]?[0-9]{1}|3[0-1]{1})/[0-9]{4,4}%';
-
If you go with something like, just be sure all links are accessible if JavaScript is disabled...
-
I think this is what you mean: if (($lastNotified) < strtotime($timeAdded) { echo ($i == $count) ? '<li class="unread last">'.$row['message'].'</li>' : '<li class="unread">'.$row['message'].'</li>'; } else { echo ($i == $count) ? '<li class="last">'.$row['message'].'</li>' : '<li>'.$row['message'].'</li>'; } I've never used a ternary operator with echo before, but should work! Personally though, for easier reading and future development I prefer to use ternary operators as little as possible.
-
[SOLVED] Code not re-directing as I would like
Adam replied to ArizonaJohn's topic in PHP Coding Help
In-fact, scrub that... Didn't realise this wasn't the complete code, and when I saw that assumed it was $_GET['find'] it was encoding. It's early... -
[SOLVED] Code not re-directing as I would like
Adam replied to ArizonaJohn's topic in PHP Coding Help
Looks like you're trying to pass $find to the function, but you're setting it in the 'else' case of it failing. Try moving: $find = urlencode($find); Just after: if ($anymatches == 0) { -
Agree with above. Plus when you do click through to a page, the italic links on the left are small, hard to read and very uninteresting. The whole site looks really boring in-fact, I certainly wouldn't stick around. Also keep the fancy web talk to a minimum, if you confuse him you'll probably do yourself damage.
-
Your menus break without JavaScript, which means search engines can't navigate through your site, which means people will never find your site. It doesn't matter how many people don't use it in your case. EDIT: Actually it does. Statistics vary but it's around 5-10% of people I think. So it's possible 5-10% of the people who do manage to find your site, can't use it anyway.
-
Where did you get that, in the database?
-
Actually come to think of it, I bet you were right anyway...
-
I'd disagree there. Sessions should really be used for session data, not data for a single script. try this: foreach($openedfile as $Key => $Val) { $Data = explode("|", $Val); $user = $Data[0]; $psw= $Data[1]; if($user ==$username && $psw == $password) { echo" We have a match"; } else { echo" SORRY- No match here"; } } I'm not sure where you originally get $username and $password from, but you should be able to use them later in the script if there's a match.
-
And... where does the avatar come from?
-
In this line: if((move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) || (move_uploaded_file($_FILES['imagefile']['tmp_name'], $imgtarget_path))) { You're saying if "uploadedfile" OR "imagefile" are uploaded (...) That should be && (AND); although to be honest I wouldn't do it that way. Do you have errors enabled do you know? If there's no warning message that suggests the file you're trying to upload is not valid.
-
That's a lot of code... Perhaps asking a bit much of peoples good will there. Where abouts in the code do you want the avatar? Where does the avatar come from? Where abouts in the code is the functionality for your quote button, where is the quote button? What doesn't work with it?
-
... foreach($openedfile as $Key => $Val) { $Data = explode("|", $Val); $user = $Data[0]; $psw= $Data[1]; if($user ==$username && $psw == $password) { echo" We have a match"; } else { echo" SORRY- No match here"; } } ... Should work. I'd recommend this method though: $openedfile = file($db_file); if (in_array($username . '|' . $password, $openedfile)) { // match } else { // no match } Why not just use a database?
-
I think you have 'display errors' off, if it didn't pick up the syntax error from before. Try adding the following just after your first opening PHP tag: error_reporting(E_ALL); ini_set("display_errors", 1); This will show you any errors occurring within the script.
-
The way you're looping through the files could be improved. See if this works (obviously not tested it): if(isset($_POST['submitimages'])) { $im1= $_POST['img1']; $im2= $_POST['img2']; $im3= $_POST['img3']; $im4= $_POST['img4']; $success=0; $DestinationDir="../ad_images/"; //Place the destination dir here $ThumbDir="/thumb/"; //Place the thumb dir here $insert_fields = ''; $insert_values = ''; foreach ($_FILES as $key => $file) { $Unique=microtime(); // We want unique names, right? $destination=$DestinationDir.md5($Unique).".jpg"; $thumb=$ThumbDir.md5($Unique).".jpg"; $IMG=getimagesize($file['tmp_name']); $finalimage = resize($file['tmp_name'], 250, $destination); //use the filename variable below to record the image name entered so that you can then use this variable to update your database if $filename = md5($Unique).".jpg"; $insert_fields .= "image" . intval($key) . ","; $insert_values .= "'" . $filename . "',"; } $insert_fields = rtrim($insert_fields, ','); $insert_values = rtrim($insert_values, ','); $insert_query = mysql_query("insert into ad_image (ad," . $insert_fields . ") values ('__advalue__'," . $insert_values . ")") or die(mysql_error()); if($success>=1) { $message = "Images uploaded!"; } else {echo "We might have a problem???";} echo $im1; echo $im2; echo $im3; echo $im4; } I just replaced where you'll need to put the value for the 'ad' field with "__advalue__" ...