Jump to content

jvrothjr

Members
  • Posts

    299
  • Joined

  • Last visited

Everything posted by jvrothjr

  1. its picky on single and doule quote [code] $get_forumers_online = mysql_query("SELECT * FROM forum_members WHERE lastLogin < '15 MINUTES'"); [/code]
  2. here is a basic Idea $FirstQuery = "Select ItemNumber, ItemName from Item"; $FirstTableQuery = mysql_query($FirstQuery); if ($FirstTableRow = mysql_fetch_array($FirstTableQuery)) { do{ $cnt = 0; $displayvariable = ""; $displayvariable = $FirstTableRow['ItemNumber']." ".$FirstTableRow['ItemName']." "; $SearchItem = $FirstTableRow['Item']; $SecondQuery = "Select ItemType from Description where ItemNumber = '$SearchItem'" $SecondTableQuery = mysql_query($SecondQuery); if ($SecondTableRow = mysql_fetch_array($SecondTableQuery)) { do{ $cnt = $cnt + 1; if ($cnt == "1") { $displayvariable = $displatvariable.$SecondTableRow['ItemType']; } else { $displayvariable = $displatvariable.",".$SecondTableRow['ItemType']; } } while($SearchTableRow = mysql_fetch_array($SecondTableQuery));} // Code for Output Here } while($FirstTableRow = mysql_fetch_array($FirstTableQuery));}
  3. <? $var1 = "one"; $var2 = "two"; $var3 = "three"; $text = $var1.",".$var3; echo $text ?>
  4. [!--quoteo(post=386801:date=Jun 22 2006, 07:29 AM:name=sun14php)--][div class=\'quotetop\']QUOTE(sun14php @ Jun 22 2006, 07:29 AM) [snapback]386801[/snapback][/div][div class=\'quotemain\'][!--quotec--] working on mysql with php, as my data is displayed in browser in the tabular form as below id name class result 1 sun five i want as i click (making id filed hyperlink) on particular id it automatically take me to update form an & i can update "result" filed thr after that. it also display the clicked id value in a text box. how i code it ? regards [/quote] echo "<TD><a href=update.php?ID=1 target='_blank'>1</a></TD>";
  5. You could say use between option on your query $postcodeid = 3804 // this will get you the whole number of 103 percent of the id your searching for $MaxPCID = int($postcodeid * 1.03) // this will get you the whole number of 97 percent of the id your searching for $MinPCID = int($postcodeid * 0.97) $querystring = "select * from table where (ID between $MinPCID and $MaxPCID) order by postcodeID";
  6. Without an idea of what you end goal is its hard to set all ext you will take. you could have TIF, GIF, BMP, TIFF, JPG, JPEG, PNG for graphics PDF for general viewing I would set a max file size also or else you could run out of space really fast. As far as links ver's imbedded ..... this is based on really your user group dial-up users would like links as for broad-band imbedded would be great if your website is monitered for bandwidth usage links would be better.
  7. here is my php.ini session section on my test box where sessions work [Session] ; Handler used to store/retrieve data. session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. ; ; As of PHP 4.0.1, you can define the path as: ; ; session.save_path = "N;/path" ; ; where N is an integer. Instead of storing all the session files in ; /path, what this will do is use subdirectories N-levels deep, and ; store the session data in those directories. This is useful if you ; or your OS have problems with lots of files in one directory, and is ; a more efficient layout for servers that handle lots of sessions. ; ; NOTE 1: PHP will not create this directory structure automatically. ; You can use the script in the ext/session dir for that purpose. ; NOTE 2: See the section on garbage collection below if you choose to ; use subdirectories for session storage ; ; The file storage module creates files using mode 600 by default. ; You can change that by using ; ; session.save_path = "N;MODE;/path" ; ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. ;session.save_path = "/tmp" ; Whether to use cookies. session.use_cookies = 1 ; This option enables administrators to make their users invulnerable to ; attacks which involve passing session ids in URLs; defaults to 0. ; session.use_only_cookies = 1 ; Name of the session (used as cookie name). session.name = PHPSESSID ; Initialize session on request startup. session.auto_start = 0 ; Lifetime in seconds of cookie or, if 0, until browser is restarted. session.cookie_lifetime = 0 ; The path for which the cookie is valid. session.cookie_path = / ; The domain for which the cookie is valid. session.cookie_domain = ; Handler used to serialize data. php is the standard serializer of PHP. session.serialize_handler = php ; Define the probability that the 'garbage collection' process is started ; on every session initialization. ; The probability is calculated by using gc_probability/gc_divisor, ; e.g. 1/100 means there is a 1% chance that the GC process starts ; on each request. session.gc_probability = 1 session.gc_divisor = 100 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime = 1440 ; NOTE: If you are using the subdirectory option for storing session files ; (see session.save_path above), then garbage collection does *not* ; happen automatically. You will need to do your own garbage ; collection through a shell script, cron entry, or some other method. ; For example, the following script would is the equivalent of ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): ; cd /path/to/sessions; find -cmin +24 | xargs rm ; PHP 4.2 and less have an undocumented feature/bug that allows you to ; to initialize a session variable in the global scope, albeit register_globals ; is disabled. PHP 4.3 and later will warn you, if this feature is used. ; You can disable the feature and the warning separately. At this time, ; the warning is only displayed, if bug_compat_42 is enabled. session.bug_compat_42 = 1 session.bug_compat_warn = 1 ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be ; considered as valid. session.referer_check = ; How many bytes to read from the file. session.entropy_length = 0 ; Specified here to create the session id. session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom ; Set to {nocache,private,public,} to determine HTTP caching aspects ; or leave this empty to avoid sending anti-caching headers. session.cache_limiter = nocache ; Document expires after n minutes. session.cache_expire = 180 ; trans sid support is disabled by default. ; Use of trans sid may risk your users security. ; Use this option with caution. ; - User may send URL contains active session ID ; to other person via. email/irc/etc. ; - URL that contains active session ID may be stored ; in publically accessible computer. ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. session.use_trans_sid = 0 ; Select a hash function ; 0: MD5 (128 bits) ; 1: SHA-1 (160 bits) session.hash_function = 0 ; Define how many bits are stored in each character when converting ; the binary hash data to something readable. ; ; 4 bits: 0-9, a-f ; 5 bits: 0-9, a-v ; 6 bits: 0-9, a-z, A-Z, "-", "," session.hash_bits_per_character = 4 ; The URL rewriter will look for URLs in a defined set of HTML tags. ; form/fieldset are special; if you include them here, the rewriter will ; add a hidden <input> field with the info which is otherwise appended ; to URLs. If you want XHTML conformity, remove the form entry. ; Note that all valid entries require a "=", even if no value follows. url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
  8. [!--quoteo(post=384691:date=Jun 16 2006, 02:10 PM:name=aaron118)--][div class=\'quotetop\']QUOTE(aaron118 @ Jun 16 2006, 02:10 PM) [snapback]384691[/snapback][/div][div class=\'quotemain\'][!--quotec--] I can't access phpmyadmin. Under the security page I secured the phpmyadmin by setting it to make me have to log into for now on. But now I can't access the damn thing, it thinks my password must be wrong. I have done all it asked and now I can't access phpmyadmin. My password is not wrong. Is there anyway to change it? I re-installed it. When I give the MYSQL a password it still won't let me log into phpmyadmin. Any ideas? Thanks [/quote] well the user name may have been set as localhost id only and not % which would mean you have to be on the box that mysql is installed on but if it is set to % then you could login with phpadmin on any machine and not just the localhost box...........
  9. you are going to have to setup an array for each variable on the page. //define table echo "<tr>"; //define header row echo "</tr><tr>"; loop x = 1 to 5 echo "<td>"; echo "Student Name:<INPUT TYPE=TEXT NAME=StudentName[x] value=STNM[x]>"; echo "</td><td>"; echo "Student Mark:<INPUT TYPE=TEXT NAME=Studentmark[x]>"; echo "</td><td>"; echo "<INPUT TYPE=hidden NAME=Studentmark[x] value=STID[x]>"; echo "<td></tr>"; Next x and when you submit the form you will have to loop thru the values also loop x = 1 to 5 $query = "insert into Marks (Student_ID,Mark) values ('$Studentid[x]','$StudentMark')"; Studentmark[x] Next x This would be the Idea (basics)
  10. [!--quoteo(post=384635:date=Jun 16 2006, 12:20 PM:name=kristalys)--][div class=\'quotetop\']QUOTE(kristalys @ Jun 16 2006, 12:20 PM) [snapback]384635[/snapback][/div][div class=\'quotemain\'][!--quotec--] hey all how's it going? i'm new to all the php and dreamweaver stuff :) and just curious - i just made my company a simple dreamweaver webpage to update the old one. i have updated all the webforwarding addresses to the new location, however, when i try to access the webpage within the company it still points/tries to find the old webpage, but when i'm at home or elsewhere not in the company - i can see the webpage fine. [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] is there something else i'm forgetting to reset? we are running off of a nuvox server at work. please help it's frustrating [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] thanks :) kris. [/quote] This is a big black hole your asking about!!!!!!!!!!!!!!!!!! Does your company have a DNS server and is your website definded within that????????????????? Or is the DNS for the address defined on the machine it self???????????????? a lot of IF's
  11. Sounds like a time-out issue. php.ini file ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) ; Maximum time (in secondes) for connect timeout. -1 means no limit mysql.connect_timeout = 60 also could be your resources set on your my.ini file
  12. $sql = "SELECT * FROM `tutorials` WHERE `activation` = 0"; $result=mysql_query($sql); // Define $color=1 $color="1"; ////////////////////////////////////////////// ///Remove this line it gets the first line /// /// then your While($row) pulls the second /// ////////////////////////////////////////////// /// $rows=mysql_fetch_array($result); /// ////////////////////////////////////////////// echo "<table width="500" border=1 align=center cellpadding=2 cellspacing=0>"; echo "<tr bgcolor='#666666'> <td><font color = white>Name</font></td><td><font color = white>Category</font></td><td><font color = white>URL</font></td><td><font color = white>Description</font></td> </tr>"; while($rows=mysql_fetch_array($result)){ $cat = $rows['catid']; $sql2 = "SELECT * FROM `category` WHERE `cat_id` = '$cat'"; $result2=mysql_query($sql2); $rows2=mysql_fetch_array($result2); if($color==1){ echo "<tr bgcolor='#eeeeee' onmouseover='style.backgroundColor=\"#3D59AB\";' onmouseout=\"style.backgroundColor='#eeeeee'\"> <td>".$rows['name']."</td><td>".$rows2['category']."</td><td><a href=".$rows['url'].">Link</a></td><td>".$rows['description']."</td> </tr>"; // Set $color==2, for switching to other color $color="2"; } // When $color not equal 1, use this table row color else { echo "<tr bgcolor='#c0c0c0' onmouseover='style.backgroundColor=\"#3D59AB\";' onmouseout=\"style.backgroundColor='#c0c0c0'\"> <td>".$rows['name']."</td><td>".$rows2['category']."</td><td><a href=".$rows['url'].">Link</a></td><td>".$rows['description']."</td> </tr>"; // Set $color back to 1 $color="1"; } } echo '</table>';
  13. [!--quoteo(post=384639:date=Jun 16 2006, 12:25 PM:name=natalieG)--][div class=\'quotetop\']QUOTE(natalieG @ Jun 16 2006, 12:25 PM) [snapback]384639[/snapback][/div][div class=\'quotemain\'][!--quotec--] when we use the below code, the text in the testarea is indented about half the textarea width instead of starting at the left margin. we have tried changing $NOTE to: trim($NOTE) and this does not solve the problem. ______________________________________________________________________________________ [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--][b]<tr><td width="664" COLSPAN="2"><textarea name="NOTE" rows="20" cols="85" tabindex="1"> <?php echo $NOTE;?></textarea></td>[/b][!--colorc--][/span][!--/colorc--] _________________________________________________________________________________ Chjarlotte- [/quote] Could be alignment of the table try <td align=left width=664 colsspan=2>
  14. [!--quoteo(post=380245:date=Jun 5 2006, 11:58 AM:name=warpkari)--][div class=\'quotetop\']QUOTE(warpkari @ Jun 5 2006, 11:58 AM) [snapback]380245[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi Does anyone know how I can set up an automatic redirection to a specified iframe ? at the moment i am using this meta tag but i don't know how to make the page load into another iframe : <meta http-equiv=Refresh content=2;url=blabla.php> or maybe there's an alternative method? i just want users who log out to be redirected automatically to a page which is supposed to load in a specific iframe. cheers! [/quote] You could just use an if statment if ($UserID <> "") { include("loggedout.php"); } else { include("loggedin.php"); }
  15. check your php.ini to make sure the setting are ok and that you are not exceeding the filesize also ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir = C:\PHP\uploadtemp ; temporary directory for HTTP uploaded files (will use system default if not specified) ; Maximum allowed size for uploaded files. upload_max_filesize = 2M
  16. you could use an I-frame for your table. and have to conbo box set on_change to refresh the I-frame and not the whole page. This is a can do function. You have to have some way to send the data that was selected to another function to run the query to get the new data.
  17. Session Start needs to be the first thing. [code] <? //login.php session_start(); include 'config.php'; [/code] Start with that
  18. here is a function I have that displays a user list in a table with the option to edit anyone user and pass that ID to the next funtion to edit that user information. This what I think your asking for [code] function EditUserAdmin($UN_ID){     mysql_select_db("grouplog");     $QSting1 = "Select tbluser.User_Name,tbluser.User_ID,                     tbluser.User_Email,tbluser.Rights,                     tbluser.Location,person.person                 from tbluser                 left join person on tbluser.User_ID=person.User_ID                 where tbluser.UN_ID = '$UN_ID'";     $UserList1 = mysql_query($QSting1);     if ($UserListRow1 = mysql_fetch_array($UserList1)) {         do{             echo "<center><form action=profile.php method=post>";             echo "<TABLE class=profile BORDER=3 align=center>";             echo "<INPUT TYPE=hidden NAME=UN_ID value='".$UN_ID."'>";             echo "<tr><td class=label>User Name:</td>";             echo "<td><INPUT TYPE=TEXT NAME=TUser_Name value='".$UserListRow1['User_Name']."' size=30></td></tr>";             echo "<tr><td class=label>User ID:</td>";             echo "<td><INPUT TYPE=TEXT NAME=TUser_ID value=".$UserListRow1['User_ID']." size=30></td></tr>";             echo "<tr><td class=label>User Email:</td>";             echo"<td><INPUT TYPE=TEXT NAME=TUser_Email value=".$UserListRow1['User_Email']." size=30></td></tr>";             echo "<tr><td class=label>Rights Level:</td>";             echo "<td><INPUT TYPE=TEXT NAME=TRights value=".$UserListRow1['Rights']." maxlength=1 size=30></td></tr>";             echo "<tr><td class=label>Location:</td>";             echo "<td><INPUT TYPE=TEXT NAME=TLocation value=".$UserListRow1['Location']." maxlength=10 size=30></td></tr>";             echo "</table></P>";             echo "<input type=submit name=cmd value='Submit User Edit Profile'>";             echo "</FORM>";             }     while($UserListRow1 = mysql_fetch_array($UserList1));     }     echo "<center><form action='profile.php' method=post>";     echo "<input type=hidden name='UN_ID' value='".$UN_ID."'>";     echo "<input type=submit title='Reset Default Password' name=cmd value='Reset Password'></form></td>"; } [/code]
  19. [a href=\"http://us3.php.net/manual/en/ref.mssql.php\" target=\"_blank\"]http://us3.php.net/manual/en/ref.mssql.php[/a] Table of Contents mssql_bind -- Adds a parameter to a stored procedure or a remote stored procedure mssql_close -- Close MS SQL Server connection mssql_connect -- Open MS SQL server connection mssql_data_seek -- Moves internal row pointer mssql_execute -- Executes a stored procedure on a MS SQL server database mssql_fetch_array -- Fetch a result row as an associative array, a numeric array, or both mssql_fetch_assoc -- Returns an associative array of the current row in the result set specified by result_id mssql_fetch_batch -- Returns the next batch of records mssql_fetch_field -- Get field information mssql_fetch_object -- Fetch row as object mssql_fetch_row -- Get row as enumerated array mssql_field_length -- Get the length of a field mssql_field_name -- Get the name of a field mssql_field_seek -- Seeks to the specified field offset mssql_field_type -- Gets the type of a field mssql_free_result -- Free result memory mssql_free_statement -- Free statement memory mssql_get_last_message -- Returns the last message from the server mssql_guid_string -- Converts a 16 byte binary GUID to a string mssql_init -- Initializes a stored procedure or a remote stored procedure mssql_min_error_severity -- Sets the lower error severity mssql_min_message_severity -- Sets the lower message severity mssql_next_result -- Move the internal result pointer to the next result mssql_num_fields -- Gets the number of fields in result mssql_num_rows -- Gets the number of rows in result mssql_pconnect -- Open persistent MS SQL connection mssql_query -- Send MS SQL query mssql_result -- Get result data mssql_rows_affected -- Returns the number of records affected by the query mssql_select_db -- Select MS SQL database
  20. SELECTED NUMBER A 5.0000 STARTING NUMBER B 1.0000 ENDING NUMBER C 10.0000 STARTING PERCENT D 15.0000 ENDING PERCENT E 35.0000 PERCENT DIFFERENCE F 20.0000 E - D = F PERCENT PER STEP G 2.2222 F / (C -B) = G PERCENT AT NUMBER H 23.8889 ( G * ( A - B ) ) = H This was a little odd had to think on this one lol....... bad I know but I think we got it 1) You need to define a min / max number [C - B = steps in range] 2) You need to define a min / max percent [E - D = F {Percent per range}] 3) [F / (C -B) = G {percent per step}] 4) [( G * ( A - B ) ) = H {to get you percent per given number}] if 1 was 15 and 10 was 35 then 5 would have been 23.8889 so if you define start and finish points then you could get the percent with in that range and the formula will get you your percentage via number given
  21. I have something like that. But its a general album. I dont have it closed to other users. But can be with out to much work. [a href=\"http://lilman.no-ip.info\" target=\"_blank\"]http://lilman.no-ip.info[/a] create userid or use guest / guest look under photoalbum
  22. [code]     mysql_select_db ("databasename");          echo "User : <select name=UserID><option value='.'>--Select One--</option>";          $UserTableQuery = mysql_query ("select DISTINCTROW Fieldname from Tablename order by Fieldname");          while ($UserTableRow=mysql_fetch_array($UserTableQuery)) {          echo "<option value='".$UserTableRow[Fieldname]."'>".$UserTableRow[Fieldname]."</option>\n"; }          echo "</select><p>"; [/code]
  23. [code] <?php session_start(); session_register("User_ID"); ?> [/code] when you started your session did you register the variable name [code] <?php session_start(); ?> [/code] second did you start every page with session_start();
  24. [code] $query = ("SELECT Table1.Student Metric FROM Table1 INNER JOIN Table2 ON Table1.Student Metric = Table2.Student Metric"); [/code]
  25. [code] $query = ("select * from userInfo     left join studentGrade on userInfo.project_id=studentGrade.project_id     where studentGrade.project_id = 45"); [/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.