Jump to content

cdoggg94

Members
  • Posts

    158
  • Joined

  • Last visited

Everything posted by cdoggg94

  1. Yes I never really thought it was a great idea either...but it was what he wanted.. I talked him out of it, but thanks you all for the comments!
  2. cdoggg94

    Text Stretch

    My boss has made a design in Photoshop where the text he is using has an 80% vertical stretch, and a 120% horizontal stretch. I don't want to use graphics for this, but can't seem to find any thing in CSS to this this the way he wants it. Is there a rule that will do this ?
  3. I have it working like this: <?php mysql_query("INSERT INTO soccer_dates (date_id, date_name, date_date, date_time, date_content, date_email) VALUES ('', '".$_POST['name']."', '".$_POST['date']."','".$_POST['time']."','".$_POST['comments']."','')"); $parent = mysql_insert_id(); //$whoCat = print_r($_POST['who']); //$whoCat = substr(implode(‘, ‘, $_POST['tags']), 0); foreach($_POST['who'] as $option_key => $option_name) { mysql_query("INSERT INTO soccer_dates_who (who_id, who_parent, who_who) VALUES ('', '".$parent."', '".$option_name."')"); } echo "<br /><br />Thank you for uploading<br /><br />"; ?> Everything seems to be inserting correctly in both tables. Is this a good way of doing it ? or is there an obvious flaw ? Im just happy right now that it's working...
  4. ok thanks I am going to look that up and try a few things
  5. I took the enctype="multipart/form-data" out...not sure why it was there..
  6. I have a form that looks like this: <form name="form" action="multiCheck2.php" method="POST" enctype="multipart/form-data"> <table width="381" border="0"> <tr> <td colspan="2">Dates Name: <input name="name" type="text" size="39" /></td> </tr> <tr> <td>Date: <input name="date" type="text" /></td> <td> Time: <input name="time" type="text" /></td> </tr> <tr> <td colspan="2">Additional Information:<br /> <textarea name="comments" cols="45" rows="7"></textarea></td> </tr> <tr> <td> Whos is this for ? <br /> <p> <label> <input type="checkbox" name="who[]" value="Coaches" /> Coaches</label> <br /> <label> <input type="checkbox" name="who[]" value="Conveners" /> Conveners</label> <br /> <label> <input type="checkbox" name="who[]" value="Officials" /> Officials (Both)</label> <br /> <label> <input type="checkbox" name="who[]" value="Ref" /> Ref</label> <br /> <label> <input type="checkbox" name="who[]" value="Linesmen" /> Linesmen</label> <br /> <label> <input type="checkbox" name="who[]" value="Admin" /> Admin</label> <br /> <label> <input type="checkbox" name="who[]" value="All" /> All</label> <br /> </p> </td> <td valign="bottom" align="right"> <br /><br /> <input name="submit" type="submit" value="ADD UPDATE" /></td> </tr> </table> <input type="hidden" name="MM_insert" value="form" /> </form> I have 2 tables I want to interact with. One is called "soccer_dates" and the other is called "soccer_dates_who". I want soccer_dates to take the values (without the date_who) and insert that information. I have this working fine... In the soccer_dates_who, I want to take the new ID from the newly created soccer_dates entry and insert it, along with the the value from the checked boxes. Also, if there is more then one box checked, i want to make it so there is a new entry in soccer_dates_who for each checked box.. I have been working on this for a few days and but biggest issue is getting the new ID from soccer_dates and putting it into the new table all in one go. I can do it in 2 different pages, but it adds an extra step. Does anyone have any advice ? Im not really even sure what to look up for examples..
  7. Thank you for the help! I have one more question though.. Do I still need the "date_who" column in the old table ? Seems like I don't...
  8. Sorry if my questions are annoying, but I just want to be clear.. Basically i would have an insert to the same table i have now, inserting the same content. Then have another table which holds the ID number of the new entry in the old table, the type, and its own ID ? Does that sound right ?
  9. With the data normalization, it basically says in my case that it would be best to add them like this: (if coaches, officials and admin are selected..) it inserts as 3 entries, one for each date_who value What do i call that type of insert? or i guess how do i tell the insert to add 3 entries instead of 1 ?
  10. I have a form with a check box like this: <label> <input type="checkbox" name="CheckboxGroup1" value="Coaches" id="CheckboxGroup1_0" /> Coaches</label> <br /> <label> <input type="checkbox" name="CheckboxGroup1" value="Conveners" id="CheckboxGroup1_1" /> Conveners</label> <br /> <label> <input type="checkbox" name="CheckboxGroup1" value="Officials" id="CheckboxGroup1_2" /> Officials (Both)</label> <br /> <label> <input type="checkbox" name="CheckboxGroup1" value="Ref" id="CheckboxGroup1_2" /> Ref</label> <br /> <label> <input type="checkbox" name="CheckboxGroup1" value="Linesmen" id="CheckboxGroup1_2" /> Linesmen</label> <br /> <label> <input type="checkbox" name="CheckboxGroup1" value="Admin" id="CheckboxGroup1_3" /> Admin</label> <br /> <label> <input type="checkbox" name="CheckboxGroup1" value="All" id="CheckboxGroup1_4" /> All</label> Basically right now when I insert it, it accepts the lowest check box selected if multiple ones are checked. I was wondering: 1) How to accept ALL of the checked values instead of only the lowest. 2) What is the best way to handle the data...When I had a radio group, i had the information going into a column called "date_who". With that information I could choose which group of people saw the specific information in the table. I now want to be able to select multiple people but not "All". I guess the question is; should I have the information in one cell? (i.e - date_who = 'Coaches, Admin, Linesmen') or should i have a separate one for each ? (i.e date_coaches = 'Coaches' , date_converners = '' , date_officials = '' , date_ref = '' , date_linesmen = 'Linesmen' , date_admin = 'Admin' , date_all = '') Attached is an image that might help explain it a little
  11. I have been googling, and can't really find what I want. Basically I want to know if there is a way to restrict the number of characters I display at any time eg: If I have this in a database: "Lorem ipsum dolor sit amet, magna ac pellentesque tellus in, aliquam amet sapien, vitae nec purus pellentesque ligula sit orci. Praesent netus pellentesque nulla. Donec nec urna in, vel molestie. Sed mus eu ultricies sed, eleifend placerat suspendisse id, cras vivamus quam, velit ac suspendisse nonummy porttitor urna, volutpat dignissim quis. Sed varius nam orci ultrices." I and i only want to display this (just a preview of the full story): "Lorem ipsum dolor sit amet, magna ac pellentesque tellus in, aliquam amet sapien, vitae nec purus pellentesque ligula sit orci." The way I display it on a page would be something like this: <?php echo $row_Display['some_text'] ;?> is there anything I can do for this? In the past when I wanted to do this, I just inserted the text block into two different columns in the db and restricted the char count there.
  12. I ended up with this: // user data $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png'; QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); //copy image to images folder copy($PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png', 'images/test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png'); and it seemed to have worked pretty good ! but its only copied so yea I am going to have to clean out the temp folder from time to time Thanks a lot for the help
  13. Thank you I am going to try a few things right now! I appreciate the help
  14. there is also a file in the library called "qrimage.php" which is attached to the "qrlib.php" file. the code on this page is this: <?php define('QR_IMAGE', true); class QRimage { //---------------------------------------------------------------------- public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE) { $image = self::image($frame, $pixelPerPoint, $outerFrame); if ($filename === false) { Header("Content-type: image/png"); ImagePng($image); } else { if($saveandprint===TRUE){ ImagePng($image, $filename); header("Content-type: image/png"); ImagePng($image); }else{ ImagePng($image, $filename); } } ImageDestroy($image); } //---------------------------------------------------------------------- public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) { $image = self::image($frame, $pixelPerPoint, $outerFrame); if ($filename === false) { Header("Content-type: image/jpeg"); ImageJpeg($image, null, $q); } else { ImageJpeg($image, $filename, $q); } ImageDestroy($image); } //---------------------------------------------------------------------- private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4) { $h = count($frame); $w = strlen($frame[0]); $imgW = $w + 2*$outerFrame; $imgH = $h + 2*$outerFrame; $base_image =ImageCreate($imgW, $imgH); $col[0] = ImageColorAllocate($base_image,255,255,255); $col[1] = ImageColorAllocate($base_image,0,0,0); imagefill($base_image, 0, 0, $col[0]); for($y=0; $y<$h; $y++) { for($x=0; $x<$w; $x++) { if ($frame[$y][$x] == '1') { ImageSetPixel($base_image,$x+$outerFrame,$y+$outerFrame,$col[1]); } } } $target_image =ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint); ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); ImageDestroy($base_image); return $target_image; } } could this be where I would add the upload file script ?
  15. I take it this is a really weird question from the amount of responses
  16. So I have been given some code to generate a QR code image so what ever you want the QR to display and its working fine now. What I want to do, is take the file it creates and upload it to my /images/ folder, and ALSO take some of the form information and INSERT it into my database. This is the QR Generator Code: <?php echo "<h1>PHP QR Code</h1><hr/>"; //set it to writable location, a place for temp generated PNG files $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR; //html PNG location prefix $PNG_WEB_DIR = 'temp/'; include "qrlib.php"; //ofcourse we need rights to create temp dir if (!file_exists($PNG_TEMP_DIR)) mkdir($PNG_TEMP_DIR); $filename = $PNG_TEMP_DIR.'test.png'; //processing form input //remember to sanitize user input in real-life solution !!! $errorCorrectionLevel = 'L'; if (isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L','M','Q','H'))) $errorCorrectionLevel = $_REQUEST['level']; $matrixPointSize = 4; if (isset($_REQUEST['size'])) $matrixPointSize = min(max((int)$_REQUEST['size'], 1), 10); if (isset($_REQUEST['data'])) { //it's very important! if (trim($_REQUEST['data']) == '') die('data cannot be empty! <a href="?">back</a>'); // user data $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png'; QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); } else { //default data echo 'You can provide data in GET parameter: <a href="?data=like_that">like that</a><hr/>'; QRcode::png('PHP QR Code ', $filename, $errorCorrectionLevel, $matrixPointSize, 2); } //display generated file echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" /><hr/>'; //config form echo '<form action="index.php" method="post"> <table border="0"> <tr> <td>Name: </td><td><input type="text" name="name" id="name"/></td> </tr> <tr> <td>Content: </td><td><textarea name="content" cols="45" rows="15"></textarea></td> </tr> <tr> <td>Data: </td><td><input name="data" value="'.(isset($_REQUEST['data'])?htmlspecialchars($_REQUEST['data']):'PHP QR Code ').'" /></td> </tr> <tr> <td>ECC: </td><td><select name="level"> <option value="L"'.(($errorCorrectionLevel=='L')?' selected':'').'>L - smallest</option> <option value="M"'.(($errorCorrectionLevel=='M')?' selected':'').'>M</option> <option value="Q"'.(($errorCorrectionLevel=='Q')?' selected':'').'>Q</option> <option value="H"'.(($errorCorrectionLevel=='H')?' selected':'').'>H - best</option> </select></td> </tr> <tr> <td>Size: </td><td><select name="size">'; for($i=1;$i<=10;$i++) echo '<option value="'.$i.'"'.(($matrixPointSize==$i)?' selected':'').'>'.$i.'</option>'; echo '</select></td></tr> <tr> <td> </td> <td><input type="submit" value="GENERATE"></td> </tr> </table> </form> <hr/>'; // benchmark QRtools::timeBenchmark(); ?> Below was my idea of how to upload and insert...but i dont know what value to give the $showname because it usually comes from a form. <?php echo "<h1>PHP QR Code</h1><hr/>"; //set it to writable location, a place for temp generated PNG files $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR; //html PNG location prefix $PNG_WEB_DIR = 'temp/'; include "qrlib.php"; //ofcourse we need rights to create temp dir if (!file_exists($PNG_TEMP_DIR)) mkdir($PNG_TEMP_DIR); $filename = $PNG_TEMP_DIR.'test.png'; //processing form input //remember to sanitize user input in real-life solution !!! $errorCorrectionLevel = 'L'; if (isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L','M','Q','H'))) $errorCorrectionLevel = $_REQUEST['level']; $matrixPointSize = 4; if (isset($_REQUEST['size'])) $matrixPointSize = min(max((int)$_REQUEST['size'], 1), 10); if (isset($_REQUEST['data'])) { //it's very important! if (trim($_REQUEST['data']) == '') die('data cannot be empty! <a href="?">back</a>'); // user data $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png'; QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); } else { //default data echo 'You can provide data in GET parameter: <a href="?data=like_that">like that</a><hr/>'; QRcode::png('PHP QR Code ', $filename, $errorCorrectionLevel, $matrixPointSize, 2); } //display generated file echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" /><hr/>'; //------------------------------------------------------------------------------upload/insert------------------------------------------------------ set_time_limit(0); require_once("Connections/busloreConnect.php"); mysql_select_db("db_businesslore_com"); $name = $_POST['name']; $content = $_POST['content']; $filetype = $_FILES['pic']['type']; if($filetype == "image/png") { $target_path = "images/".$target_path.basename( $_FILES['pic']['name']); $showname = basename( $_FILES['pic']['name']);//-----------------*****************i dont know which value to give this***********---------------------// if(move_uploaded_file($_FILES['pic']['tmp_name'], $target_path)) { $querystring = "INSERT INTO qr_generator(qr_id,qr_name,qr_content,qr_pic) VALUES(NULL,'".$name."','".$content."','".$showname."')"; $doquery = mysql_query($querystring); echo ""; } else{ echo "There was an error uploading the file, please try again!"; } } //------------------------------------------------------------------------------------------------------------------------------------------------- //config form echo '<form action="index.php" method="post"> <table border="0"> <tr> <td>Name: </td><td><input type="text" name="name" id="name"/></td> </tr> <tr> <td>Content: </td><td><textarea name="content" cols="45" rows="15"></textarea></td> </tr> <tr> <td>Data: </td><td><input name="data" value="'.(isset($_REQUEST['data'])?htmlspecialchars($_REQUEST['data']):'PHP QR Code ').'" /></td> </tr> <tr> <td>ECC: </td><td><select name="level"> <option value="L"'.(($errorCorrectionLevel=='L')?' selected':'').'>L - smallest</option> <option value="M"'.(($errorCorrectionLevel=='M')?' selected':'').'>M</option> <option value="Q"'.(($errorCorrectionLevel=='Q')?' selected':'').'>Q</option> <option value="H"'.(($errorCorrectionLevel=='H')?' selected':'').'>H - best</option> </select></td> </tr> <tr> <td>Size: </td><td><select name="size">'; for($i=1;$i<=10;$i++) echo '<option value="'.$i.'"'.(($matrixPointSize==$i)?' selected':'').'>'.$i.'</option>'; echo '</select></td></tr> <tr> <td> </td> <td><input type="submit" value="GENERATE"></td> </tr> </table> </form> <hr/>'; // benchmark QRtools::timeBenchmark(); ?> Can anyone let me know if I am on the right track ? or more likely.... way off?
  17. Does anyone know if there is something I can buy or use that would automatically create a QR code for a page I'm making? Basically I have a form that creates a story and will go to a link like this: website.com/article.php?Story=100 I would want to make the "website.com/article.php?Story=" part of the link static, and the number, the id..or something unique.. Right now i would have to create the story, copy the link, go to another site, create the QR, save the image, upload it to my server... Hopefully that makes sense. Is there anywhere I can find something that does this automatically when i submit my form? I would buy it, or if its free credit the company/person that made it obviously.
  18. my server went down for a while so i couldnt test it....now that i changed it over it works perfect thanks
  19. that make a lot more sense haha
  20. I just have a question, where does $product get it value ? the code asks if its empty or blank, but i dont get where its getting its value, which I think should be the content i want to display..
  21. @PFMaBiSmAd , Thank you I will try it right now
×
×
  • 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.