Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. What you're asking for doesn't make sense. What about it doesn't make sense?  Are you passing $title and $title2 in the url?  If not, why are you using $_GET?
  2. It's not executing when the user presses the link in the page.  the session_destroy is executed when the page loads, regardless of wether the user clicks the link.
  3. There is no way we can provide any help without code.
  4. You can't execute php code from javascript, which is what you are trying to do.  [code]onMouseDown="<? session_destroy(); // Logoff Button ?>" [/code] As legohead said, you have to post to a page that destroys the session, then send them back to the page.
  5. use javascript... [code]die("<script>window.open(urlgoeshere,'','parametersgohere')</script>");[/code] Refer to one of the millions of pages for the arguements for window.open...such as: http://www.javascripter.net/faq/openinga.htm
  6. You're trying to post the form via Ajax, or are you just wanting to post the form normally?  If you want to post it like a normal page, then don't use js to submit it, use a submit button.  If you are trying to post using ajax, you will have to specify which form fields to post using js.
  7. I have loooked at that link, there is nothing special about their pagination. It has a previous link, followed by links to the pages, followed by a link to the next page.  What is advanced about that?
  8. hitman6003

    iframe

    Try this: iframe.html code: [code]<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form> <input type="text" name="text" id="text" size="20" /> </form> </body> </html>[/code] page.html code: [code]<html> <body> <script type="text/javascript"> function transfer() { var text = document.getElementById('txtbox').value; window.frames['i_frame'].document.getElementById('text').value = text; } </script> <form name="insert_form" method="post"> <input type="text" name="txt" id="txtbox"> <input name="insert_btn" type="button" value="Insert" onclick="transfer();"> </form> <IFRAME name="i_frame" id="i_frame" src="./iframe.html" frameborder="1"></IFRAME> </body> </html>[/code]
  9. I think this may be what you are looking for: [code]$query = "SELECT image_id,imagename,filename, DATE_FORMAT(datetime, '%W, %M %D') AS my_date FROM $sqltable WHERE cid = '$category' ORDER BY datetime"; $result = mysql_query($query) or die(mysql_error()); echo '<table>'; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { extract($row); if ($i = 5) { $i = 1; echo ' <tr> <td>&nbsp;<td> </tr>'; } echo ' <tr> <td><a href=\"viewphoto.php?id=$image_id\" title=\"Posted $my_date\"><b>$imagename</b><br><img src=\"files/thumbnails/$filename\" border=\"0\"></a></td> </tr>'; $i++; } echo '</table>';[/code]
  10. Prehaps I'm missing something, but I think you are making this more complicated than it should be. instead of having your form, that when it's submitted it's checked for errors.  If it passes error checking, the form is presented for confirmation and submitted to a different place.  If it fails error checking, it is presented for correction and submitted back to itself again. So, rather than trying to set the submit via javascript, set it in the normal action way, but have the action determined by your php.  Something like this: [code]<?php //WA eCart Include require_once("WA_eCart/chandlery_PHP.php"); require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); $chandlery->GetContent(); $postto = $_SERVER['PHP_SELF']; if (isset($_POST["Checkout"]))  {   $WAFV_Redirect = "checkout.php";   $_SESSION['WAVT_checkout'] = "";   if ($WAFV_Redirect == "")  {     $WAFV_Redirect = $_SERVER["SCRIPT_NAME"];   }   $WAFV_Errors = "";   $WAFV_Errors .= WAValidateRQ(((isset($_POST["Name"]))?$_POST["Name"]:"") . "",true,1);   $WAFV_Errors .= WAValidateEM(((isset($_POST["Email"]))?$_POST["Email"]:"") . "",true,2);   $WAFV_Errors .= WAValidateCC(((isset($_POST["CreditCardNo"]))?$_POST["CreditCardNo"]:"") . "","4:51:52:53:54:55:34:37:30:36:38:",true,3);   $WAFV_Errors .= WAValidateRQ(((isset($_POST["CreditCardType"]))?$_POST["CreditCardType"]:"") . "",true,4);   if ($WAFV_Errors != "")  {     PostResult($WAFV_Redirect,$WAFV_Errors,"checkout");   } else {   $postto = 'checkout_confirm.php';   } } // WA eCart Redirect if ($chandlery->redirStr != "")    {   header("Location: ".$chandlery->redirStr); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Newcastle Rigging & Chandlery</title> <?php $currentPageGroup = "images/nav/online_shop.gif"; if ($chandlery->DisplayInfo("Name") == "") { print "<script language=\"JavaScript\">"; print "window.location = 'shopping_cart.php?Action=checkoutFailed' "; print "</script>"; } ?> <link href="styles/nrc.css" rel="stylesheet" type="text/css"> <script type="text/JavaScript"> <!-- function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0   var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;    if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;   if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;   if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {     if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;} if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;} if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0;     features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}   if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";   if (window["popupWindow"] == null) window["popupWindow"] = new Array();   var wp = popupWindow.length;   popupWindow[wp] = window.open(theURL,winName,features);   if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;    if (document.all || document.layers || document.getElementById) {     if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}     if (alwaysOnTop && alwaysOnTop != "") {     ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);     popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }     if (autoCloseTime && autoCloseTime > 0) {     popupWindow[wp].document.body.onbeforeunload = function() {   if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);     window.onbeforeunload = null; }    autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }   window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }    document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true; } //--> </script> </head> <body> <div id="contents"> <table width="740" border="0" align="center" cellpadding="0" cellspacing="0">   <tr>     <td height="120">&nbsp;</td>   </tr>   <tr>     <td valign="top" class="content">       <h1>checkout</h1>       <form name="checkout_form" method="POST" action="<?php echo $postto; ?>">         <?php $chandlery_Index = $chandlery->DisplayIndex - 1;?>         <?php while (!$chandlery->EOF())      { $chandlery_Index ++;?> <input type="hidden" name="ID_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("ID") ?>"> <input type="hidden" name="Name_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("Name") ?>"> <input type="hidden" name="Description_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("Description") ?>"> <input type="hidden" name="Weight_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("Weight") ?>"> <input type="hidden" name="Quantity_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("Quantity") ?>"> <input type="hidden" name="Price_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("Price") ?>"> <input type="hidden" name="Colour_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("Colour") ?>"> <input type="hidden" name="Size_<?php echo $chandlery_Index; ?>" value="<?php echo $chandlery->DisplayInfo("Size") ?>"> <?php   $chandlery->MoveNext(); } $chandlery->MoveFirst(); ?>         <table cellpadding="0" cellspacing="0" class="tableForm">           <tr>             <th> Name</th>               <td><input name="Name" type="text" class="formTextField" value="<?php echo(ValidatedField("checkout","Name")) ?>"></td>               <td>   <?php if (ValidatedField("checkout","checkout"))  {   if ((strpos((",".ValidatedField("checkout","checkout").","), "," . "1" . ",") !== false || "1" == ""))  { if (!(false))  { ?>                 <img src="images/error.gif" width="14" height="14"> Please enter your name               <?php //WAFV_Conditional checkout.php checkout(1:) }   } } ?>   </td>             </tr>           <tr>             <th> Email</th>               <td><input name="Email" type="text" class="formTextField" value="<?php echo(ValidatedField("checkout","Email")) ?>"></td>               <td>   <?php if (ValidatedField("checkout","checkout"))  {   if ((strpos((",".ValidatedField("checkout","checkout").","), "," . "2" . ",") !== false || "2" == ""))  { if (!(false))  { ?> <img src="images/error.gif" width="14" height="14"> Please enter a valid email <?php //WAFV_Conditional checkout.php checkout(2:) }   } } ?>   </td>             </tr>           <tr>             <th> Credit Card No.</th>               <td><input name="CreditCardNo" type="text" class="formCreditCardField" value="<?php echo(ValidatedField("checkout","CreditCardNo")) ?>"></td>               <td>   <?php if (ValidatedField("checkout","checkout"))  {   if ((strpos((",".ValidatedField("checkout","checkout").","), "," . "3" . ",") !== false || "3" == ""))  { if (!(false))  { ?> <img src="images/error.gif" width="14" height="14"> Please enter your credit card number <?php //WAFV_Conditional checkout.php checkout(3:) }   } } ?>   </td>             </tr>           <tr>             <th> Card Type</th>               <td><select name="CreditCardType" class="formDropDownField" id="CreditCardType">                 <option value=" " <?php if (!(strcmp(" ", (ValidatedField("checkout","CreditCardType"))))) {echo "selected=\"selected\"";} ?>> </option>                 <option value="VISA" <?php if (!(strcmp("VISA", (ValidatedField("checkout","CreditCardType"))))) {echo "selected=\"selected\"";} ?>>VISA</option>                 <option value="MasterCard" <?php if (!(strcmp("MasterCard", (ValidatedField("checkout","CreditCardType"))))) {echo "selected=\"selected\"";} ?>>MasterCard</option>                 <option value="AMEX" <?php if (!(strcmp("AMEX", (ValidatedField("checkout","CreditCardType"))))) {echo "selected=\"selected\"";} ?>>AMEX</option>                 <option value="Diners" <?php if (!(strcmp("Diners", (ValidatedField("checkout","CreditCardType"))))) {echo "selected=\"selected\"";} ?>>Diners</option>               </select></td>               <td>   <?php if (ValidatedField("checkout","checkout"))  {   if ((strpos((",".ValidatedField("checkout","checkout").","), "," . "4" . ",") !== false || "4" == ""))  { if (!(false))  { ?> <img src="images/error.gif" width="14" height="14"> Please select your card type <?php //WAFV_Conditional checkout.php checkout(4:) }   } } ?>   </td>             </tr>           <tr>             <td>&nbsp;</td>               <td colspan="2" align="center"><input name="Checkout" type="submit" class="formCartButton" onMouseOver="this.className='formCartButtonOver';" onMouseOut="this.className='formCartButton';" value="Preview Purchase"></td>             </tr>           </table>       </form> </td>   </tr> </table> </div> </body> </html>[/code]
  11. semicolons are not required at the end of the line in javascript.  Php, yes, javascript, no.
  12. use an xml class like this one: http://minixml.psychogenic.com/ There are many others available.
  13. use a cookie. http://www.w3schools.com/js/js_cookies.asp
  14. write to the file, then close it, then read the contents. [code]fwrite($fh, $_POST['code']); fclose($fh); $data = file_get_contents($file); echo $data;[/code]
  15. Try this...I haven't, but it seems to be along the lines of what you want: http://www.phpclasses.org/browse/package/715.html
  16. [quote]I'd like something more advanced[/quote] Perhaps you can be a little more vague? Seriously though, what exactly do you want to change about the behavior your script, cause "more advanced" doesn't mean anything.
  17. what does the class KVPair do?  What is the code for it?  If you don't want to, or can't, post the code for it, then try not using it when building the array and see if you get the same error: [code]class SessionData{   var $kvPair = array('first_name' => 'Jason','last_name' => 'Bourne'); }[/code]
  18. [quote]I cannot use the standard form action becasue i am using server side validation[/quote] Why would that prevent you from using a the normal submit procedure?
  19. [quote]But, if I want to use a function that is PEAR or PECL, how do I do it?  Cut and Paste it from somewhere on my host?  Maybe call it with a tag?[/quote] Yes, include the script, then call the function or class. [quote]Also, how would I find out all of the extensions and libraries that my HOST has besides ask them?[/quote] Use phpinfo() or ask them.
  20. I don't think I've ever used dreamweaver's design view, I always use the code view.  I tend to use dreamweaver for simpler things because it's generally faster.  Zend is written using a lot of java (I think) which makes it slower, at least on every computer I've ever used it on.  I like Zend's ability to show me all of the classes, functions, constants, and files that are linked to the file I'm looking at.  It makes it much easier to find a particular piece of code quickly.  The analyze code function is also helpful sometimes, and when used with the Zend Server stuff, it can tell you an incredible amount of information about your scripts. If you create your own classes and functions, Zend will also offer the inline help for them...so if I create a function, for example: [code]function foo($bar1, $bar2) {... }[/code] When I call foo when I'm coding, Zend will remind me that the function requires $bar1 and $bar2...very helpful when you have a lot of functions.
  21. There are some differences between the two operating system's (win and linux) php installations...mostly in how dates and time and such are handled.  If you are careful, it shouldn't make a difference though. As far as IDEs are concerned, there are many.  I currently use a combination of Zend Studio and Dreamweaver 8, however I have also used Eclipse, JEdit, devPHP, and textpad, which are free/opensource.  A friend of mine has also been using Aptana recently and he likes it, however I have not used it.  Aptana is also open source I think...though I'm not positive.
  22. Another option would be array_multisort (http://www.php.net/array_multisort)
  23. Well, one way would be to format the key as the full name: [code]$file = file("faf.txt"); foreach ($file as $line) { $line = explode(",", $line); $name = $line[0] . ", " . $line[1] . ", " . $line[2]; $data[$name] = $line; } ksort($data);[/code]
  24. I was unfamiliar with that (magic_quotes_runtime) until just now...here's what the manual says about it: [quote]magic_quotes_runtime  boolean     If magic_quotes_runtime is enabled, most functions that return data from any sort of external source including databases and text files will have quotes escaped with a backslash. If magic_quotes_sybase is also on, a single-quote is escaped with a single-quote instead of a backslash. [/quote]
×
×
  • 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.