Jump to content

phpbeginner

Members
  • Posts

    214
  • Joined

  • Last visited

Everything posted by phpbeginner

  1. I currently have a file management system using Zend framework. Everything has been working great with .pdf files in the 2-4 MB range (both on upload and download). There was a .pdf file that was about 7MB in size, which uploaded fine. When selecting the file to download, it completes in about 2 seconds and only downloads about 300KB. I checked on the server and the file actually did upload fine and was not corrupted BUT I cannot get beyond this file download issue. All other files (in 2-4 MB range) seem to download fine. Would it be a memory size issue? Would anyone know the issue or how I can correct? Thanks so much in advance
  2. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function popUp(URL,URL2) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL,'" + id + "', 'toolbar=0,scrollbars=1,location=0,top=10,left=10,statusbar=0,menubar=0,resizable=0,width=408,height=400');"); day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL2,'" + id + "', 'toolbar=0,scrollbars=1,location=0,top=10,left=450,statusbar=0,menubar=0,resizable=0,width=408,height=400');"); } // End --> </script> I have a map which shows sales people by location and if more then one sales person exists then I would need 2 pop up windows. This works great other than the fact that the areas with one sales person are getting a blank 2nd popup as a second salesperson does not exist. Any help would be appreciated. Thanks In Advance
  3. anyone know what I can do with the code to get the remainder of navigation items to display after the first drop down? Something in my code is hitting the first sub-navigation menu item, then not getting the remainder of the main menu items.......script ends after first Main Menu item with a drop down.
  4. Corrected issue, same problem............ <ul id="menu"> <?php $clsnm="active"; if (isset($_GET["id"])) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'events.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'gallery.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'news.php')) $clsnm="footerlink"; ?> <li class="<?php echo $clsnm;?>"><a href="index.php">Home</a></li> <li class="seplie"></li> <?php $sql = "SELECT id,title,links FROM tblmain where id > 1 and head='Yes' order by sorder asc"; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { $clsnm="footerlink"; $phppgname=$rs["links"]; if ((isset($_GET["id"])) && ($_GET["id"]==$rs["id"])) $clsnm="active"; if ($phppgname!="") { if (strstr($_SERVER['SCRIPT_NAME'],$phppgname)) $clsnm="active"; } if ($rs["links"]=="") $phppgname="contents.php?id=".$rs["id"]; ?> <li class='<?php echo $clsnm;?>'><a href='<?php echo $phppgname;?>'><?php echo $rs['title'];?></a> <?php if (isset($_GET["id"])); $sql = "SELECT id,title,subpageid FROM tblsubpage where subpageid=".$rs["id"]." order by id desc "; $reccount=$sq->numsrow($sql); if ($reccount > 0){ echo("<ul>"); $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <li><a href="subcontents.php?id=<?php echo $rs["subpageid"];?>&sid=<?php echo $rs["id"];?>"><?php echo $rs["title"];?></a></li> <?php } echo("</ul>"); } echo("<li class='seplie'></li>"); $pn++; } } ?> </ul>
  5. White_Lily, the issue is not creating the drop down. I have tested this one (jQuery) and it works fine in all browsers using standard coding techniques. I am having trouble with the PHP/MySQL coding I am using. I can create a standard horizontal menu and even get it working til the first drop down menu, once it gets to the first drop down menu and it actually works, it stops display the other main menu items beyond that in the horizontal display. As an example, in my test menu I have Home, About Us, Services, and Contact. I have 2 drop down items on services and once it gets there, then Contact menu item does not display. I am doing something wrong in my code below. ///Where main menu starts/// <ul id="menu"> <?php $clsnm="active"; if (isset($_GET["id"])) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'events.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'gallery.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'news.php')) $clsnm="footerlink"; ?> <li class="<?php echo $clsnm;?>"><a href="index.php">Home</a></li> <li class="seplie"></li> <?php $sql = "SELECT id,title,links FROM tblmain where id > 1 and head='Yes' order by sorder asc"; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { $clsnm="footerlink"; $phppgname=$rs["links"]; if ((isset($_GET["id"])) && ($_GET["id"]==$rs["id"])) $clsnm="active"; if ($phppgname!="") { if (strstr($_SERVER['SCRIPT_NAME'],$phppgname)) $clsnm="active"; } if ($rs["links"]=="") $phppgname="contents.php?id=".$rs["id"]; ?> /// Main menu items/// <li class='<?php echo $clsnm;?>'><a href='<?php echo $phppgname;?>'><?php echo $rs['title'];?></a> ///Sub Menu Items Start///<? php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "SELECT id,title,subpageid FROM tblsubpage where subpageid=".$rs["id"]." order by id desc "; $reccount=$sq->numsrow($sql); if ($reccount > 0){ echo("<ul>"); $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> ///Sub Menu Items Display/// <li><a href="subcontents.php?id=<?php echo $rs["subpageid"];?>&sid=<?php echo $rs["id"];?>"><?php echo $rs["title"];?></a></li> <?php } echo("</ul>"); } echo("<li class='seplie'></li>"); ///Sub Menu Ends/// $ pn++; } } ?> ///Main Menu Ends </ul>
  6. It's a navigation menu. Right now I have this and it works until it gets to first drop down menu....... (ie: shows Home, About Us, Services) under services it drops down as it should to show sub-categories. Then it stops and does not display any more Main Menu items after Services. <ul id="menu"> <?php $clsnm="active"; if (isset($_GET["id"])) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'events.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'gallery.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'news.php')) $clsnm="footerlink"; ?> <li class="<?php echo $clsnm;?>"><a href="index.php">Home</a></li> <li class="seplie"></li> <?php $sql = "SELECT id,title,links FROM tblmain where id > 1 and head='Yes' order by sorder asc"; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { $clsnm="footerlink"; $phppgname=$rs["links"]; if ((isset($_GET["id"])) && ($_GET["id"]==$rs["id"])) $clsnm="active"; if ($phppgname!="") { if (strstr($_SERVER['SCRIPT_NAME'],$phppgname)) $clsnm="active"; } if ($rs["links"]=="") $phppgname="contents.php?id=".$rs["id"]; ?> <li class="<?php echo $clsnm;?>"><a href="<?php echo $phppgname;?>"><?php echo $rs["title"];?></a> <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "SELECT id,title,subpageid FROM tblsubpage where subpageid=".$rs["id"]." order by id desc "; $reccount=$sq->numsrow($sql); if ($reccount > 0){ echo("<ul>"); ?> <?php $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <li><a href="subcontents.php?id=<?php echo $rs["subpageid"];?>&sid=<?php echo $rs["id"];?>"><?php echo $rs["title"];?></a></li> <?php } echo("</ul>"); } ?> <li class="seplie"></li> <?php $pn++; } } ?> </ul>
  7. no errors.......just blank. If I add the sub navigation (which is what I am trying to use in the dropdown) to the left hand column, it displays fine. <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "SELECT id,title,subpageid FROM tblsubpage where subpageid=".$pnds." order by id desc "; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <ul><li><a href="subcontents.php?id=<?php echo $rs["subpageid"];?>&sid=<?php echo $rs["id"];?>"><?php echo $rs["title"];?></a></li> <?php } } ?></ul>
  8. I have been trying to build a drop down menu with php and data from MySQL database but cannot seem to get it to work. I have the horizontal (main categories) displaying but the drop downs are not working. Appreciate any help and thanks in advance. <ul id="menu"> <?php $clsnm="active"; if (isset($_GET["id"])) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'events.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'gallery.php')) $clsnm="footerlink"; if (strstr($_SERVER['SCRIPT_NAME'],'news.php')) $clsnm="footerlink"; ?> <li class="<?php echo $clsnm;?>"><a href="index.php">Home</a></li> <li class="seplie"></li> <?php $sql = "SELECT id,title,links FROM tblmain where id > 1 and head='Yes' order by sorder asc"; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { $clsnm="footerlink"; $phppgname=$rs["links"]; if ((isset($_GET["id"])) && ($_GET["id"]==$rs["id"])) $clsnm="active"; if ($phppgname!="") { if (strstr($_SERVER['SCRIPT_NAME'],$phppgname)) $clsnm="active"; } if ($rs["links"]=="") $phppgname="contents.php?id=".$rs["id"]; ?> <li class="<?php echo $clsnm;?>"><a href="<?php echo $phppgname;?>"><?php echo $rs["title"];?></a> </li> <li class="seplie"></li> <?php $pn++; } } ?> <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "SELECT id,title,subpageid FROM tblsubpage where subpageid=".$pnds." order by id desc "; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <ul><li><a href="subcontents.php?id=<?php echo $rs["subpageid"];?>&sid=<?php echo $rs["id"];?>"><?php echo $rs["title"];?></a></li> <?php } } ?></ul> </ul>
  9. Any idea how I can add the cleanup code onClick?
  10. I have a CMS with basic toolbar and have major issues with copying and pasting from MS Word. I have a code below that I would like to test cleaning up MS Word.... <?php function word_cleanup ($str) { $pattern = "/<(\w+)>(\s| )*<\/\1>/"; $str = preg_replace($pattern, '', $str); return mb_convert_encoding($str, 'HTML-ENTITIES', 'UTF-8'); } ?> And would like to add it onClick within code below, but it doesn't seem to do anything...... <?php //we will have to dynamically generate either the edit and delete buttons or //the save button here depending on numevent. if($numMain!=-1) { echo("<tr><td colspan='2' align='center'><input type='submit' id='button' name='edit' value='Save Changes' onClick=\"saveChanges('edit'); onClick=\"function('word_cleanup');\"><input type='submit' id='button' name='delete' value='Delete' onClick=\"saveChanges('delete');\"></td></tr></table></form>"); } else { echo("<tr><td colspan='2' align='center'><input type='submit' id='button' name='save' value=' Save ' onClick=\"saveChanges('save'); onClick=\"function('word_cleanup');\"></td></tr></table></form>"); } ?> Any help, tips, suggestions would be so greatly appreciated.
  11. YAY! It worked! Thanks for all your help, I appreciate it!!
  12. My initial query works fine, displaying the results of subsectors. $sql = "select * from tblsub WHERE catid='$view' ORDER BY subsec "; However to list all the businesses under the correct subsector, I am using this.... $rs=mysql_query("SELECT tblbusiness.*, tblsub.* FROM tblbusiness JOIN tblsub WHERE tblbusiness.category = tblsub.subsec AND tblsub.catid='$view'"); As the common fld between the 2 tables is tblbusiness.category and tblsub.subsec
  13. Still shows all listings under each subsector. With my quesry I am trying to match the tblbusiness.category with the tblsub.subsec and also tblsub.catid = "$view". It displays only all lsitings as if it was simply tblsub.catid = "$view".
  14. Here is something I just tried......the only thing is it lists all the subsector businesses under each subsector and did not sepearte them as per subsector. <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "select * from tblsub WHERE catid='$view' ORDER BY subsec "; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <li><a href="listings.php?view=<?php echo $rs["subsec"];?>"><?php echo $rs["subsec"];?></a></li> <p> <?php $rs=mysql_query("SELECT tblbusiness.*, tblsub.* FROM tblbusiness JOIN tblsub WHERE tblbusiness.category = tblsub.subsec AND tblsub.catid='$view'"); while($row=mysql_fetch_row($rs)){ foreach ($row as $k => $v){ $row[$k] = nl2br($v); } echo("" . $row[2] . " | "); } ?> </p> <?php } } ?> </ul>
  15. My latest attempt, to no avail......... <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "select * from tblsub WHERE catid='$view' ORDER BY subsec "; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <li><a href="listings.php?view=<?php echo $rs["subsec"];?>"><?php echo $rs["subsec"];?></a></li> <p> <?php $rs=mysql_query("SELECT tblbusiness.category, tblsub.subsec FROM tblbusiness JOIN tblsub WHERE tblbusiness.category = tblsub.subsec AND tblsub.catid='$view'"); while($row=mysql_fetch_row($rs)){ foreach ($row as $k => $v){ $row[$k] = nl2br($v); } echo("" . $row[2] . " | "); } ?> </p> <?php } } ?> </ul>
  16. I now have this much....it lists the subsectors but as you can see I just grabbed the info from tblbusiness WHERE category= 'Bed and Brekfast' while I am trying to grab from tblbusiness WHERE category = from tblsub WHERE catid='$view' <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "select * from tblsub WHERE catid='$view' ORDER BY subsec "; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <li><a href="listings.php?view=<?php echo $rs["subsec"];?>"><?php echo $rs["subsec"];?></a></li> <p> <?php $rs=mysql_query("SELECT * FROM tblbusiness WHERE category = 'Bed and Breakfast'"); while($row=mysql_fetch_row($rs)){ foreach ($row as $k => $v){ $row[$k] = nl2br($v); } echo("" . $row[2] . " | "); } ?> </p> <?php } } ?>
  17. I am trying to now list the business names under each subsector...... Select from tblbusiness where category is equal to tblsub subsector
  18. Latest effort........ <?php $rs=mysql_query("select name, category from tblbusiness ORDER BY name, tblsub WHERE subsec=category "); while($row=mysql_fetch_row($rs)){ foreach ($row as $k => $v){ $row[$k] = nl2br($v); } echo("" . $row[name] . ""); } ?>
  19. I have 3 tables (sectors, subsectors, and business). From the site a site user can select a sector, which then lists the subsectors, then when they select a sub sector they can view a list of the businesses within the selection. I am trying to remove a step so that they will see the sectors and be able to select, then will list the subsectors with the business names under the subsectors. The code I have is prior to removing the step is ...... <?php $rs=mysql_query("select * from tblmain WHERE id='$view'"); while($row=mysql_fetch_row($rs)){ foreach ($row as $k => $v){ $row[$k] = nl2br($v); } echo("<h4>" . $row[1] . " Sectors </h4>"); } ?> <ul> <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "select * from tblsub WHERE catid='$view' ORDER BY subsec "; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <li><a href="listings.php?view=<?php echo $rs["subsec"];?>"><?php echo $rs["subsec"];?></a></li> <?php } } ?> </ul> I have tried to get this to work but the problem I am having is $view is an number but the actual business table is not id, it is by subsector name. I have tried ....... <?php $rs=mysql_query("select * from tblmain WHERE id='$view'"); while($row=mysql_fetch_row($rs)){ foreach ($row as $k => $v){ $row[$k] = nl2br($v); } echo("<h4>" . $row[1] . " Sectors </h4>"); } ?> <ul> <?php $pnds=1; if (isset($_GET["id"])) $pnds=$_GET["id"]; $sql = "select * from tblsub WHERE catid='$view' ORDER BY subsec "; $reccount=$sq->numsrow($sql); if ($reccount > 0) { $ata =$sq->query($sql); while($rs=$sq->fetch($ata)) { ?> <li><a href="listings.php?view=<?php echo $rs["subsec"];?>"><?php echo $rs["subsec"];?></a></li> <?php $rs=mysql_query("select * from tblbusiness WHERE category='$view' ORDER BY name"); while($row=mysql_fetch_row($rs)){ foreach ($row as $k => $v){ $row[$k] = nl2br($v); } print(" . $row[2] . "); } <?php } } ?> </ul> But obviously category is by name and not $view which is an id. Any help would be greatly appreciated.
  20. I am using the following code to sort by Year. It displays the current year fine and current year also displays in selection but does give the option for the previous years selection. <form action="archivednews.php" method="post"> <select name="year" id="year"> <?PHP for($i=date("Y"); $i<=date("Y"); $i++) if($year == $i) echo "<option value='$i' selected>$i</option>"; else echo "<option value='$i'>$i</option>"; ?> </select> <input type="submit" value="GO"> </form>
  21. Very well explained and working fine! I thank you very much for your time.
  22. I am trying to get sql result based on a specific subpage id and also using the like. The subpage id does not seem to work and have tried to different codes below......any help would be appreciated. $sqlItem = "select * from tblsubpage WHERE subpageid='5' || title like \"%".$searchfor."%\" || paragraph like \"%".$searchfor."%\""; and also tried $sqlItem = "select * from tblsubpage WHERE subpageid='5' AND title like \"%".$searchfor."%\" || paragraph like \"%".$searchfor."%\"";
  23. sorry the ouput is actual time, date is working fine.
×
×
  • 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.