Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. Adding to what bpops said, you might want to add a check at the end to make sure that all of the <td>s are there: [code]$x = 1; echo ' <table> <tr>'; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo ' <td> ' . $row['objectname'] . '<br /> <img src="' . $row['objectimage'] . '"><br /> ' . $row['objectprice'] . ' </td>'; $x++; if (x == 4) { echo " </tr> <tr>";   $x = 1; } } if ($x < 4) { while ($x <= 4) { echo ' <td>&nbsp;</td>'; $x++; } } echo ' </tr> </table>';[/code]
  2. Do you have the correct entype set in your form? It should be set to "multipart/form-data".
  3. For one, your missing the semicolon at the end of this line: [code]$sql = mysql_query("INSERT INTO pirep (userid, fltnum, actype, depair, deptime, arair, artime, flttime, fltinfo, pirep_date)         VALUES('$userid','$fltnum','$actype','$depair','$deptime','$arair','$artime','$flttime','$fltinfo', now())")         or die (mysql_error())[/code]
  4. Save it to the file system, then call it from your html page.  Or, change the .png extension to be associated with php so that the php intrepreter will read it...but I'm not sure about the side effects of that on it processing the .png files.
  5. Do a google search for embedding movies/media in a webpage.
  6. Check to see if $_POST is set/not empty or if $_POST['whateveryounamedthesubmitbutton'] is set to it's value.
  7. Had to look that up...not because I don't believe you, cause I wanted to see how it's done...never used it that way...I've always done it the way you suggested.
  8. You can use cURL or sockets to post information to a url from inside of a php script. http://www.php.net/curl http://www.php.net/sockets
  9. The .= operator appends the string afterward to the string variable...i.e. : [code]$message .= "http://www.funnyemailforwards...."[/code] Will append the http://....... to whatever $message previously was. That is not your problem. Thorpe probably has it right.  Why are you assigning a value to $to using curly braces inside of double quotes?
  10. I'm suprised that your download works at all.  You need to have the download file page be completely seperate. Take this code: [code]if(($_GET['download'] == "yes") && ($_GET['id'] == "$id")) { header("Content-length: $demosize"); header("Content-type: $demotype"); header("Content-Disposition: attachment; filename=$demoname"); echo $democontent; $querydemo = "SELECT demodownloadtimes FROM addscore WHERE id = '$id'"; $resultdemo = mysql_query($querydemo) or die('Error, query failed'); list($demodownloadtimes) = mysql_fetch_array($resultdemo); $demodownloadtimes += 1; $updatedemo = "UPDATE addscore SET demodownloadtimes='$demodownloadtimes' WHERE id = '$id'"; mysql_query($updatedemo) or die('Error, query failed'); }[/code] And make it a seperate page that you link to.
  11. http://www.phpfreaks.com/tutorials/33/0.php
  12. [code]$str = '[http://www.phpfreaks.com/]'; $str = trim($str, '[]'); echo '<a href="' . $str . '">' . $str . '</a>'; [/code]
  13. [quote author=GingerRobot link=topic=104248.msg415759#msg415759 date=1155589249] You can parse variables to and from PHP with ajax... [/quote] You can send information from the browser to the server via ajax, not necessarily "parsing variables", and it doesn't have to be php on the server.  In fact, it can be plain HTML/text if the programmer wanted. I don't think that ajax is an option here.  I'm not familiar with actionscript, but my understanding is that the way for the two to communicate is via text files.  They can be either xml, or just a formatted text file that both programmers can then extract the data from.  If the two are running on the same server, then there should be a way for actionscript to execute a php file, even if from the command line.  If they are not on the same server, or even if they are, then he should be able to call the page/function via a url and pass most parameters via the url.  So, if each php "function" was a seperate page, then he would only have to go to http://your.server/phpfunction1.php?var1=something and your "function" would return the results.
  14. Include some error checking then execute your file from the command line so you can see the output.  Cron will not return anything, so you can't tell what the error may be.  Executing the file from the command line is the same as cron doing it.
  15. I don't think there is a built in command, however you may want to try any one of the classes here: http://www.phpclasses.org/browse/class/42.html
  16. Look for any one of the thousands of JS menu scripts, then just build it's input from the database using php. I usually use this one from dhtmlgoodies.com: http://www.dhtmlgoodies.com/scripts/dhtmlgoodies-menu2/dhtmlgoodies-menu2.html Which is on his menu scripts page here: http://www.dhtmlgoodies.com/index.html?page=menuScripts It's built using unordered lists, so it's easy to build with a recursive function.
  17. Here's the function I use to authenticate to an LDAP server: [code]function checkuser($uname, $pword) { if ($uname != "") { $username = $uname . "@domain.name"; $ldapconn = ldap_connect("ldaps://ldap.server") //or ldap://ldap.server or die("Could not connect to LDAP server."); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); $ldapbind = ldap_bind($ldapconn, $username, $pword); // or die("Could not connect to LDAP: " . ldap_error($ldapconn)); if ($ldapbind) { ldap_close($ldapconn); return true; // username / password good } else { ldap_close($ldapconn); return "Invalid Username or Password!!"; } } else { return "No Username Entered!!"; } }[/code]
  18. Please, "FOR THE LOVE OF PETE", read a tutorial and do a simple search for similar subjects before posting a question. Here is a tutorial from the phpfreaks page....all you have to do is click tutorials and it's there.  It's not even on a sub page. http://www.phpfreaks.com/tutorials/40/0.php
  19. [quote author=onthespot link=topic=104141.msg415208#msg415208 date=1155517476] is there anyway, i can make a menu where is updates through php?? so i can add parts to it using php, instead of redesigning the whole thing? [/quote] Yes. However, as Pixy stated, you need to be more specific.  Are you pulling from a db?  Are you using JS?  What is the structure of your existing menu?  What do you want the result to be?  Do you have any code that you have tried so far?  If so, what isn't working about it?
  20. ldap_connect will always return "true". Use ldap_error on your bind statement to find out the error that is occurring: [code]$ldapbind = ldap_bind($ds, $username, $upasswd) or die(ldap_error($ds));[/code] Also, keep in mind that if you are using a win2k3 AD server, anon connects are disabled by default. Have you tried using ldaps to connect? I noticed that you aren't specifing the protocol in your ldap_connect call...when I connect I use: [code]ldap_connect("ldap://fully.qualified.domain.name.of.server");[/code] or [code]ldap_connect("ldaps://fully.qualified.domain.name.of.server");[/code]
  21. You need to use mysql_real_escape_string, or add_slashes, on your variable ($text apparently). You are getting the error because the single quote, which is used to denote the start and end of strings in SQL, is not being escaped in the input text.
  22. Do you have php above your form and table?  Are you sure that all of your table, tr, and td tags start and close in the correct places?
  23. include the file that the function is in, then call it like any other php function: [code]foo("this is a test");[/code]
  24. I don't know the answer off hand, but you could probably dissect one of the libraries and get it....moofx, scriptaculous, prototype etc.
  25. The point of a function is to wrap some lines of code that you plan on using more than once into a single package.  This way if you need to change that code, you only have to do it once, rather than digging through all of your lines of code to find every instance. For example: [code]function foo($arg1) {   echo $arg1; }[/code] Very simple function, just echo's out what it is passed.  You could use that function to output all of your data to the browser, for example.  Now, if you weren't using that function, and you wanted to make all text output to the user red, you would have to dig through your code and put a style tag around each one.  But with the function it's as easy as: [code]function foo($arg1) {   echo '<span style="color: red;">' . $arg1 . '</span>'; }[/code] And now all text will be 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.