Jump to content

batwimp

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by batwimp

  1. It sounds like you want to use something like array_combine() http://us2.php.net/manual/en/function.array-combine.php
  2. Could you post the code that includes the containing divs a few levels up?
  3. If you look at the last example in example #1, they seem to have inserted a value with array_splice by using an offset of zero.
  4. And once you do get it running, stick a semi-colon at the end of your include statement there...
  5. According to my editing software, the for loop ends before the UPDATE is done. "Inconceivable" is a quote from the same movie xyph was (sort of) quoting. Just for fun.
  6. Your array offset $i doesn't exist outside your for loop, so not sure what its value will be in your UPDATE statement.
  7. You should put your code inside code tags to make it more readable.
  8. This probably won't solve your immediate problem, but you need to put breaks in your switch: switch ($a) { case "home": include("frontpage/main.php"); break case "user-process": include("user-process.php"); break; }
  9. Sorry. I was actually quoting this line of code: <?php if(isset($_POST['sub_comment_reply']) && $post_count >= $max_reply_per_day && $valid = false) { I didn't realize what I had typed was a complete line of code from another part of the file. You need to change THIS line so that (I'm assuming you want): <?php if(isset($_POST['sub_comment_reply']) && $post_count >= $max_reply_per_day && $valid != false) { or it may be: <?php if(isset($_POST['sub_comment_reply']) && $post_count >= $max_reply_per_day && $valid == false) { Either way, the code you have now will set the $valid variable to false no matter what, and the IF statement will fail.
  10. I don't know if this will fix your problem, but you need to use the comparison operator here: $valid = false should be: $valid == false
  11. Uhhh... I never actually posted to this thread before. I have no idea what that entry above from me is about...
  12. I found it. In order to pass the variable as a single argument with spaces, you need to enclose it in quotes, which means you need to quote the quotes: $arg1 = '"test 55"'; Note the double quotes are inside the single quotes.
  13. You are essentially issuing this command through the command line by using exec() from PHP. This means that your arguments are separated by a space instead of a comma. So it is treating 'text' as a separate argument instead of being part of the same string. You can set up your VBS to take multiple arguments by adding them in, which should be fairly obvious: NOT TESTED Function WriteLineToFile(ntext,ntext2) Const ForReading = 1, ForWriting = 2 Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("C:\inetpub\test\test.txt", ForWriting, True) f.WriteLine ntext+ntext2 Set f = fso.OpenTextFile("C:\inetpub\test\test.txt", ForReading) WriteLineToFile = f.ReadAll End Function Dim Arg, var1, var1 Set Arg = WScript.Arguments var1 = Arg(0) var2 = Arg(1) WriteLineToFile(var1, var2) But if you want to pass the entire string as a single argument with the space(s) in them, I'm not sure how to do that.
  14. google tells me you're not grabbing the arguments correctly in your VBS. It should be: Function WriteLineToFile(ntext) Const ForReading = 1, ForWriting = 2 Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("C:\inetpub\test\test.txt", ForWriting, True) f.WriteLine ntext Set f = fso.OpenTextFile("C:\inetpub\test\test.txt", ForReading) WriteLineToFile = f.ReadAll End Function Dim Arg, var1 Set Arg = WScript.Arguments var1 = Arg(0) WriteLineToFile(var1)
  15. You aren't running that section of code from VB, but from PHP, which will not parse variables inside of single quotes (unless those single quotes are inside double quotes). Try changing them to double quotes and you will pass the value of that variable.
  16. I don't know much about VBS, but for your PHP you need to lower-case your exec function and use double quotes instead: $arg1 = 'test 55'; exec("test.vbs $arg1");
  17. Sounds like something you could do with google calendar or a similar application.
  18. Can you give more detail on how it's not working? Are you getting any errors?
  19. And then send out an email when the license is about to expire. What code have you written so far?
  20. jesirose, you forgot foreach().
  21. Try this: <?php include 'func.inc.php'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>search</title> </head> <body> <form action="" method="POST"> <p> <input type="text" name="keywords" size="17" maxlength="9" value="Enter B/L No." onfocus="if(this.value == 'Enter B/L No.'){this.value = '';}" /> <input type="submit" class="formbutton" value="Track" /> </p> </form> <?php if (isset($_POST['keywords'])) { $suffix = ""; $keywords = mysql_real_escape_string(htmlentities(trim($_POST['keywords']))); $errors = array(); if (empty($keywords)) { $errors[] = ''; } else if (strlen($keywords)<9) { $errors[] = '<br><strong>Your Bill of Lading Number must contain 9-digits.</strong>'; } else if (search_results($keywords) === false) { $errors[] = '<br><strong>Please enter a valid Bill of Lading Number.</strong>'; } if (empty($errors)) { $results = search_results($keywords); $results_num = count($results); $suffix = ($results_num !=1) ? 's' : ''; foreach($results as $result) { echo "<br><table> <thead> <tr> <th><strong>B/L No.</strong></th> <th><strong>Origin City</strong></th> <th><strong>Origin Country</strong></th> <th><strong>Destination City</strong></th> <th><strong>Destination Country</strong></th> <th><strong>Status</strong></th> <th><strong>Current Location</strong></th> </tr> </thead> <tbody> <tr> <td>{$result['Bill_No']}</td> <td>{$result['Origin_City']}</td> <td>{$result['Origin_Country']}</td> <td>{$result['Destination_City']}</td> <td>{$result['Destination_Country']}</td> <td>{$result['Status']}</td> <td>{$result['Current_Location']}</td> </tr> </tbody> </table>"; } } else { foreach($errors as $error) { echo $error, '</br>'; } } } ?> </body> </html> [/code]
×
×
  • 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.