
jairathnem
Members-
Posts
93 -
Joined
-
Last visited
Everything posted by jairathnem
-
in the URL what value is set for 'page'?
-
you could just echo the name foreach($images as $image) { Echo '<img src="'.$image.'"/> <br />'; echo $image; }
-
use mysql_fetch_assoc() to get the data. But instead, look into PDO instead of mysql.
-
you basically want to import all data in CSV file to the DB right? if so, $csvFile = "test.csv"; $csvSeparator = ","; $csvFileLength = filesize($csvFile); $handle = fopen($csvFile, "r"); $csvData = fread($handle, $csvFileLength); fclose($handle); var_dump($csvData); $data = explode("\n",$csvData); This will seperate the data to seperate arrays, which you can append to a variable and execute it.
-
post your code.
-
use textarea HTML tag. get entered query via GET or POST and process it. but if you want highlighting you may have to write your own js for that.
-
From which page is data POST'ed to this page called? You will have to check there to see if it is calling this page with blank data.
-
EDIT to prev. post : change query to "SELECT * FROM `course_selection` order by `difficulty`, `spaces` desc"
-
<?php require_once 'connection.php'; $res = mysqli_query($con,"SELECT * FROM `course_selection` order by `difficulty`"); while($row=mysqli_fetch_assoc($res)){ $data[] = $row; } mysqli_close($con); echo "Before preocessing: <br />"; var_dump($data); $space = 120; $space_needed = $space; $space_filled = 0; $i= 0; $count = 0; foreach($data as $value){ $count = $value['spaces'] + $count; } echo "count $count <br />"; if($count < $space) { echo "Too may space requested, less available";die; } while($space_filled != $space) { if($data[$i]['spaces'] <= ($space_needed - $space_filled)){ $space_filled = $data[$i]['spaces'] + $space_filled; $data[$i]['spaces'] = 0; } else{ $data[$i]['spaces'] = $data[$i]['spaces'] - ($space_needed - $space_filled); $space_filled = ($space_needed - $space_filled) + $space_filled; } $i++; } echo "<br/>after processing: <br />"; var_dump($data); echo "<br /> $space_needed <br /> $space_filled"; ?> Personally I like these type of challeges as a programmer the code doesnt update the DB but the changes are done to the array, which can be used to make change to DB.
-
have you tried permalinks? http://codex.wordpress.org/Using_Permalinks
- 4 replies
-
- url rewriting
- wordpress
-
(and 1 more)
Tagged with:
-
I'd suggest you learn the basics first. The above 3 lines donot add a key of 'passwd'.
-
<html> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { $('#txt1').on('click', function() { $('#txt2').show(); }); }); </script> <input type="text" id = "txt1" /> <input type="text" id="txt2" style="display:none;" /> </html> may not be the best optimized. refine it.
-
if($check_passwd == md5($salt['passwd'])) in your code $salt is never assigned a value with key 'passwd'. It will never validate.
-
== (double equals) is equals operator i.e it matches both and returns true or false(Boolean). =(single equal) - this is assignment i.e you assign values to something. like to a variable,array..etc. you have misplaced both in your code.
-
what do you mean by least number of courses?
-
Connect to exchange server (pop3) to read through unread mails
jairathnem replied to dieterm's topic in PHP Coding Help
are you conneted through proxy? that could be the reason. -
Javascript will get this done. set the diplay : none for the text box on page load...when onfocus of the password field change the display property to block or something.
-
Connect to exchange server (pop3) to read through unread mails
jairathnem replied to dieterm's topic in PHP Coding Help
you can use IMAP to get that done. http://php.net/imap_search -
you could echo the message directly. echo "Thank you.";
-
if($server_data['port'] != 1234){ echo gethostbyname($server_data['ip']) . ":" . $server_data['port']; } else return null;
-
Parse Error: Unexpected T_ENCAPSED_AND_WHITESPACE
jairathnem replied to GrizRule's topic in PHP Coding Help
I dont know what use that is. But if you want to acheive that add it all to a single line and use escape sequence like \n,\t. But not sure why you want to do this. -
Parse Error: Unexpected T_ENCAPSED_AND_WHITESPACE
jairathnem replied to GrizRule's topic in PHP Coding Help
I see the following errors : 1. $new_message is a variable - on line 33 it is missing the end semi-colon. 2. no need to open php tag inside another php - you can just echo the HTML stuff. -
Parse Error: Unexpected T_ENCAPSED_AND_WHITESPACE
jairathnem replied to GrizRule's topic in PHP Coding Help
post the full code. -
Parse Error: Unexpected T_ENCAPSED_AND_WHITESPACE
jairathnem replied to GrizRule's topic in PHP Coding Help
I think the error is because of the backslash in line 36. try this if($_SESSION['USERNAME'] == 'TEP') { -
<?php $string = "123,456,123"; $split = explode(',',$string); $split = array_unique($split); $string = implode(',',$split); echo $string; ?>