Jump to content

Bloodrun

Member
  • Posts

    18
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About Bloodrun

Bloodrun's Achievements

0

Reputation

  1. What you could do, is have the checkbox visible at all times, but only able to use when option one has been picked by using a javascript code, such as this: function updatefields(){ if (document.getElementById("selectedProd").options[document.getElementById("selectedProd").selectedIndex].value=='code1') { document.getElementById("checkbox").disabled=false;} else{ document.getElementById("checkbox").disabled=true; } } <input type="checkbox" name="checkbox" id="checkbox"/> Hoped that helped.
  2. Okay I am using this tutorial: http://evolt.org/php_login_script_with_remember_me_feature? On creating a login/registration page. The only thing is that it doesn't come with a user id variable, and I would like to know how to add it, in both the PHP coding and the Database, now I believe this is how it should be added to the database: CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) NOT NULL auto_increment, `username` varchar(30) NOT NULL default '', `password` varchar(32) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4; But im not sure how to add it to the PHP at all. Now, I have found several other tutorials that have a id variable with it, but none of them allow me to incorporate my pages with it the way I like.
  3. Lol, I wondered when this was gonna pop up. Alright, well thanks for the help.
  4. Yeah I figured that, but making a set character limit wont let me use the wrap code. So i just kept the wrap code and lowered the text size. But I have another question. How come when ever I try to use an image, like if I wanted to have the option for the user to have an icon. It always makes that image the background =/ How come? It's getting really annoying.. There are a few reasons for this. It would help if you posted your modified code so I could look at it and tell you why. Alright I sent it to you in a PM
  5. Yeah I figured that, but making a set character limit wont let me use the wrap code. So i just kept the wrap code and lowered the text size. But I have another question. How come when ever I try to use an image, like if I wanted to have the option for the user to have an icon. It always makes that image the background =/ How come? It's getting really annoying..
  6. You can always limit the number of characters someone submits. See an example here: http://www.webmasterworld.com/forum88/7649.htm Hmm, alright, the code when I put it into my PHP it doesn't work, I don't know where to put it.
  7. That's the only way I ever did it. The trick is to find the correct limit for the number of characters you want on a single line. =/ I know the number of characters I want for a single. But the problem is, that if the group of text is long enough, it will just keep doing down. and that ruins what im trying to do =/
  8. Hmm, okay well I have checked www.php.net And I have gotten a code for textwrapping, but, that Code doesn't resize the text for the more words you type in. Would you happen to know how to do that? Ill try to be more clear. So, here's a sentence or two: I went to the market to buy Lucy Sue a show. When I got there, the market was closed. The code I found for text wrapping does this (Depending on the amount of characters I choose): I went to the marker to buy Lucy Sue a show. When I got there, the Market was closed. Now, that would work, if I had a restriction on the amount of characters someone could type in. But I don't want the restrictions. Thus making this code invaluable to me.. Oh, heres the code Im using: <?php $text = "A very long woooooooooooord."; //8 is the limit of characters, '\n' is the breaking method, and false means if it was a word being cut, the word would stay whole instead. $newtext = wordwrap($text, 8, "\n", false); echo "$newtext\n"; ?>
  9. Ohh, I forgot, I was doing several things when I was uploading them, and I thought I had converted them. Thanks for that, and um.. *cough* yeah, thanks. =D
  10. When, I fill out the form, and leave the select box alone, or choose Home (which is the default) it works, but none of the others. Now if I did this correctly, it will show the screen shot, That link that you see, is in, it's just hard to tell in the screen lol.
  11. Okay well i did all that, and it's still just giving me the link to the page as an image. =/
  12. oh lol.. I feel stupid now, I was thinking "/full/path/to/" was a code, I should've known.. Lol ok well, right now I am using a free server, so would I actually need the "/home/username/" part? Okay.. yeah it's still not working =/
  13. They are all PNG, and here is all of my code: <?php $name = $_REQUEST['name']; $age = $_REQUEST['age']; $sports = $_REQUEST['sports']; $location = $_REQUEST['location']; // check to see if someone's hit generate already if( isset($name) == true && isset($age) == true && isset($sports) == true && isset($location) == true) { Header('Content-type: image/png'); Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT'); Header('Pragma: no-cache'); // check the location if($location == "school") { $image = imagecreatefrompng('/full/path/to/images/school.png'); } elseif($location == "work") { $image = imagecreatefrompng('/full/path/to/images/work.png'); } elseif($location == "mall") { $image = imagecreatefrompng('/full/path/to/images/mall.png'); } elseif($location == "library") { $image = imagecreatefrompng('/full/path/to/images/library.png'); } elseif($location == "market") { $image = imagecreatefrompng('/full/path/to/images/market.png'); } else { // we'll just set the default image to home $image = imagecreatefrompng('/full/path/to/images/home.png'); } // text ImageTTFText($image, 8, 0, 10, 17, $black, '/fonts/VAG Round.ttf', "Name: " . $name . "\nAge: " . $age . "\nSports: " . $sports); // output and destroy imagepng($image); imagedestroy($image); } // if not, go ahead and show the form else { print ("<!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\" lang=\"en\" xml:lang=\"en\"> <head> <title>Dynamic Signature Generator</title> <meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\" /> <style type=\"text/css\"> body { font-family: tahoma, verdana, arial; } img { verical-align: middle; border-style: none; } </style> </head> <body> <h1>Dynamic Signature Generator</h1> <form method=\"post\" name=\"sig\" action=\"sig.php\"> <small> Name: <input type=\"text\" name=\"name\" value=\"\" /><br /> Age: <input type=\"text\" name=\"age\" value=\"\" /><br /> Sports: <input type=\"text\" name=\"sports\" value=\"\" /><br /> Location: <select name=\"location\"> <option value=\"home\">Home</option> <option value=\"school\">School</option> <option value=\"work\">Work</option> <option value=\"library\">Library</option> <option value=\"mall\">Mall</option> <option value=\"market\">Market</option> </select><br /> <br /> <input type=\"submit\" value=\"Generate\" /> </small> </form> </body> </html>"); } ?> I want to make it, so that the location chosen, will make the image the background of the entire thing..
  14. Oh, I had the drop already, I just didn't add it, because I didn't think that was the problem. But thanks for the help with the syntax, it's starting to get cleaer now. I have been using this site, to get the basics of HTML/CSS/PHP/ASP etc: http://www.w3schools.com/php/default.asp Though it doesn't explain the kinda things I need, either that or I'm probably not thinking in general terms with the exmaples their using. Do you have any suggestions as to where I could read up on PHP? EDIT: Ok, i think I messed everything up. I put in the corrections like you wrote it, but the images that are suppose to be called are suppose to be the background of the sig. So after I put the code in, I went to test it out, I filled in the form, and pressed generate, and what came up with just the name of link (as an image) which usually means somethings wrong with the code. After trying everything O could think of, to get it to work, I ended up just removed the "if..elseif...else" code, and replacing everything back to normal. And it still just shows the link as an image =/ I keep going two steps up and 4 steps back =/
  15. I'm not quite sure what you want to know about arrays... But to answer your other questions... Read up on ImageTTFText here to manipulate the text: http://ca.php.net/manual/en/function.imagettftext.php Note that you can call ImageTTFText more than once to play in case you want to manipulate each line differently, for example: ImageTTFTextt($image, 8, 0, 10, 17, $black, '/path/to/font/file.ttf', "Name: " . $name); ImageTTFTextt($image, 8, 0, 20, 34, $black, '/path/to/font/file.ttf', "Age: " . $age); ImageTTFTextt($image, 10, 0, 30, 65, $black, '/path/to/font/file.ttf', "Sports: " . $sports); First off, this will not change the appearance of the first line. Secondly, it will shift the second line over further to the right by 10 pixels. Finally, the third line will be shifted downwards a bit more and will appear in size 10pt font instead of size 8pt. Oh, okay, thank you for that, now I have been been trying to get the (select) code to work with the .php, this is what im trying to do, could you point out what im doing wrong? $location = $_REQUEST['location'] { if('home') { $image = @imagecreatefrompng('images/home.png'); } if('school') { $image = @imagecreatefrompng('images/school.png'); } if('work') { $image = @imagecreatefrompng('images/work.png'); } if('mall') { $image = @imagecreatefrompng('images/mall.png'); } if('library') { $image = @imagecreatefrompng('images/library.png'); } if('market') { $image = @imagecreatefrompng('images/market.png'); } } // check to see if someone's hit generate already if( isset($name) == true && isset($age) == true && isset($sports) == true && isset($location) == true) ...skipping the stuff I haven't touched yet... // text ImageTTFText($image, 8, 0, 10, 17, $black, '/fonts/VAG Round.ttf', "Name: " . $name . "\nAge: " . $age . "\nSports: " . $sports . "\nLocation: " . $location); What I want to do, is for it to get the image of the selected location.. Again, I want to thank you for helping me =D
×
×
  • Create New...