Jump to content

littlened

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by littlened

  1. [!--quoteo(post=353243:date=Mar 9 2006, 02:02 PM:name=cfemocha)--][div class=\'quotetop\']QUOTE(cfemocha @ Mar 9 2006, 02:02 PM) [snapback]353243[/snapback][/div][div class=\'quotemain\'][!--quotec--] I've been creating login pages by matching its username and password with the database and just wondering how is secure log in form differ from the method I've been using? How would I create a secure login/registration form? any help is appreciated. Thank you. [/quote] I would image that you would put the login pages on the https side of your server, so your login page might be [a href=\"https://www.yoursite.com/login.php\" target=\"_blank\"]https://www.yoursite.com/login.php[/a] as I believe everything that's done over https is encrypted. The other problem you would have though, is that the data stored in the database wouldnt be encrypted, so you would probably need to find an encryption script to encrypt the password before it stores in the the database, then decrypt the password when someone tries to login. So basically the https would mean the data transfered from the users browser to your server would be encrypted, and the password in the database would be encrypted also.
  2. [!--quoteo(post=352860:date=Mar 8 2006, 02:32 PM:name=OriginalSunny)--][div class=\'quotetop\']QUOTE(OriginalSunny @ Mar 8 2006, 02:32 PM) [snapback]352860[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi, I am trying to get a picture as my link to another page in php. The thing is when the user will click on the picture a query should also be performed. I am currently using the following code for the user to select an option and the queryto be performed: [u]FIRST PAGE[/u] [i] foreach($food_categories as $key => $subarray) { echo "<h3>$key</h3>"; echo "<ul>"; foreach($subarray as $type) { echo "<input type='radio' name='interest' value='$type'><b>$type</b><br>\n"; } echo "</ul>"; } echo "<p><input type='submit' name='Products' value='Select Category'>\n [/i] [u]SECOND PAGE[/u] [i] $sql_cat = "SELECT DISTINCT class FROM food ORDER BY class"; $result = mysql_query($sql_cat,$connect) or die("sql_cat: ".mysql_error($connect)); while($row = mysql_fetch_array($result)) { $food_categories[$row['type']][]=$row['class']; } include("catalogContract.inc");[/i] As you can see a list of the class variables is displayed when the user clicks on the select category button. Now how do i use a picture instead?? I have stored the picture in my food database as foodpic. Thanks. [/quote] the simplest way to do it would be make the image a link, and use PHP do make the link dynamic. for example echo "<h3>$key</h3>"; echo "<ul>"; foreach($subarray as $type) { <a href="index.php?type=<?php echo $type; ?>"><img src="pic.gif" border="0"></a>"; } if you need the image to be different on each one, you could store the url of the image in a database or an array and do the same as what you do with the $type variable. eg <a href="index.php?type=<?php echo $type; ?>"><img src="<?php echo $picurl;?>" border="0"></a>";
  3. [!--quoteo(post=353057:date=Mar 8 2006, 11:09 PM:name=chriscloyd)--][div class=\'quotetop\']QUOTE(chriscloyd @ Mar 8 2006, 11:09 PM) [snapback]353057[/snapback][/div][div class=\'quotemain\'][!--quotec--] okay i have a tournament script where people and teams can sign up but i need help witht eh joing a team part like when they click on the link join team it shows a drop down list of all the team names and under that drop down theres another input box for a password i want them to enter the team password and if the team password is correct i want it to update the field in the user table under the row of the persons username can some one help me [/quote] if it was me, I'd query the teams database and get the teamid and the team name, and store them in an array. Then I'd use the array to poplulate a drop down list with the team names. When the visitor enters a password, it would send the teamid and the password to another page which would do a query to the team table and check the password is correct for that team, if it is, then it would enter the user details into the user table along with the teamid. for example, [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] $count; $sql = "SELECT teamid, teamname FROM teamtable ORDER BY teamname ASC"; $sql_result = mysql_query($sql,$database) or die(mysql_error()); while ($row = mysql_fetch_array($sql_result)) { $teamid[$count] = $row['teamid']; $teamname[$count] = $row['teamname]; $count++; } // then to create the drop down list you would do <select name="teams"> <option value=" " Selected> </option> <?php $rc = 0; while ($teamid[$count] <> '') { echo "<option value='".$teamid[$count]."'>".$teamname[$count]."</option>"; $rc++; } ?> </select> [/quote]
  4. [!--quoteo(post=353089:date=Mar 9 2006, 12:16 AM:name=spelltwister)--][div class=\'quotetop\']QUOTE(spelltwister @ Mar 9 2006, 12:16 AM) [snapback]353089[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hello, First off, I was wondering if this is a PHP error or a server error and if it is, how do i make the time increase: Fatal error: Maximum execution time of 30 seconds exceeded in /home/online/public_html/... Second, because the script is timing out, i was wondering if someone could help me with an array question. I have an array: $offense_infantry = array( "number" => array(), "nation" => array() ); What happens is a bunch of infantry pieces go into this array and they can have different numbers to represent how many are there. During combat, I do this: $upper = sizeof($offense_infantry["nation"]); $index = rand(0,$upper-1); if($offense_infantry["number"][$index] > 0){ $attInfantry--; $offense_infantry["number"][$index] -= 1; $k+=1; } if($offense_infantry["number"][$index] ==0){ unset($offense_infantry["number"][$index]); unset($offense_infantry["nation"][$index]); } Ok, now that it's unset, I don't want to be able to hit that unit again, i want it out of the array and all the rest smushed together. Is this right? Also, after each combat, i want to unset all my arrays, can i just do this: unset($offense_infantry); ? Thanks. Mike [/quote] the error message your getting something that is set in the PHP.ini file, which looks like it's set to 30 seconds, so a php script cannot take more than 30 seconds to complete.
  5. [!--quoteo(post=353236:date=Mar 9 2006, 01:40 PM:name=k4pil)--][div class=\'quotetop\']QUOTE(k4pil @ Mar 9 2006, 01:40 PM) [snapback]353236[/snapback][/div][div class=\'quotemain\'][!--quotec--] Its actually an int. What i meant was ; $query = INSERT in table1 values '' '2' '0' That zero causes it to be output no matter what the searcg criteria. e.g. Select * from table1 where fig2 = "5" will still output the row above. When i delete the rows with 0 values everything else works fine. [/quote] can you post the exact code as it is in your page?
  6. [!--quoteo(post=353234:date=Mar 9 2006, 01:37 PM:name=fohanlon)--][div class=\'quotetop\']QUOTE(fohanlon @ Mar 9 2006, 01:37 PM) [snapback]353234[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi Does any one have any ideas how to create varaibles from a for loop that will be accessible on this page and can be posted to other pages Heres what I have for($i = 0; $i < 6; $i++) { $g = "gender".$i; $d = "day".$i; $m = "month".$i; $y = "year".$i; $e= "education".$i; $gender."$i" = $_POST[$g]; $day."$i" = $_POST[$d]; $month."$i" = $_POST[$m]; $year."$i" = $_POST[$y]; $today = date("Y-m-d"); $t = explode("-", $today); $person_age = calculate_age($day, $month, $year); $education = $_POST[$e]; echo "Gender: " . $gender."$i" . " Day: " . $day."$i" . " Month: " . $month."$i" . " Year: " . $year."$i" . " Education: " . $education."$i" . '<br>'; } I want to be able to create 6 sets of varaibles for gender, age, month, year, education and be able to access them on the page as separate variables. many thanks, Fergal. [/quote] I don't understand what you want, but maybe using an array would help? for example $year[$i], $day[$i].
  7. [!--quoteo(post=353116:date=Mar 9 2006, 03:05 AM:name=pixeltrace)--][div class=\'quotetop\']QUOTE(pixeltrace @ Mar 9 2006, 03:05 AM) [snapback]353116[/snapback][/div][div class=\'quotemain\'][!--quotec--] guys, i need help again, please check [a href=\"http://www.sinagtala.net/sinag3/upcomingmain.php\" target=\"_blank\"]http://www.sinagtala.net/sinag3/upcomingmain.php[/a] notice that the dates are not up to date already what i mean is at has passed already. what i wanted to happen there is when the date is not up to date already let say if the date that is specified there is not from mar9 2006 onwards there will be a message saying that "no new updates" this is the script that i used for that page ========== <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <? include 'db_connect.php'; $uSql = "SELECT event_update, event_image, event_title, event_description, event_imagelink FROM events ORDER by event_date DESC LIMIT 5"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } else{ while($uRow = mysql_fetch_row($uResult)){ $event_imagelink = $uRow[4]; ?> <table width="285" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="5"><img src="images/spacer.gif" width="10" height="5" /></td> </tr> <tr> <td>&nbsp;</td> <td colspan="2" align="left" valign="top"><span class="bodytext"> <?= $uRow[0]?> </span></td> <td width="10" rowspan="3"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td width="10" rowspan="2"><img src="images/spacer.gif" width="10" height="10" /></td> <? if ($uRow[1] == 1) { echo ""; } elseif ($uRow[1] == 2){ echo '<td width="60" rowspan="2" align="center" valign="top">'; echo '<a href="images/events/'.$event_imagelink.'.jpg" target="_blank" class="fotgal"><img src="images/events/thumbs/'.$event_imagelink.'.gif" width="60" height="60" border="0" class="fotgal"></a>'; echo '</td>'; }?> <td width="10" rowspan="2"><img src="images/spacer.gif" width="10" height="10" /></td> <td width="270" align="left"><span class="bodytext3"> <?= $uRow[2]?> </span></td> </tr> <tr> <td align="left"><span class="bodytext1"> <?= $uRow[3]?> </span></td> </tr> <tr> <td colspan="5"><img src="images/spacer.gif" width="10" height="5" /></td> </tr> </table> <? } } ?></td> </tr> </table> ===================== hope you guys can help me with this. thanks in advance!!! [/quote] If I'm understanding what you want to do correctly, then you need to alter your MYSQL SELECT command to something like. $uSql = "SELECT event_update, event_image, event_title, event_description, event_imagelink FROM events WHERE event_date = '$somedate' ORDER by event_date DESC LIMIT 5"; then you need to set $somedate as the date you want to search, but remember to do it in the formation of yyyy/mm/dd and set the field in mysql to a date type.
  8. [!--quoteo(post=353231:date=Mar 9 2006, 01:23 PM:name=k4pil)--][div class=\'quotetop\']QUOTE(k4pil @ Mar 9 2006, 01:23 PM) [snapback]353231[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi there ppl. Quick question. I am adding data to my database. But when i search the database i am getting all fields that are being searched for as well as those that are empty. e.g. If i add to my database as follow; table (uniqueID, fig1, fig2) $query = INSERT in table1 values '' '2' '3.0' $query = INSERT in table1 values '' '4' '5' And then if i search; $query = SELECT * from table1 WHERE figure2 = '4' both rows are returned because there is an 0 in fig2 in row 1. Any idea wots goin on???? Is it something to do with stripping empty chars? [/quote] have you got the fig2 column setup as an INT or FLOAT or something else?
  9. I have a mysql database with prices, airports and date of holidays. I want to create a script using PHP that queries the database and returns the results in XML, then I want to create a client page that can request data from the database and read the results returned from the database. I've been looking around and found I could probably use nusoap to do this, but I can only find example and tutorials for returning 1 value from the database, where I would need to return a multidimensional array of results. for example, all hoidays in june departing from london gatwick airport. Doe anyone have any links to website that might show me how to do this?
×
×
  • 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.