Jump to content

Bartman

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Bartman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank Joel24 for let me know I am in the right direction. Any idea how I would get it working with my form? <form id="websubmission" name="websubmission" method="post" action="index.php?action=submit"> <? if(!empty($_SESSION['websubmissionstatus'])){ echo $_SESSION['websubmissionstatus']."<br/>"; $_SESSION['websubmissionstatus']="";}?> <input name="title" type="text" id="title" style="font-family: Tahoma; border: 1px solid #184A7B; background-color: #FFFFFF" size="24" maxlength="75" value="Title"> <input name="url" type="text" id="url" style="font-family: Tahoma; border: 1px solid #184A7B; background-color: #FFFFFF" value="http://" size="50"> <select name="category" style="font-family: Arial; font-size: 10px; color: #000000; padding: 2px; border: 1px solid #666666; background-color: #FFFFFF"> <option value="0" selected>Select Type</option> <? echo submit_category_list();?> </select> <input name="Submit" type="submit" id="Submit" style="font-family: Arial; font-size: 10px; color: #000000; border: 1px solid #C0C0C0; background-color: #FFFFFF" value="Submit" /> </form> This part: <? if(!empty($_SESSION['websubmissionstatus'])){ echo $_SESSION['websubmissionstatus']."<br/>"; $_SESSION['websubmissionstatus']="";}?> shows the errors for when they do not add a proper Title, URL or don't choose a category. I would like the code in this post to work for my form so that it checks if the user has added a back link on their site already before they can submit my form. If they did not have a backlink the error would show up on the page where websubmission errors show or maybe a popup window that says No backlink found. Do you understand what I am trying to do? Can you point me in the right direction?
  2. Can someone please point me in the right direction on finding a script that will check for a back link before allowing the submission of a form? Maybe it is onclick or something to that nature. Thanks, I have been searching for days
  3. Will this work on a submission form? I just want the form to check for a back link before allowing the submission to be added to the mysql.
  4. Anyone? :'(
  5. Bump....Does anyone know of any other forums that have more javascript coders that might know how to get this working?
  6. Here is what I have if anyone can help me get it working. When I click on the Close [X] it does nothing. It just waits and after the seconds the IMAGE1 appears and IMAGE2 disappears. <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" bgcolor="#000000" height="350"> <tr> <td align="center"> <script type="text/javascript"> window.onload = function () { var tim = setTimeout(function () { var div = document.getElementById('hideOverlay'); div.innerHTML = 'IMAGE1 GOES HERE'; }, 6000);} </script> <div id="hideOverlay"> <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" height="350"> <tr> <td align="center" width="650" height="350"><a style="text-decoration: none" href="javascript:void(0)" onclick="javascript:window.clearTimeout('tim')"/>Close [x]</a><br>IMAGE2 GOES HERE</td> </tr> </table> </td> </tr> </table> </div> Any ideas why it will not work? Anyone?
  7. Can someone tell me how to make a close button for this? The close button I currently have here makes the IMAGE2 disappear but I cannot see IMAGE1 until the time runs out on the setTmeout. I want to be able to click the closeX and close out the whole script leaving IMAGE1 showing. Here is what I have: <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" bgcolor="#000000" height="350"> <tr> <td align="center"> <script type="text/javascript"> window.onload = function () { setTimeout(function () { var div = document.getElementById('hideOverlay'); div.innerHTML = '[b]IMAGE1 GOES HERE[/b]'; }, 6000);} </script> <div id="hideOverlay"> <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" height="350"> <tr> <td align="center" width="650" height="350"><a style="text-decoration: none" href="javascript:void(0)" onclick="var lyr =document.getElementById('hideOverlay'); lyr.innerHTML='';"/><font color="#666666" size="2">Close [x]</font></a>[b]IMAGE2 GOES HERE[/b]</td> </tr> </table></div> </td> </tr> </table> </div>
  8. the adss.js just has the ad network code with a close button... the ad.js has it appear for x amount of seconds before either closing or disappearing Don't I display this from the getElementById in a div? like <div id="Something Here"> Video </div>
  9. it is not an ad network. I want to put an ad in that code. I know how to do that...just want to know how to make that code appear on me site.. must be a div
  10. I have a javascript file called ad.js inside looks like this var ADPLACER_PATH = "http://www.mywebsite.com/"; var PREROLL_ENABLED = 1; var MIDROLL_ENABLED = 0; var PREROLL_ZONE_ID = 0; var MIDROLL_ZONE_ID = 0; var PREROLL_TIMEOUT_IN = 0; var PREROLL_TIMEOUT_OUT = 35000; var PREROLLCLOSEBUTTON_TIMEIN = 0; var MIDROLL_TIMEOUT_IN = 0; var MIDROLL_TIMEOUT_OUT = 3000000; var PREROLL_ONSHOW = function(C){ setTimeout(function(){document.getElementById('adplacer_prerollClose'+C).onclick()}, PREROLL_TIMEOUT_OUT); } var PREROLL_ONHIDE = function(){} document.write ("<scr"+"ipt type='text/javascript' src='"+ADPLACER_PATH+"adss.js'><\/scr"+"ipt>"); It places an ad over a video on my site. I know I can add the .js to my site by adding this <script type="text/javascript" src="ad.js"></script> to my head But what do I need to add to my page to make it appear? Do I have to put the video between a DIV? Can someone let me know what I need to do to make it appear? thanks
  11. OK Thanks for everyone's help I really, really appreciate it. Ok here exactly what it is I am trying to accomplish. I have 2 tables (listings & listimages) that I need to extract data from and display. There are a couple extra columns that I don't need to pull data from like price, date etc listings ------------------------------------------------------------------------------------------------------------------------------------------------------------------- id make model vehicle_type doors color mileage year listing_condition engine trans drive_train fuel_type adddesc stock ------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 make1 model1 vehicle_type1 doors1 color1 mileage1 year1 listing_condition1 engine1 trans1 drive_train1 fuel_type1 adddesc1 stock1 2 make2 model2 vehicle_type2 doors2 color2 mileage2 year2 listing_condition2 engine2 trans2 drive_train2 fuel_type2 adddesc2 stock2 3 make3 model3 vehicle_type3 doors3 color3 mileage3 year3 listing_condition3 engine3 trans3 drive_train3 fuel_type3 adddesc3 stock3 4 make4 model4 vehicle_type3 doors4 color4 mileage4 year4 listing_condition4 engine4 trans4 drive_train4 fuel_type4 adddesc4 stock4 listimages ---------------------------------------------------- id imagepath mainimage listingid ---------------------------------------------------- 1 images/listings/a1.jpg 1 1 2 images/listings/a2.jpg 0 1 3 images/listings/a3.jpg 0 1 4 images/listings/a4.jpg 0 1 5 images/listings/a5.jpg 0 1 6 images/listings/a6.jpg 0 1 7 images/listings/b1.jpg 1 2 8 images/listings/b2.jpg 0 2 9 images/listings/b3.jpg 0 2 10 images/listings/b4.jpg 0 2 11 images/listings/b5.jpg 0 2 12 images/listings/b6.jpg 0 2 13 images/listings/c1.jpg 1 4 Ok I need a php to display all the above information in simple rows on a page. So the 4 listings.id rows above will look like this on a page (I don't need the auto_increment number to shwo) make1,model1,vehicle_type1,doors1,color1,mileage1,year1,listing_condition1,engine1,trans1,drive_train1,fuel_type1,"adddesc1",stock1,"a1.jpg,a2.jpg,a3.jpg,a4.jpg,a5.jpg,a6.jpg" make2,model2,vehicle_type2,doors2,color2,mileage2,year2,listing_condition2,engine2,trans2,drive_train2,fuel_type2,"adddesc2",stock2,"b1.jpg,b2.jpg,b3.jpg,b4.jpg,b5.jpg,b6.jpg" make3,model3,vehicle_type3,doors3,color3,mileage3,year3,listing_condition3,engine3,trans3,drive_train3,fuel_type3,"adddesc3",stock3,"" make4,model4,vehicle_type4,doors4,color4,mileage4,year4,listing_condition4,engine4,trans4,drive_train4,fuel_type4,"adddesc4",stock4,"c1.jpg" right now when I use this code: <?php // Make a MySQL Connection mysql_connect("localhost", "XXXXXXXX", "XXXXXXXX") or die(mysql_error()); mysql_select_db("XXXXXXXX") or die(mysql_error()); $result = mysql_query("SELECT * FROM listings l LEFT JOIN listimages li ON l.id = li.listingid ORDER BY l.id DESC") or die(mysql_error()); $last_listingid = null; $curRow = array(); while($row = mysql_fetch_array($result)) { // Check for a difference in listing ID - and if it is, then we should show the previous row first if ($last_listingid != $row['listingid'] && $last_listingid !== null) { // Implode the array with quotes around it echo $row['year']; echo ","; echo $row['make']; echo ","; echo $row['model']; echo ","; echo $row['vehicle_type']; echo ","; echo $row['doors']; echo ","; echo $row['color']; echo ","; echo $row['mileage']; echo ","; echo $row['listing_condition']; echo ","; echo $row['engine']; echo ","; echo $row['trans']; echo ","; echo $row['drive_train']; echo ","; echo $row['fuel_type']; echo ","; echo "Please contact"; echo ",\""; echo $row['adddesc']; echo "\","; echo $row['stock']; echo ","; echo '"http://www.website.com/' . implode(',http://www.website.com/', $curRow) . '"<br />'; // And start fresh $curRow = array(); } // Now we can save it to the array $curRow[] = $row['imagepath']; // And set the new ID $last_listingid = $row['listingid']; } // Finally, we'll need to implode it one last time since there should always be at least one value in the array echo '"http://www.website.com/' . implode(',', $curRow) . '"'; ?> I get this outcome. (Notice the row that was blank for images is now replaced with the next image down? (c1.jpg should have stayed on 4) all the images from that point move up so no rows from 3 down match the rest of the content for the images. make1,model1,vehicle_type1,doors1,color1,mileage1,year1,listing_condition1,engine1,trans1,drive_train1,fuel_type1,"adddesc1",stock1,"a1.jpg,a2.jpg,a3.jpg,a4.jpg,a5.jpg,a6.jpg" make2,model2,vehicle_type2,doors2,color2,mileage2,year2,listing_condition2,engine2,trans2,drive_train2,fuel_type2,"adddesc2",stock2,"b1.jpg,b2.jpg,b3.jpg,b4.jpg,b5.jpg,b6.jpg" make3,model3,vehicle_type3,doors3,color3,mileage3,year3,listing_condition3,engine3,trans3,drive_train3,fuel_type3,"adddesc3",stock3,"c1.jpg" make4,model4,vehicle_type4,doors4,color4,mileage4,year4,listing_condition4,engine4,trans4,drive_train4,fuel_type4,"adddesc4",stock4,"d1.jpg,d2.jpg,d3.jpg"
  12. Hi scootstah, isn't my column listingid the image id column? There is both a auto_increment column and a listingid column. The listingid column numbers correspond with the auto_increment column from the Listings Table Duraso, the LEFT JOIN just outputs the same thing. I see where the error start. right after the row that does not have an image. So lets say the the ID number 5 has no images. All are fine up until 5 then ID number 6 images move up and are displayed with Number 5's info. Understand? Maybe there is a way to put something like if there is no images then display Default/images/no_image.gif Is that possible? I would rather have that row just display no images but if it is not possible then how about the Default/images/no_image.gif approach? Anyone?
  13. Wondering if someone could help me. What I am trying to do is display the information from each row. I am trying to read from 2 tables and display them on a page. I want them to show like this name,make,type, price,"images/listings/a1.jpg,images/listings/a2.jpg,images/listings/a3.jpg,images/listings/a4.jpg,images/listings/a5.jpg,images/listings/a5.jpg" name,make,type, price,"images/listings/b1.jpg,images/listings/b2.jpg,images/listings/b3.jpg,images/listings/b4.jpg,images/listings/b5.jpg,images/listings/b5.jpg" Example. the table structures are as so: listings -------------------------------- id name make type price (then a couple more columns I dont need data from) -------------------------------- 1 name1 make1 type1 price1 2 name2 make2 type2 price2 3 name3 make3 type3 price3 listimages ---------------------------------------------------- id imagepath mainimage listingid ---------------------------------------------------- 1 images/listings/a1.jpg 1 1 2 images/listings/a2.jpg 0 1 3 images/listings/a3.jpg 0 1 4 images/listings/a4.jpg 0 1 5 images/listings/a5.jpg 0 1 6 images/listings/a6.jpg 0 1 7 images/listings/b1.jpg 1 2 8 images/listings/b2.jpg 0 2 9 images/listings/b3.jpg 0 2 10 images/listings/b4.jpg 0 2 11 images/listings/b5.jpg 0 2 12 images/listings/b6.jpg 0 2 13 images/listings/c1.jpg 1 3 etc Here is the code I am using. Everything works except some of the listing images don't match up to the names. I think when certain names don't have pictures it just moves up the images to the next person. I need to somehow associate the listingid column from listimages table with the id column from the listings table. The mainimage column tells what image of the group of images is default for that name. 1 being the default 0 not the default Here is the code I am using. <?php // Make a MySQL Connection mysql_connect("localhost", "xxxxxx", "xxxxxx") or die(mysql_error()); mysql_select_db("xxxxxx") or die(mysql_error()); $result = mysql_query("SELECT * FROM listings l JOIN listimages li ON l.id = li.listingid ORDER BY l.id DESC") or die(mysql_error()); $last_listingid = null; $curRow = array(); while($row = mysql_fetch_array($result)) { // Check for a difference in listing ID - and if it is, then we should show the previous row first if ($last_listingid != $row['listingid'] && $last_listingid !== null) { // Implode the array with quotes around it echo $row['name']; echo ","; echo $row['make']; echo ","; echo $row['model']; echo ","; echo $row['type']; echo ","; echo $row['price']; echo ","; echo '"' . implode(',', $curRow) . '"<br />'; // And start fresh $curRow = array(); } // Now we can save it to the array $curRow[] = $row['imagepath']; // And set the new ID $last_listingid = $row['listingid']; } // Finally, we'll need to implode it one last time since there should always be at least one value in the array echo '"' . implode(',', $curRow) . '"'; ?> Please let me know what I am doing wrong Anyone Thanks
  14. Please does anyone know?
  15. Thanks for your help. here exactly is is what I am trying to do. I am trying to display the information from each row. I am trying to read from 2 tables and display them on a page. I want them to show like this name,make,type, price,"images/listings/a1.jpg,images/listings/a2.jpg,images/listings/a3.jpg,images/listings/a4.jpg,images/listings/a5.jpg,images/listings/a5.jpg" name,make,type, price,"images/listings/b1.jpg,images/listings/b2.jpg,images/listings/b3.jpg,images/listings/b4.jpg,images/listings/b5.jpg,images/listings/b5.jpg" Example. the table structures are as so: listings -------------------------------- id name make type price (then a couple more columns I dont need data from) -------------------------------- 1 name1 make1 type1 price1 2 name2 make2 type2 price2 3 name3 make3 type3 price3 listimages ---------------------------------------------------- id imagepath mainimage listingid ---------------------------------------------------- 1 images/listings/a1.jpg 1 1 2 images/listings/a2.jpg 0 1 3 images/listings/a3.jpg 0 1 4 images/listings/a4.jpg 0 1 5 images/listings/a5.jpg 0 1 6 images/listings/a6.jpg 0 1 7 images/listings/b1.jpg 1 2 8 images/listings/b2.jpg 0 2 9 images/listings/b3.jpg 0 2 10 images/listings/b4.jpg 0 2 11 images/listings/b5.jpg 0 2 12 images/listings/b6.jpg 0 2 13 images/listings/c1.jpg 1 3 etc Here is the code I am using. Everything works except some of the listing images don't match up to the names. I think when names don't have pictures it just moves up the images to the next person. I need to somehow associate the listingid column from listimages table with the id column from the listings table. The mainimage column tells what image of the group of images is default for that name. 1 being the default 0 not the default Here is the code I am using. <?php // Make a MySQL Connection mysql_connect("localhost", "xxxxxx", "xxxxxx") or die(mysql_error()); mysql_select_db("xxxxxx") or die(mysql_error()); $result = mysql_query("SELECT * FROM listings l JOIN listimages li ON l.id = li.listingid ORDER BY l.id DESC") or die(mysql_error()); $last_listingid = null; $curRow = array(); while($row = mysql_fetch_array($result)) { // Check for a difference in listing ID - and if it is, then we should show the previous row first if ($last_listingid != $row['listingid'] && $last_listingid !== null) { // Implode the array with quotes around it echo $row['name']; echo ","; echo $row['make']; echo ","; echo $row['model']; echo ","; echo $row['type']; echo ","; echo $row['price']; echo ","; echo '"' . implode(',', $curRow) . '"<br />'; // And start fresh $curRow = array(); } // Now we can save it to the array $curRow[] = $row['imagepath']; // And set the new ID $last_listingid = $row['listingid']; } // Finally, we'll need to implode it one last time since there should always be at least one value in the array echo '"' . implode(',', $curRow) . '"'; ?> Please let me know what I am doing wrong thanks.
×
×
  • 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.