J
J
Jony13372015-10-18 16:47:02
PHP
Jony1337, 2015-10-18 16:47:02

Purely theoretically it is possible in php?

I have this code

<?php
$id = $_GET["id"];
$urlimg = 'i500.mycdn.me/getImage?photoId='.$_GET['urll'].'&type=6';

$im3 = imagecreatefromjpeg($urlimg);

$stamp = imagecreatefrompng('new/1.png');
imagecopy($im3, $stamp, 0, 0, 0, 0, 128, 128);
imagedestroy($stamp);
$stamp = imagecreatefrompng('new/2.png');
imagecopy($im3, $stamp, 0, 0, 0, 0, 128, 128);
imagedestroy($stamp);

// Output and free memory
header("Content-Type: image/png");
imagepng($im3, 'images/'.$id.'.png');
imagedestroy($im3);
?>

When a person enters the site through the social network, his main photo is taken from the profile, the code that from the top adds a random frame over the photo or frame 1 or frame 2
The visitor can share this photo in the social network
The essence of the problem is that I need such a script that will be inserted in the right place text from another php file.
Example:
A person logs in through the social network (everything works, I made an application in the social network, the code that takes the photo).
A photo is taken, a random frame is inserted, but the necessary text is inserted depending on the frame
. Let's say frame 1 is inserted, text 1 is inserted, Let's say frame 2 is inserted, text 2 is inserted, and so on.
Here is the text script
<?php

  $quotes[] = 'text1';
    $quotes[] = 'text2';
    $quotes[] = 'text3';
    $quotes[] = 'text4';
    $quotes[] = 'text5';
 srand ((double) microtime() * 1000000);
    $rs = $quotes[ rand(0,count($quotes)-1) ];
$html = <<<HERE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>$pagina</title>
<meta property="og:title" content="$nume , $rs" /> 
<meta property="og:description" name="description" content="$descriere">
<meta property="og:type" content="photo" />
<meta property="og:image" content="http://prietenimd.ru/images/$userin.png" />
<script type="text/javascript">  
  location.replace("http://prietenimd.ru/ok.php");  
  </script>
</head>
<body>
</body>
HERE;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dvomaks, 2015-10-18
@dvomaks

Yes

I
Ivanq, 2015-10-18
@Ivanq

how to help a newbie

Yes Easy. The result of rand into a variable, then, depending on it, a picture, like you have.
Then, depending on the variable, write the text.
You can not do it this way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question