Jump to content

Variables not working right....


Call-911

Recommended Posts

Hello All,

 

In below script, I'm using another script called "SimpleImage.php" to upload and resize photos for a news site. The problem comes with renaming the photos. I need to name the photo based off of the story id. I have everything right to get the story id, but saving it as the variable is what's confusing me.

 

Here's what I have:

 

<?php include ("newsconnection.php");?>
<?php
$picturename = $_POST['newstoryid'];

      include('SimpleImage.php');
      $image = new SimpleImage();
      $image->load($_FILES['uploaded_image']['tmp_name']);
      $image->resizeToWidth(300);
      $image->save('$picturename');

?>

 

It's the $image->save('$picturename'); line that's messing me up. Any help would be great!!

Link to comment
https://forums.phpfreaks.com/topic/224432-variables-not-working-right/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.