Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About ramiwahdan

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. or if i can just click the image as the one you have above then it can save it as image or print it. Thanks.
  2. Thanks it works now, if i right click on the image to save then it saves as html not image. is there a way to add a button under the image to download the certificate or print it?
  3. i need to get the name in arabic but connected together and inside the certificate which should be شهد
  4. Thanks, When i put this in image it gives me your code instead of name: $name = strtoupper($_POST['name']); $name_len = strlen($_POST['name']); $im= "<svg width='500' height='100'> <rect x='1' y='1' width='499' height='99' style='fill:#000; stroke:#000' /> <text x='20' y='60' style='font-family:calibri; font-size:30pt; fill:#FFF;'>$name</text> </svg> "; $certificate_text = $im; //function to display name on certificate picture $text1 = imagettftext($createimage, $font_size, $rotation, $origin_x, $origin_y, $black, 'c:/windows/fonts/calibri.ttf', $certificate_text); i am getting the code for $im instead! I need to get the name there.
  5. Thanks but as you can see the letters are not connected with each other.
  6. Hi, I am generating certificates in php i can display the name in arabic but it will not print on the certicate. It can show the English names though! is there a special code to be able to show that? code: <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <title>Certificate Generator</title> </head> <body> <center> <br><br><br> <h3>Certificate Generator</h3> <br><br><br><br> <form method="post" action=""> <div class="form-group col-sm-6"> <input type="text" name="name" class="form-control" id="name" placeholder="Enter Name Here..."> </div> <button type="submit" name="generate" class="btn btn-primary">Generate</button> </form> <br> <?php if (isset($_POST['generate'])) { $name = strtoupper($_POST['name']); $name_len = strlen($_POST['name']); if ($name == "" ) { echo " <div class='alert alert-danger col-sm-6' role='alert'> Ensure you fill all the fields! </div> "; }else{ echo " <div class='alert alert-success col-sm-6' role='alert'> Congratulations! $name on your excellent success. </div> "; //designed certificate picture $image = "certi.png"; $createimage = imagecreatefrompng($image); //this is going to be created once the generate button is clicked $output = "certificate.png"; //then we make use of the imagecolorallocate inbuilt php function which i used to set color to the text we are displaying on the image in RGB format $white = imagecolorallocate($createimage, 205, 245, 255); $black = imagecolorallocate($createimage, 0, 0, 0); //Then we make use of the angle since we will also make use of it when calling the imagettftext function below $rotation = 0; //we then set the x and y axis to fix the position of our text name $origin_x = 200; $origin_y=240; //we then set the x and y axis to fix the position of our text occupation $origin1_x = 120; $origin1_y=90; //we then set the differnet size range based on the lenght of the text which we have declared when we called values from the form if($name_len<=7){ $font_size = 25; $origin_x = 190; } elseif($name_len<=12){ $font_size = 30; } elseif($name_len<=15){ $font_size = 26; } elseif($name_len<=20){ $font_size = 18; } elseif($name_len<=22){ $font_size = 15; } elseif($name_len<=33){ $font_size=11; } else { $font_size =10; } $certificate_text = $name; //font directory for name $drFont = dirname(__FILE__)."/developer.ttf"; //function to display name on certificate picture $text1 = imagettftext($createimage, $font_size, $rotation, $origin_x, $origin_y, $black,$drFont, $certificate_text); imagepng($createimage,$output,3); ?> <!-- this displays the image below --> <img src="<?php echo $output; ?>"> <br> <br> <!-- this provides a download button --> <a href="<?php echo $output; ?>" class="btn btn-success">Download My Internship Certificate</a> <br><br> <?php } } ?> </center> <footer> <center><p>Built with &#10084; by <a href="https://olawanlejoel.github.io/portfolio/">Olawanle Joel</a></p></center> </footer> <!-- Optional JavaScript --> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> </body> </html>
  7. is there a way to do this without a cron job or is there cron jobs running xampp server?
  8. Hi, In my attendance system i want to add email alert using php. I want the system to check the records in my db and send email to everyone that forgot to clock-in after 7:30AM from Sunday to Thursday. What i need to use for this, ideas?
  9. Hi, when i try to insert to table date value it gives me wrong current date. $joindate = date('m-d-Y'); $sql = mysqli_query($con,"INSERT INTO staff (OracleID,StaffName,Des,joindate,username,password,isadmin) VALUES ('$oracleid','$name','$des','$joindate','$username', '$pass','$isadmin')"); i get this in the main page after making date("d-m-Y",strtotime(date)) 30-11--0001 why is that?
  10. got it, <form action="deletestaff.php?GetID=<?php echo $userid?>" method="post"> Thanks for the big help
  11. after running the function how to redirect to my deletestaff.php?id=???
  12. thanks for the help. your function will return Boolean of true or false. After i get the answer how to delete the records? before i had: <td><a href="deletestaff.php?GetID=<?php echo $userid?>">Delete</a></td> with your code i have: <td><button class="btn btn-primary" name="delete" onclick="return confirmDelete()">Delete</button></td> so after the function confirms yes for both, how to pass the link href="deletestaff.php?GetID=<?php echo $userid?>" thanks
  13. is there a way to do this by php only? I read about JS but i didn't use it before. You can point to easy tutorial to do it with JS if not possible in php.
  • 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.