Jump to content

_will

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by _will

  1. If you cannot get around passing variables in the GET, you can always [a href=\"http://us3.php.net/manual/en/function.bin2hex.php\" target=\"_blank\"]convert the values to hex[/a] and add or decrement an offset, or use the [a href=\"http://us3.php.net/base64_encode\" target=\"_blank\"]Base64 encoding[/a] so that the information in the URL looks like garbage to the user, but has a meaningful value to the web app.
  2. [!--quoteo(post=374132:date=May 15 2006, 05:21 PM:name=ikmyer)--][div class=\'quotetop\']QUOTE(ikmyer @ May 15 2006, 05:21 PM) [snapback]374132[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hello, I have been working on this for a few hours now... I am trying to read the contents of a file that is on the local pc ( computer loading the page ). I am trying to read a text file, find a certain line and then store some data of that line in another text file. The problem I am having is I can't seem to get the file to open for reading... I get a permission denied error message. Is there a way around this or how can this be done. The page will only be accessed by a script that is calling the page and only PC's on the loca network will load it. Thanks for any and all help!! for some reason the site would not let me post code... [/quote] What is the exact error message you are receiving and can you please paste the line of code where you open the file. If you post that information we can be of more help.
  3. Oh, I agree that faking an X-Mailer and using it in a production environment would be a bad idea. I am just interested in seeing how the spam filters react to the same message coming from different clients.
  4. Additionally, it might be worth a try to see if the spam filters would treat your email differently if you made your X-Mailer header mimic that of say, Outlook, Eudora or Thunderbird.
  5. Is it possible to suppress the X-Mailer tag?
  6. What headers (arg #4, mail() function) are you using when you send your email? I ran into a similar problem a while back where I wasn't sending headers and a spam filter was flagging the messages as spam. Can you post the code where you call mail().
  7. [!--quoteo(post=374067:date=May 15 2006, 01:05 PM:name=Orio)--][div class=\'quotetop\']QUOTE(Orio @ May 15 2006, 01:05 PM) [snapback]374067[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks alpine [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] But what about varibles that weren't set? Another example: [code]$var=1; if(!isset($age)){ $var=$age; echo($age); }; [/code] Will any error occur? And is $var's value going to stay 1? Thx again, Orio. [/quote] Why don't you test the PHP code you put up? You could put that in a test page and echo the output to see if it behaves the way you think it will. It probably would have taken less time than it would to post to the forum.
  8. To help your session debugging, try using this to print all the session variables: [code] echo print_r($_SESSION); [/code]
  9. [!--quoteo(post=373985:date=May 15 2006, 09:47 AM:name=macdumbpling)--][div class=\'quotetop\']QUOTE(macdumbpling @ May 15 2006, 09:47 AM) [snapback]373985[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi. I have to write an windows application that sits on a server and sends variables to a php web page. I currently am using flash and MDM, but that's far too slow and we're looking for something a little cleaner. Any suggestions would be wonderful! Thank you, Kevin Biesbrock [/quote] Any windows application that has access to the internet (via ActiveX control or through the winsock API) should be able to send variables to a PHP script. If you can access 'http://localhost/myscript.php?my_variables_here' you can pass the variables you want to send to your PHP script.
  10. Both variables will be '1'. It will execute the first IF statement, and then exit the conditional, so $foo = 1 and $bar = 1.
  11. try this in your for loop... [code] var last = ""; var display = ""; for (i=0; i<manu.length; i++){ if (last == manu[i]) {   display = manu[i];   last = manu[i]; } else {   display = ""; }    document.write("<tr><td>", display, "</td>", "<td>", part[i], "</td>", "<td>", fits[i], "</td>", "<td>", price[i], "</td></tr>") } [/code] All I added was a variable to track the last product shown and then an if statement to see if the next product is the same as the last product shown. If it is, then no product name is printed.
  12. I don't think I have ever seen any evidence to support one method or another, but I would have to assume that having all your code in one file would slow your website down. With all your code in one file, the PHP interpreter has more code to load and process, regardless of whether or not the code is executed. If you had multiples files then only a very small portion of the code is loaded and executed. You may not be able to tell a difference on a small site, but using one file on a large site is IMHO, not only a bad programming technique, but should slow your site down.
  13. In terms of having a script execute itsself at a certain time, your probably better off to wait and setup the cronjob. Have you thought about scheduling a task on your PC to execute the script on your server?
  14. Try naming all of the radio buttons for the same question the same name, but give each radio a different value. blah blah blah <name=Q1 val=1> <name=Q1 val=2> <name=Q1 val=3> <name=Q1 val=4> blah blah blah <name=Q2 val=1> <name=Q2 val=2> <name=Q2 val=3> <name=Q2 val=4> .... This should make it so you can select one radio button for each row.
  15. suggestion: use single quotes when you are not concatenating with a variable in your expression. [!--quoteo(post=373797:date=May 14 2006, 01:51 PM:name=gtridez)--][div class=\'quotetop\']QUOTE(gtridez @ May 14 2006, 01:51 PM) [snapback]373797[/snapback][/div][div class=\'quotemain\'][!--quotec--] $sql = "SELECT * ". "FROM images ". "WHERE unique_image_id = $unid"; $result = mysql_query ($sql); [/quote] to [code] $sql = 'SELECT * '.      'FROM images '.      "WHERE unique_image_id = $unid"; $result = mysql_query ($sql); [/code]
  16. Is your MySQL server running? Also, in your code, change the if statement to [code] if (!$mysql) {   //... [/code]
  17. [!--quoteo(post=373778:date=May 14 2006, 12:58 PM:name=albinoAZN)--][div class=\'quotetop\']QUOTE(albinoAZN @ May 14 2006, 12:58 PM) [snapback]373778[/snapback][/div][div class=\'quotemain\'][!--quotec--] I am a complete noob when it comes to php. I'm also a complete noob when it comes to MySQL. I do know a little of the basics, just enough to piss me off. [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] . What I'm wanting to do is make a script that makes a backup of an entire database once every week, and then the script automatically sends it to my email address. I have been told to use cronjobs, but then never got any support. I have no idea what cronjobs is, and would love to have someone help me out. Sorry if this is in the wrong place, but I wasn't sure. Thank you, Jake Moore / albinoAZN [/quote] cron is the scheduling demon in *nix. Using cron, you can execute shell commands at different intervals throughout the day. To do your backup, you could write a script, or program for that matter, and have the cron demon execute it every friday night if you wanted it to. [a href=\"http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/\" target=\"_blank\"]This link[/a] (htmlcenter.com) gives examples on how to create cron jobs. Most website control panels have plugins that allow you to create cron jobs. If you have shell access, you can create cronjobs from the shell.
  18. [!--quoteo(post=373784:date=May 14 2006, 01:21 PM:name=webmobster)--][div class=\'quotetop\']QUOTE(webmobster @ May 14 2006, 01:21 PM) [snapback]373784[/snapback][/div][div class=\'quotemain\'][!--quotec--] How do you set for a certain/any directory rights for a php script to read, write or create files? [/quote] Usually on a *nix box you need to give the Apache daemon the permissions to access and write to the directory. You can use the chmod command to set the proper permissions if you have shell access, and most web control panels give you the ability to change permissions.
  19. [!--quoteo(post=373794:date=May 14 2006, 01:42 PM:name=gtridez)--][div class=\'quotetop\']QUOTE(gtridez @ May 14 2006, 01:42 PM) [snapback]373794[/snapback][/div][div class=\'quotemain\'][!--quotec--] How do I select a unique id such as "gh4543hg3354h" from a table? I'm trying to select a unique id such as "gh4543hg3354h" from a database table... however i keep getting Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/gtridez/public_html/GTRider/ride_displayer.php on line 37 does anyone know what this problem is and how to fix it? [/quote] that error could be appearing for any number of reasons. Either the SQL statement that you passed didn't work, or you may not be connected to the mysql server. If you post the SQL query you are using we can be of more help.
  20. [!--quoteo(post=373662:date=May 14 2006, 01:15 AM:name=alfman05302001)--][div class=\'quotetop\']QUOTE(alfman05302001 @ May 14 2006, 01:15 AM) [snapback]373662[/snapback][/div][div class=\'quotemain\'][!--quotec--] The second option I would require me to redo all the linking for my pages as they were not relative (for some strange reason when I coded the site I used the full url). The first option would work, but I would need to use it on a second page too as the first include statement has a page that has its own include statement (the db connection info) but the code should be the same I think for both pages (is that correct?). The one peice that confuses me is how the variable is defined? [/quote] PHP will include files with a path relative to the original script. So if your index2.php includes a file that includes another file PHP won't find it because it is looking relative to the original script, which is in a different location than the other files that include your class... Try and keep all your includes in the same directory, or, since we previously defined $bIsTopLevel, in your include you could do another if-then.... [code] if (isset($bIsTopLevel) && $bIsTopLevel == true) {   include('../mysql_access.inc.php'); } else {   include('../../mysql_access.inc.php'); } [/code]
  21. try [code] $skin['content'] .= "eval(include('pages/page_$pagename.src'));"; [/code]
  22. instead of trying include('this' OR 'that') (which won't work...), somthing as simple as [code] if ($bIsTopLevel) {    include('config.inc.php'); } else {    include('../config.inc.php'); } [/code] Another alternative would be to move all your pages to the second level of your web root, and just have an index.php in the top level. All of the files that you had originally in the top level could be moved to /main or /static. In the index you put [code] header('Location: main/index.php'); [/code] When a user accesses your site they will get forwarded automatically to your sublevel, and you don't have to worry about the headache of finding the right path based on which page the user is viewing, because they are always ../ from the web root.
  23. I hope I am reading your question correctly... There are lots of good Javascript calendars out there that can do what your asking for. When you click a button or link, a small Javascript window can display a calendar, and then populate a form field when you select a date on the calendar. A google for "javascript popup calendar" will give you all kinds of results, or try this site... [a href=\"http://www.mattkruse.com/javascript/calendarpopup/\" target=\"_blank\"]http://www.mattkruse.com/javascript/calendarpopup/[/a]
  24. Are you running PHP5? That code will not work in PHP4 because classes in PHP4 don't recognize private vs. public.
  25. [!--quoteo(post=373477:date=May 13 2006, 05:38 AM:name=atitudeskills)--][div class=\'quotetop\']QUOTE(atitudeskills @ May 13 2006, 05:38 AM) [snapback]373477[/snapback][/div][div class=\'quotemain\'][!--quotec--] hi guys i've seem to have some trouble transfering some of my files here is the code but i know this really works but in my case does'nt... :( heres the simple code that i can't run: [b]If i do this:[/b] [code] <?         $getting_this_file ="C:\mysql\bin\dbases.txt";         $putting_to_this_directory ="C:\dbases.txt";         if (!copy($getting_this_file , $putting_to_this_directory)) {                 print ("failed to copy into directory $getting_this_file...<br>\n"); } ?> [/code] [b]This is the error msg that comes out [/b] Warning: copy(C:\mysql\bin\dbases.txt) [function.copy]: failed to open stream: No such file or directory in C:\some directory\htdocs\phpscript\copy.php on line 4 failed to copy into directory C:\dbases.txt... Then i Added an "@" sign before copy ======> '!@copy': [code] <?         $getting_this_file              ="C:\mysql\bin\dbases.txt";         $putting_to_this_directory ="C:\dbases.txt";         if (!@copy($getting_this_file , $putting_to_this_directory)) {                 print ("failed to copy into directory $getting_this_file...<br>\n"); } ?> [/code] [b]Then This is the error msg comes out which i did when failed of copying a certain file [/b] failed to copy into directory C:\dbases.txt... i'm using php version 5.0.5 and apache 2 under windows environment...im puzzled right now (X_x) thanks [/quote] how are the permissions setup on your server?
×
×
  • 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.