Jump to content
#StayAtHome ×


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About simona6

  • Rank
    Regular Member

Profile Information

  • Gender
  • Location
    Lincolnshire, UK
  1. I had someone ask me today about this. Should you tell the world about your client list, for fear of others checking the, and 'cold calling' them? We know of a company in the London area that provides high-end products to some big names, both on the high street and off it. While they do articles on their website about certain work they did for a company, they don't have an actual 'Portfolio' list. Part of this reason is to stop others trying to 'muscle in'. On one part of the argument it can help. Particularly if what you do is done by many. So it's good to say Company A and B both chose us!! How exciting. And from a Coding point of view, it gives those companies a good back link. But on the other side, do you want those companies to be cold called, to ask about a cheaper or (how they see it) better service? If the company in question doesn't supply pricing, it does put up part of that barrier though. Just keen to learn, in the world of Design and Hosting, what's the view on this. Should companies show their client list (or some of them), or should they no, and perhaps appear a little arrogant. I for one haven't found any design company that doesn't. Cheers.
  2. Resolved. It was the server setting in PHP. The Memory was left blank, and the File Uploads was on OFF for some bizarre reason. An update must have set those 'back end'.
  3. if (isset($updatephoto)) { define ("MAX_SIZE","5000"); function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } $errors=0; if($_SERVER["REQUEST_METHOD"] == "POST") { $image = $_FILES["profilephoto"]["name"]; $uploadedfile = $_FILES['profilephoto']['tmp_name']; if ($image) { $filename = stripslashes($_FILES['profilephoto']['name']); $extension = getExtension($filename); $extension = strtolower($extension); echo "test here $uploadedfile"; If I add the final line in this grab of the code, it does not show anything on screen. So it's as if $_FILES["profilephoto"]["name"] just isn't being seen.
  4. What errors? If you mean the one I have posted, I don't know what the fix is, and that is the issue here.
  5. <form method='POST' action='' name='signuprocess' enctype='multipart/form-data'> <input type='hidden' name='updatephoto' value='update'><div class='profile-photo'><h2><div class='profile-icon'><i class='fa fa-camera'></i></div> Profile Photo</h2><br/><div class='signup signup-title'><p><b>Please upload a photo of yourself, not your family.</p></div><div class='signup form-field'><input name='profilephoto' type='file' size='15' /></div> <input type='submit' value='Upload'></form> This is the form. It was working up until a few days ago, so I am suspicious of something changing on the server, through some auto update. It uploads the file fine, when running locally. Both are on PHP 7.2.
  6. Yes errors are turned on, but there aren't any. Only those I sent here in the Error Log file. This is an example of the errors, and they are pretty much all like this: mod_fcgid: stderr: PHP Notice: Undefined variable: profilephoto in /var/www/vhosts/site.net/httpdocs/includes/profile.inc on line 253, referer: https://www.site.net/profile
  7. adding photo,Array ( [name] => profilepic.jpeg [type] => image/jpeg [tmp_name] => C:\xampp\tmp\phpB923.tmp [error] => 0 [size] => 152127 ) Hi, We have been using this code for ages, but suddenly for some reason we cannot upload an image using the code below. When we try to Print_r the $profilephoto variable, I get this error. The filename is correct, but what is that [error]?? And how do I resolve it? Oddly it does upload it locally, but LIVE, it won't This is the code. if (isset($updatephoto)) { echo "adding photo,"; print_r($profilephoto); define ("MAX_SIZE","5000"); function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } $errors=0; if($_SERVER["REQUEST_METHOD"] == "POST") { $image =$_FILES["profilephoto"]["name"]; $uploadedfile = $_FILES['profilephoto']['tmp_name']; if ($image) { $filename = stripslashes($_FILES['profilephoto']['name']); $extension = getExtension($filename); $extension = strtolower($extension); if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { echo "Unknown Extension..!"; } else { $size=filesize($_FILES['profilephoto']['tmp_name']); if ($size > MAX_SIZE*1024) { echo "File Size Excedeed..!!"; } if($extension=="jpg" || $extension=="jpeg" ) { $uploadedfile = $_FILES['profilephoto']['tmp_name']; $src = imagecreatefromjpeg($uploadedfile); } else if($extension=="png") { $uploadedfile = $_FILES['profilephoto']['tmp_name']; $src = imagecreatefrompng($uploadedfile); } else { $src = imagecreatefromgif($uploadedfile); echo $scr; } list($width,$height)=getimagesize($uploadedfile); $newwidth=600; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); $pic=($_FILES['profilephoto']['name']); $random = (rand()%99999999); $newname="$random"."$pic"; $filename = "images/profiles/". $newname; imagejpeg($tmp,$filename,100); imagedestroy($src); imagedestroy($tmp); }} } $query = ("UPDATE users SET profilephoto =:newname WHERE id =:userid"); $result = $pdo->prepare($query); $result->execute(array(':userid' => $userid, ':newname' => $newname)); echo "<script> window.location.replace('/profile/') </script>";}
  8. Goodness me. Well firstly apologies for the terminology I used. I thought it was a "listener". It does look to be extremely complicated.
  9. Something I have never done, but want to learn the best practice for doing so, is a listener script. Example: one of our websites is in bespoke PHP and has two links that shows if there are any noticeboard 'notifications' or any new 'messages'. Ideally I'd like to show 1, 2, 3... etc as a count of how many are remaining for Messages. So if a new one comes in while they are on a page, that number literally changes while they are on the page. I assume this is with Ajax, and not straight forward. I don't know any DOM code or Javascript. But would appreciate some help please. Simon
  10. Hi there. We are now setup as 'Developers' with Tokens and API to get 'number of followers' from handles on Twitter. Trouble is, there is no definite guide on the best way to do it. ie. a chunk of code, where you add your Token and API, enter the @handle, and use PHP to extract the number. Does anyone know the best means of doing it? I've looked at Twitter's Auth code but there are oodles of code there, and no definitive answer.
  11. $hashtags = strip_tags($row->uniquehashtag); $array = explode(' ', $hashtags); foreach ($array as $tag) { echo "<span class='gig-hashtags'>$tag</span>"; } Spot on - removes the <p> tag in the code too! Plus anything else they might have added. Thanks everyone.
  12. Answered my own question.... //space is used as delimiter $parts=explode(' ', $row->uniquehashtag); echo count($parts); echo $parts[0] . '<br/>'; echo $parts[1] . '<br/>'; echo $parts[2]; 'count' shows how many there are, then I can put those [0] arrays into a loop by the amount of count.
  13. I have the content in, let's say $hastags. I want to split that content so it starts at the #, and ends at the space. I'm asking of the best way to do this - it might not be explode(). Trouble is, when I have seen that used, it's usually numbered, and if you don't know how many there will be, how do you know how many arrays to look at? <?php $mystr='I like Programming'; //space is used as delimiter $parts=explode(' ', $mystr); echo $parts[0] . '<br/>'; echo $parts[1] . '<br/>'; echo $parts[2]; ?> Here is an example. But what if there are 15 terms in here to be split up. How do you manage that, dynamically? One might have 15, one might have just 2. I can of course easily put them into variables, and the answer might be as a 'count'.
  14. That is what I am asking here. I don't even know of explode() is the right method. All I know is that I need to split them up, to show each one in an individual DIV, but they are entered in a text box.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.