Search the Community
Showing results for tags '[php]'.
-
Hi guys Could any one tell me the best way to encript data from php and store it in mysql This would be a realy big help as the system is going to store sensative data Thanks JToland
-
Hi, We are looking to use PHPmyFAQ to use as an internal knowledge base and I'm having trouble with getting LDAP and SSO working. The support from the website is very limited. I have it configured with LDAP and this is working fine. When I enable the SSO section, only users who have logged in previously are logged in automatically. From reading on the site it would appear that the only check for SSO is on the username and not domain\username The code below is part of the SSO.php Is anyone able to help me debug the PHP? /** * Checks if the username of the remote user is equal to the login name * * @param string $login Loginname * @param string $pass Password * @param array $optionalData Optional data * * @return boolean */ public function checkPassword($login, $pass, Array $optionalData = null) { if (!isset($_SERVER['REMOTE_USER'])) { return false; } else { // Check if "DOMAIN\user", "user@DOMAIN" or only "user" $remoteUser = explode('\\', $_SERVER['REMOTE_USER']); if (is_array($remoteUser) && count($remoteUser) > 1) { $user = $remoteUser[1]; } else { $remoteUser = explode('@', $_SERVER['REMOTE_USER']); if (is_array($remoteUser) && count($remoteUser) > 1) { $user = $remoteUser[0]; } else { $user = $_SERVER['REMOTE_USER']; } } if ($user === $login) { return true; } else { return false; } } } /** * Returns true, if $_SERVER['REMOTE_USER'] is set. * * @param string $login Loginname * @param array $optionalData Optional data * * @return boolean */ public function checkLogin($login, Array $optionalData = null) { return isset($_SERVER['REMOTE_USER']) ? true : false; } } Thanks, Michael
-
Ok, so I've just set up my first apache server running under windows and I'm very new to all this. I've configure everything to make it accessible externally and installed PHP V5.2.17 and Ajaxplorer V4.0.4. Now, by default, it would appear that PHP limits the maximum upload to 2Mb but this is too small for me, so after some research I have altered the PHP settings to change the maximum upload size but it hasn't worked... Any ideas? I have altered the following sections of the PHP file with no luck: memory_limit upload_max_filesize and post_max_size Ajaxplorer doesn't have any limits, this is set purely by PHP as stated on their website. I have uploaded the ini as a text file if this would be any help to anyone to help me and my test PHP can be accessed here. All changes appear to be displayed in here (The values are set quite high as I have tested from 10mb up to 100GB). If you would like to login to the ajaxplorer to view it if this might help it can be accessed here Username: test Password: test123 I've restarted apache and the server various times after changes were made. Any help appreciated - and I'm new to PHP and apache so please consider that in your answers php.txt
-
I've set this up slightly wrong - when an email is rejected it works fine but sends to the admin email address (like it does when one is created) I would rather a reject email is sent to the person who requested the room! anybody know where i've gone wrong.
-
Hi, I have a word document on the intranet, what is a template. I want to be able to add merge data from the mySql database so when the user selects the name from the drop down box and selects go it will fill in the associated data onto the word document and show on the screen where they can save it, print it ... Any pointers, please let me know, Stuart
-
Has anyone used jupdate to upgrade their Joomla 1.5 to 1.6? I can't even seem to get it to start. Installed ok and added the moo_tools and enabled that. When I open the Jupgrade I get the 'Start Upgrade' image, but cannot click it. Its just an image rather than a link?
-
Our booking system was outdated (VB6 I think it was done in) so, after finding no nice clean alternatives that did what we wanted on the web I got to designing my own. The majority of development is now finished and we've rolled it out in school to trial. Uploaded a few screenshots for those that are interested. Once we are happy it works as needed I will get about releasing this to the public. [ATTACH=CONFIG]8554[/ATTACH][ATTACH=CONFIG]8553[/ATTACH][ATTACH=CONFIG]8552[/ATTACH][ATTACH=CONFIG]8555[/ATTACH][ATTACH=CONFIG]8556[/ATTACH]
-
I'm in the process of designing a new web site. This will most likely be written in PHP/HTML/Java, using MySQL as a data store. Once the website is completed, I want to transfer the site to a droid app (among other things) and it seems the only (from what I can see) way to do this is by making a REST-ful site. I don't want to create the site until I know exactly what I need. I understand the REST concept (I think), but I can't see any tutorials on how to create a REST-ful site in PHP etc etc Can anybody help me out, or perhaps suggest another way to allow droid apps to retrieve data from a MySQL database?
-
I have one of these that works ";} elseif ($lib_num<'22') {echo "web/img/tick.png"; } elseif ($lib_num=='28') { echo "web/img/full.png"; } else {echo "web/img/warning.png"; Tried changing it for another part of my page but can't see where i'm going wrong if ($lib_opened['active']=='1') { echo "web/img/full.png"} else { echo $lib_num ." of 28 PCs used" .; } I just get the error i've been coding all day and my eyes hurt now!
-
Hi Forum Our company has upgraded to MS Exchange server 2010 Sp1 but now my Imap PHP scripe does not connect or does not receive a reply from Exch 2010. We use to have Exch 2007 Sp2 and it worked fine. $username="domain/user"; $password="password"; $mbox=imap_open("{172.16.0.73:143/imap}Inbox",$username,$password); I have also tried $mbox=imap_open("{172.16.0.73:143/imap/novalidate-cert}Inbox",$username,$password); Is there something different in the way one should connect to Exch 2010 compared to Exch 2007?. Our Exch administrators sais that Imap is enabled. The response I get from imap_last_error() is "[CLOSED] IMAP connection broken (server response)" Can anyone help? Regards,
-
- exchange 2010
- imap
-
(and 1 more)
Tagged with:
-
me again with another php question cos i know you all love me we have webhelpdesk set up using a mysql db. i've just had a look through and it stores the helpdesk tickets under the job_ticket table. in that table it has the job name/job description/date submitted etc which I hope i could pull out quite easily with some php. the problem is, it doesn't list the username in there, it lists the user ID, which is then a part of the client table along with their username. now i know to get all the jobs from job_ticket i could just grab all the rows, loop them in php and set variables for ticket_name/ticket_desc etc. i know i could also do something like: SELECT * FROM `helpdesk`.`client` WHERE `CLIENT_ID` = xxxx but then how do i pair the two, so as it goes through the loop getting the job details, it then checks the user id, finds the username from it and carries on? would it be something like $query="SELECT * FROM job_ticket"; $result=mysql_query($query); $num=mysql_numrows($result); $i = 0; while ($i < $num) { $jobname=mysql_result($result,$i,"job_name"); $jobdesc=mysql_result($result,$i,"job_desc"); $userid = mysql_result($result,$i,"user_id"); $query2 = "SELECT * FROM `helpdesk`.`client` WHERE `CLIENT_ID` = $userid"; $result2 = mysql_query($query2); $user_name = mysql_result($result2,$i,"user_name"); echo "$user_name $jobname $jobdesc "; $i++; } bearing in mind i've never done php in depth before this week so this is all sort of cobbled together from examples and what i assume would be correct. would what i've posted above work? my one thought is that in the $user_name variable i've set it to use $i but $i was used for the initial query, not the username query, so would it still work or would i have to change something?
-
[php] Multiple Selections Checkboxes Forwarding to an Email
glennda posted a topic in Web Development
Similar to what the post here I am trying to have a form submit to a PHP page which then forwards the request using PHP mailer. This is what i have for the the form checkbox selection in the form RAMP1P2P3P4RPMP5P6 Then in the PHP script I Have $periods = $_REQUEST['periods']; But all that gets submitted through the email is Array? What have i done wrong? -
I use the following code to allow parents to email into the school while keeping the the email address hidden. Its a simple post form going to another php page with the following code. $to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $address = getenv('REMOTE_ADDR'); $headers = "From: $from"; $subject = "Email From School Website"; $today = date("d/m/Y"); $minutesseconds = date("l dS \of F Y h:i:s A"); $fields = array(); $fields{"Name"} = "Name"; $fields{"Regarding"} = "Regarding"; $fields{"Email"} = "Email"; $fields{"Message"} = "Message"; $fields{"address"} = "Recieved from Ip address $address this email was posted on $minutesseconds (add 6 hours for GMT time) "; $fields{"Sender"} = "This email was sent to $to"; $body = "We have received the following email via the school website:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: [email protected]"; $subject2 = "Thank you for contacting "; $autoreply = "Thank you for contacting us. A member of staff will get back to you as soon as possible. If you have any more questions, please visit our website http://www.wykeregisjun.co.uk"; if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $to ="[email protected]"; $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) {header( "Location: http://www.wykeregisjun.co.uk/sendingemail.php" );} else {print "We encountered an error sending your mail, please notify [email protected]"; } } } ?> Unfortunately we are getting a ton of spam being sent through. What I really need is a way of checking if the message contains "http://" and if it does then to not send the email and redirect to another page. Any PHP gurus out there that can help please?
-
$session_start(); echo "test" if ($_SESSION['status'] == 8) { echo "never gets this far Grrrr."; } else { echo "</pre><table>"; echo ""; echo "form stuffform stuff"; echo ""; echo ""; echo "non form stuffnon form stuff "; echo "</table>";<br> $_SESSION['status'] = 8;<br> echo $_SESSION['status'];<br> }<br>?&g Okay, I'm trying to write a new asset management database for the school. I am using a WAMP environment on Windows 2003 R2 in a M$ Virtual Server VM. Everything has been going swimmingly until I hit upon this problem I just can't see the answer to. The above is a heavily edited version of the script causing me problems. On the first pass: 'test', the table and form contents, and '8' are displayed on the screen. When you click on the 'ADD' button to initiate the second pass I get a: HTTP 500 error. Now, the address in the form action is correct. If I change it to another page in the same folder the 'ADD' button works. But when it is asked to reload this page, it doesn't! I have used the same basic code on around half dozen pages without problem. The only other thing of significance is that I am posting around 10 variables from the form this time. That said I have another script that can dynamically post 10's (100's) of variables from it's form and that works without error. Anyone got any pointers, something I should be looking at/for to resolve this strange problem? Cheers Terry.
-
I have an apache 2.2.11 server with php 5.2.9 and mysql 5.1.34 running on 64bit windows server 2k3. i have enabled the ldap extensions within php, but am not sure on how to use the ldap stuff, what i would like it to do is to pick up the users system login details and display their username. once i have got that i would like to deny access to pages depending on which ad group they are in, which i don't know how to do either.
- 13 replies
-
- active directory
- ldap
-
(and 2 more)
Tagged with:
-
I long in as Administrator and created a new user with a password .the user details are storing in database.when ever i'm trying to log in with that new user login id and with that password.I'm not able to login.[please help me...
-
Hi, Does anybody have any suggestions for a weather API? It needs to be able to do historical look up for a specific post code. An added benefit would be free as well! Thanks Chris
-
Hi, At present the PHP page reads the MySQL data and prints on screen and if the result if 'FREE' it shows a clickable image for the user to book. I am looking for something that allows the user to drag the result they fund to another location with in the table. I.e. user has box 1 filled with their name, they can drag their name to box 9 and it saves it, so they can go back on the it will be their. If anyone knows where I can firn maybe a tutorial, or guide to get started with this, as I have looked and cannot see anything. Cheers. Stu
-
I keep seeing examples online where usernames and passwords are stored in plaintext using PHP script in a file such as connection.php. Is this safe if pulling website content from a database or will potential attackers be able to read the source-code?
-
So, there's a need at our school for a Bus Reservation System. Having trawled the interwebs and found nothing that's really to my satisfaction (anyone know of anything?), I'm starting development on my own system. Before I start it though, I want to see if there's any level of interest in it from any of you fine folks. If so, I'll make sure it's usable by pretty much anyone. If not, wahey for South African specifics. Features to include: Buses Add/Remove/Edit Bus in system Bus spec to include: Capacity, License Plate, Model, Make, License Expiry, License code needed to drive Drivers Name, Surname, School (We have three schools), email address, license type, license expiry date Bookings Add/Edit/Delete booking Booking by manual process or by automatic process Manual process: - Select bus, select driver, allocate time and date - Confirmation email sent to all involved Automatic process: - Select number of students, select date and time - System allocates buses and drivers based on license, capacity and availability - Confirmation emails sent to all involved Any suggestions, please stick them here - I'd be interested to know what people would want as it's likely that we'd want it too
-
I'm trying to make the display of computers not being used as mentioned in another thread. I am using Webmans Login tracker for the script and database but I've got an error in the Mysql syntax which i can't seem to work out. $computer = mysql_query("SELECT hostname_id FROM logins WHERE active = 1"); $computer_f = mysql_fetch_array($computer); $computer_f_id = $computer_f['hostname_id']; $lib = mysql_num_rows(mysql_query("SELECT hostname FROM hostnames WHERE hostname LIKE 'lib-%' AND hostname_id = $computer_f_id")or die(mysql_error()));
-
I have a php script which i am going to hopefully use for my noticeboard which i have been creating. I have a script which imports to the database. I also have one which is displaying the contents of the mysql table. But i can't seem to work out how to set it up so that it displayes in a nice format. I have this while($result = mysql_fetch_array($query)) { echo $result['subject']; echo $result['name'];echo $result['post']; echo $result['expire'];} but that just is displaying everything. I have tried everything by trying to echo it different things like tables etc. but cant't seem to work out what is wrong!
-
Hello Just signed up on recommendation of colleague. My problem is similar to 46774-html-table-change-cell-colour-value-entered.html The cell colour is not based only the cell contents so cannot use if (this.value== etc )...it is based on the difference in values of two fields returned by the MySql query (sql snippet below) which is used to populate the cells. The fields are numeric representations ("ordinals") of a "current grade" and a "minimum expected grade"; so for example, if the ordinal difference is greater than +2, cell is RED and so on. I am using PHP and MySql. I use a java "onchange" script which calls an AJAX script (identified by input parameter url) to update the MySql database, which works fine When opening the page, I am able to set the colour correctly using CSS class ($grade_class_cag) and a routine which compares the ordinals for each cell and sets the class. But...... I want to change the colour immediately and also set the value of another cell on the same HTML row, depending on the ordinal difference. I can get the colour to change immediately if I reload the page, but that loses focus, which is unacceptable - so I have added a "refresh" button which is a sort of "quarter-way-house". I have thus far been unable to find a way of either 1>> After reload, resetting the focus to the next enterable field in the row or 2>> recalculating the value of the ordinal field which changes because of the user data entry/modification The HTML snippet which displays the cell is:- class="'.$grade_class_cag . '" OnChange="jsUpdateGradeCAG(\''.$url.'\', \'SCCurrentGrade\', this.value, \''.$sgc_row['ID'].'\' );" title="Enter the Current Assessed Grade for the student" />'; /****************************************************************************************/ /* Populate option value list from coursetype grade table (05) */ /****************************************************************************************/ query = " SELECT * FROM {$_SESSION ['prf_coursetypegrade'] } WHERE CGCTCode = '{$tg_row['TGCTCode']}' ORDER BY CGUCASPts ASC "; if ($ctg_result = @mysql_query ($query)) { while ($ctg_row = mysql_fetch_array ($ctg_result, MYSQL_ASSOC)) { echo '' . $ctg_row['CGGrade'] . ''; } } else { die ('Could not retrieve permitted grades for : ' . $tg_row['TGCode'] . mysql_error()); }; echo '' .$sgc_row['CAG'] . ' The SQL snippet which calculates the ordinals, using Sub Selects is:- (SELECT ab.CBGrade AS MTG FROM prf_vw_student_all AS st_mtg , prf_alpsboundaries AS ab , prf_vw_teachinggroup AS tg_mtg WHERE tg_mtg.ID = {$_POST['txt_tg_id']} AND tg_mtg.TGCTCode = ab.CBCTCode AND st_mtg.ID = st.ID AND st.STALISAGCSE >= ab.CBLoVal AND st.STALISAGCSE < ab.CBHiVal ) AS ss_mtg, (SELECT ctg.CGOrdinal FROM prf_coursetypegrade ctg, prf_vw_teachinggroup tg WHERE tg.ID = {$_POST['txt_tg_id']} and ctg.CGCTCode = tg.TGCTCode AND ctg.CGGrade = ss_mtg ) AS ss_mtg_ordinal, sgc.SCCurrentGrade AS CAG, (SELECT ctg.CGOrdinal FROM prf_coursetypegrade ctg, prf_vw_teachinggroup tg WHERE tg.ID = {$_POST['txt_tg_id']} and ctg.CGCTCode = tg.TGCTCode AND ctg.CGGrade = sgc.SCCurrentGrade ) AS ss_cag_ordinal, "st.ID" is the primary key of the student table which the main select is retrieving The routine then uses ss_cag_ordinal and ss_mtg_ordinal to work out what the colour should be. I would welcome any pointers. Thanks PS - I see that indentation tabs have disappeared on posting.
-
I am transferring our website from a physical machine to a virtual machine. It is running Windows Server 2003, IIS 6, PHP 5.2.13 (zip package) and MySQL Community Server (Release: 5.1.48) All of the above are clean fresh installations however, when copying my Joomla site over to the new server and going to localhost it comes up with the following error PHP has encountered an Access Violation at 01ACAB4A it has also come up before with something about the "mysql" adapter not been found??
-
Hi Guys, Unfortunately we have the joys of an RM CC3 System. And I must admit I do like the RM Management Console for it usabiloty for teachers. What I want to do is have a web based program, when when it opens and the user selects a link it will bring up a progress bar and load the content. I have been trying for a while now to do this with ajax and have had no luck. Anybody got any ideas, or working example I could look at and try to make sence of it. Thanks
