Topic awaiting preservation: outlining a website help please |
|
---|---|
Author | Thread |
Maniac (V) Inmate From: there...no..there..... |
posted 06-19-2007 18:24
I have a website that I am building and would like some help on the best way to handle it. |
Paranoid (IV) Inmate From: Florida |
posted 06-19-2007 22:11
quote:
|
Maniac (V) Inmate From: there...no..there..... |
posted 06-19-2007 22:50
quote:
|
Maniac (V) Inmate From: there...no..there..... |
posted 06-19-2007 23:58
ok, immaidiot. I found the fonts |
Paranoid (IV) Inmate From: Florida |
posted 06-20-2007 01:40
quote:
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 06-28-2007 13:36
ok, hope you don't mind me answering here, CPrompt. |
Paranoid (IV) Inmate From: f(x) |
posted 06-28-2007 20:02
Take a look at this: |
Maniac (V) Inmate From: there...no..there..... |
posted 06-28-2007 20:42
Thanks for that. quote:
code: <? /* ** Draw text over a base image */ $baseImg = "images/bcard_template3.jpg"; //base image $baseFont = "fonts/timesbd.ttf"; //base font (will be able to change these later) $uNamefontSize = 16; //font size for the users name $uTitlefontSize = 10; //fonts size for the users Title $angle = 0; //username info $uNameX = 142; $uNameY = 20; $uName = $_POST['userName']; //user Title info //box 1 $uTitle1X = 142; //keep it in line with the name $uTitle1Y = 40; //bring it below the name $uTitle1 = $_POST['userTitle']; //user Title info //box 2 $uTitle2X = 142; $uTitle2Y = 55; $uTitle2 = "For Assistant Vice Chancellor"; //create a image and set some colors $image = imagecreatefromjpeg($baseImg); $colorYellow = imagecolorallocate($image,0xFF,0xFF,0x99); //the colors will be selectable. $colorGrey = imagecolorallocate($image,0xCC,0xCC,0xCC); $colorBlack = imagecolorallocate($image,0,0,0); //output the name and titles $uNameBox = imagettftext($image, $uNamefontSize,$angle,$uNameX,$uNameY,$colorGrey,$baseFont,$uName); $uTitleBox1 = imagettftext($image, $uTitlefontSize,$angle,$uTitle1X,$uTitle1Y,$colorBlack,$baseFont,$uTitle1); $uTitleBox2 = imagettftext($image, $uTitlefontSize,$angle,$uTitle2X,$uTitle2Y,$colorBlack,$baseFont,$uTitle2); //red rover - red rover - send the image on over header('Content-type:image/png'); imagepng($image); ?>
|
Paranoid (IV) Inmate From: f(x) |
posted 06-28-2007 21:35 |
Maniac (V) Inmate From: there...no..there..... |
posted 06-28-2007 21:42
zavaboy : the actual problem is, once the form is submitted it goes from the form page (index.php) straight to the script that was called from the form (bcardtemplate.php). I don't want to leave the index.php page but I have in that page code: header('Content-type: image/png');
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 06-28-2007 22:21
I'd do this differently - dynamically replace the url of the image (javascript) and submit the fields via get. |
Maniac (V) Inmate From: there...no..there..... |
posted 06-28-2007 22:41
I *think* I got ya on that. I might look at the Ajax thing. Never used it before. I was just getting ready to try the session stuff though. That might easiest for me at this point. quote:
|
Paranoid (IV) Inmate From: f(x) |
posted 06-30-2007 20:32 |
Maniac (V) Mad Librarian From: Seoul, Korea |
posted 07-03-2007 14:38
CPrompt: Did you find what you needed? I'm back and can help out if you still need me. This might require some brushing up on my part, but that never hurt anyone. |
Maniac (V) Inmate From: there...no..there..... |
posted 07-03-2007 19:59
Suho : yeah I found what I was looking for. I do need some assistance though. Making progress but ran into a snag. code: <!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="en" lang="en"> <head> <title>Dynamic Image</title> <meta name="generator" content="MAX's HTML Beauty++ 2004" /> <script type="text/javascript"> // Set path to PHP script var phpscript = 'output.php'; function createRequestObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = new XMLHttpRequest(); } else if(window.ActiveXObject) { // Internet Explorer 5+ req = new ActiveXObject("Microsoft.XMLHTTP"); } else { // There is an error creating the object, // just as an old browser is being used. alert('Problem creating the XMLHttpRequest object'); } return req; } // Make the XMLHttpRequest object var http = createRequestObject(); function sendRequestGet(userName) { // Open PHP script for requests http.open('get', phpscript+'?userName='+userName); http.onreadystatechange = handleResponseGet; http.send(null); } function handleResponseGet() { if(http.readyState == 4 && http.status == 200){ // Text returned from PHP script var response = http.responseText; if(response) { // Update ajaxTest content document.getElementById("uImage").innerHTML = response; } } } </script> </head> <body> <table> <tr> <td>Username:</td><td><input type="text" id="userName" name="userName" /></td> <tr> <tr> <td> <input type="button" value="Submit" onclick="sendRequestGet(<?echo $_GET['userName'];?>);" /> </td> </tr> </table> <div id="uImage"> <img src="bcardtemplate.php" /> </div> </body> </html>
code: <? if(isset($_GET['userName'])) { echo "<img src=\"bcardtemplate.php?userName=" . $_GET['userName'] . "/>"; } ?>
|
Maniac (V) Inmate From: there...no..there..... |
posted 07-03-2007 20:19
OK...after reading a website over and over, I found the "prototype.js". Using that I found a way to do this. code: <script type="text/javascript"> /* ajax.Request */ function ajaxRequest(url,data) { var aj = new Ajax.Request(url,{ method:'get', parameters: data, onComplete: getResponse } ); } /* ajax.Response */ function getResponse(oReq) { $('uImage').innerHTML = oReq.responseText; } </script>
|
Maniac (V) Inmate From: there...no..there..... |
posted 07-03-2007 20:56
OK...I'm gonna ask one more question about this today. |
Maniac (V) Inmate From: there...no..there..... |
posted 07-03-2007 21:30
care if I just use this as my personal log of aggravations? |
Paranoid (IV) Inmate From: f(x) |
posted 07-03-2007 23:28
quote:
|