I have the following script which successfully finds the values for $payer_email, reminder_date and sub_expire_date, however where I am having trouble is when I apply a WHERE condition to the SELECT. The condition I am trying to apply is the commented out line at the end of the SELECT. The intention of the WHERE is to filter the values from the SELECT to only provide those values which point to the subscription expiry (sub_expire_date) thirty days ahead of time, but no values are found when they really should be. Can anyone tell me what is wrong? <?php error_reporting(E_ALL ^ E_NOTICE); …

Member Avatar
Member Avatar
+0 forum 1

I have a MySQL database which contains a text field which contains well formed xml. I want to export this data as an xml file named result_new.xml on the fly. I have made the tmp folder and have set the permissions on the folder to 0777. If I run this snippet in a php file with proper access to the database and correct values in the variables, I can echo the field's content correctly, but when I use the following to create a xml file, nothing happens. I cannot find the new file in the tmp folder. Can someone give …

Member Avatar
Member Avatar
+0 forum 3

I have a mysql database that has previously stored the text of an xml file including tags. I want to select that data from the database and return it as an xml file rather than just text, (eg filename.xml). It is to be further processed with a javascript file which will output as HTML. I'm no xml programmer but have been trying a couple of things and have included my most recent attempt below for constructive comment. The file check.php selects the xml data from the database, but the display does not show any xml tags. They are there though …

Member Avatar
Member Avatar
+0 forum 3

Some help would be great here. The following snippets work, but I am unable to figure out how to activate the error message "You did not select a name for editing". Both of the other error codes work but if I input 'given' and 'family' and forget to select the relevant radio button, the error message doesn't work. No other problems with the code. [CODE] <html> <table> <?php // Query member data from the database $query1 = mysql_query("SELECT userId FROM users WHERE managerId='".$recid."' AND userGroup='".$group2."' ORDER BY userId ASC"); while($row1 = mysql_fetch_array($query1)) { $firstGroup .=$row1['userId']. ' <input type="radio" name="snames" value="'.$row1['userId'].'" …

Member Avatar
Member Avatar
+0 forum 1

My web host recently advised me that my site was being migrated (after the event). I am led to believe that this is in the interests of improving the service. Immediately after the migration I discovered that one php file using date/time functions was stalling and numerous files were showing an error`Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We …

Member Avatar
Member Avatar
+0 forum 5

I can read the session.save_path from the remote server at php_info.php. It is set to "no value". I assume that this defaults to /tmp. I understand that in the absence of some other command, this means that session variable files will be saved here. The error message is Warning: session_start() [function.session-start]: open(c:/wampserver/tmp/sess_prrfb9ljt01401ls8oh4un7qi5, O_RDWR) failed: No such file or directory (2) in It's trying to open a session file using a Windows-style filepath. It might be a configuration parameter being set inside my PHP code, but a local site search of 6600 files for "wampserver" does not come up with anything. …

Member Avatar
Member Avatar
+0 forum 1

My web host recently migrated to a new server and in the process upgraded to PHP5.4 I have a snippet that was doing timezone conversion, but since the upgrade the script stops dead on a certain line in the snippet, and though a web page is displayed, none of the content (including html) displays beyond that PHP line. Here is the code with the problem lines commented out: <?php $timestamp = strtotime($create); $dtzone = new DateTimeZone($tz); $time = date('r', $timestamp); /* Problem code begins here $dtime = new DateTime($time); $dtime->setTimeZone($dtzone); $time = $dtime->format('F d, Y'); Problem code ends here*/ echo …

Member Avatar
Member Avatar
+0 forum 21

Since my remote server was recently migrated I am receiving an error message generally which goes like this Warning: session_start() [function.session-start]: open(c:/wampserver/tmp/sess_4bkd7oiqmi7298mhikv09447t6, O_RDWR) failed: No such file or directory (2) in /home/safetyte/public_html/portal/woodwork_sub/ws_member_profile.php on line 2 Lines 1 and 2 are <?php session_start(); This message is coming from the remote server but refers to a folder on my local computer. This message is displayed on any computer that links to http://www.safetytestingonline.com/portal/woodwork_sub/ws_member_profile.php as well as several other online links, though not all. Any help would be appreciated. My webhost isn't doing much for me.

Member Avatar
Member Avatar
+1 forum 1

I have the following code which is intended to supply the family and given names of people who are in the users table but not in the quiz table. Can I even do this, and this throws an error anyway? `$query = mysql_query("SELECT quiz.userGroup AS q_userGroup, quiz.userDate, users.userGroup AS u_userGroup, DATE_FORMAT(quiz.addDate,'%b %e, %Y'), quiz.passState, users.family, users.given FROM quiz, users WHERE quiz.userIdRec = users.id AND users.userGroup IN('$g1', '$g2', '$g3', '$g4', '$g5') AND quiz.managerId='".$userid."' AND quiz.quizTitle ='".$_SESSION['squiz']."' AND (SELECT users.family AS u_family, users.given AS u_given FROM users LEFT JOIN quiz ON users.id = quiz.userIdRec WHERE quiz.userIdRec IS NULL AND users.userGroup IN('$g1', '$g2', …

Member Avatar
Member Avatar
+0 forum 4

I have a javascript popup window which relies on php for it's dynamic content. It is a full-screen window without menu bars etc. It works in Chrome, Firefox and Explorer, but dynamic content is absent in Opera, Netscape and Safari. Where do I start in trying to fix this. I have no idea.

Member Avatar
+0 forum 0

I was browsing a MySql database using phpMyAdmin and I have probably inadverdently changed a setting. I have a field which contains quite large text entries. Before this problem arose the display showed just a few words of the text entry followed by a "...". Now the display shows the whole entry, meaning that the rows in Browse mode are really big. My question is, how can I instruct phpMyAdmin to limit the size of the returned display in this field?

Member Avatar
Member Avatar
+0 forum 5

The following script creates a child window check/check.php in Firefox but not in IE or Chrome. I know that I should not be using [I]href = "javascript:void(0);"[/I] but I cannot work out a better solution at this stage. Here is the snippet I'm using. While this code contains PHP I think that I really have a javascript problem. Any help would be greatly appreciated. [CODE] <?php if ("{$row['passState']}" == 0) { echo "<a href ='javascript:void(0);', NAME = 'var', basestring = 'window'+new Date().getTime();', title = 'Results of quiz' onClick = window.open('check/check.php?quizTitle = ".urlencode($quizTitle)."','width = 1100, height = 510, resizable = yes, …

Member Avatar
Member Avatar
+0 forum 1

Here is the code I am trying to make work. As you can see, the code as it stands will call a javascript window. All of that works well. I now want to add the lines that are commented out, in order to make the window display conditionally. I have tried many combinations of escaping quotation marks, or substituting them, but nothing works properly. Usually I lose the link action along with a display of some of the code attached to the link. Could someone have a look and see if they can propose a solution. [CODE] <?php //if ($review …

Member Avatar
Member Avatar
+0 forum 5

I have the following code. [CODE]$result = mysql_query("SELECT * FROM topics LEFT JOIN quiz ON topics.managerId = quiz.managerId WHERE quiz.userId = '$userId' AND userId= '$userId' AND $egroup = 1 GROUP BY topics.title")or die(mysql_error()); while ($row = mysql_fetch_array($result)){ echo "{$row['quizId']} <br />\n"; echo "{$row['title']} <br />\n"; echo "{$row['passState']} <br />\n"; } [/CODE] My problem is that the last element "passState" (row 5) echoed in the series of arrays will only display the data taken from the first record encountered by the query. This data is repeated without change throughout the displayed array. "quizId" and "title" come from the "topics" table and …

Member Avatar
Member Avatar
+0 forum 2

Hi members. I am working on a couple of pages that present me with the same problem. I have set up a log in that puts member data into a session variable. Then the logged in member proceeds to alter some of their own data using a form, and the data is posted to a mySql database. Then the member goes to a new page where there is a form that is set up using the session variables. The problem is that because the member has changed his own data, the existing session variables are out of date. If the …

Member Avatar
Member Avatar
+0 forum 5

I have two related scripts. The first script displays a pass or fail icon depending on whether the value of passState is 1 or 0. If a student failed a quiz the row also displays a link to check.php so that the student can view their quiz attempt in a block of HTML named Result in the database. I need to create a session variable at this point to use as a local variable in check.php which is shown further down here. The problem I have is that the variable is being overwritten each row of the array, so that …

Member Avatar
Member Avatar
+0 forum 4

I am writing a script to register users, but I want to add an incrementing suffix to each duplicated name. The script works and posts to the database. On entering a name for the first time, everything is OK, but when I enter a duplicate name from then on, the value entered does not clear out of the text box. I've been workingon this for a while now and the kids are starting to complain. There is a column "num" in my database which is integer and has a default value of 1. There is a fair bit of other …

Member Avatar
Member Avatar
+0 forum 1

I have the following code which displays something like this; William Science Monday William Math Tuesday William English Thursday but I want it to display without repeating the name William in the lines after the first line. [CODE] <?php $query = mysql_query("SELECT userId, quizTitle, addDate FROM quiz WHERE managerId='".$userid."' AND egroup = '$egroup5' AND passState = 1 ORDER BY userId"); while ($row = mysql_fetch_array($query)){ $userId = $row['userId']; $quizTitle = $row['quizTitle']; $addDate = $row['addDate']; ?> <table> <tr> <td><?php echo $userId;?></td> <td><?php echo $quizTitle;?></td> <td><?php echo $addDate;?></td> </tr> <?php } ?> [/CODE]

Member Avatar
Member Avatar
+0 forum 2

I have a problem with passing session variables between folders. I have a working login, and several session variables are created after a successful login. The session works fine until I try to use a script that is located in a different folder or directory. All of my scripts include a login process that is activated if the session id is not found. This is what happens as soon as a script in a different directory to that containing the original login is called. Obviously the session variables are not being passed to the new directory, even though they are …

Member Avatar
Member Avatar
+0 forum 5

Hi. I purchased some software recently but have been unable get any helpful product support with the following problem, because it's a coding matter, I guess. The purchased software is for a PayPal subscription management system, and it relies on user verification by way of a username (email address) and a hashed password. I have developed my own login scripts which use a hashed md5 password and all that is fine.I want to integrate my scripts with the purchased software using the supplied mySql database tables. My problem is that the supplied software goes a step further than a hashed …

Member Avatar
Member Avatar
+0 forum 4

I'm totally new to javascript and fairly new to php... so... I have a javascript login form that takes a users email and password, validates through a mysql database and gains entry to a folder that is protected by a htaccess file. This is set up to integrate with a PayPal subscription. All OK so far. The problem I have is that the folder contains several php files that require session data. Can anyone tell me if there is a way that the user email and password entered into the javascript form can be used as a hidden login for …

Member Avatar
+0 forum 0

I have two tables 'quiz' and 'topics'. The relevant columns in 'quiz' are 'passState' (which returns 1 or 0 representing true/false) and 'managerId' which is a record number referring to a particular administrator. The relevant columns in 'topics' are 'managerId' and six other columns named 'equip1' .... 'equip6' respectively, which refer to the allocation of particular quizzes to particular student groups. Each quiz can be allocated to none or any or all of the groups 'egroup1' to 'egroup6' by the allocation of true/false value to each. The code below displays all of the required data on the page, but not …

Member Avatar
Member Avatar
+0 forum 6

I'm not sure if this should go in the mysql forum of here, but probably applies to both. I've posted some php to show what's happening with my array and code to create the database below. I can make the JOIN query work, but it does not produce the data required by the last echo of the array unless I enter the column name passState in the first part of the SELECT query (where I don't think it is supposed to go). The two problems that happen here are that the rows in the array are displayed in duplicate (despite …

Member Avatar
+0 forum 0

Hi everyone, I don't know whether this is a PHP or MySql problem, but I think it is the former. The following code queries the database correctly, (and before you ask, there are no duplicate database entries), but the output duplicates every row. e.g., hammer (jpg image) hammer hammer (jpg image) hammer saw (jpg image) saw saw (jpg image) saw screwdriver (jpg image) screwdriver screwdriver (jpg image) screwdriver and so on. I cannot see why the code causes the row to repeat. [CODE]<?php session_start(); if (isset($_SESSION['id'])) { // Put stored session variables into local php variable $id = $_SESSION['id']; $userId …

Member Avatar
Member Avatar
+0 forum 1

Can anyone see what is wrong here? This is my first serious attempt at this.[CODE]<?php $query1 = mysql_query(" SELECT topics.url_big, topics.url_small, topics.title, topics.".$egroup.", quiz.passState FROM topics INNER JOIN quiz ON (topics.managerId = quiz.".$managerId.") WHERE topics.".$egroup." = 1 ORDER BY title ASC"); ?>[/CODE]

Member Avatar
Member Avatar
+0 forum 2

I have the following code to upload an image using a form. I have added a button to the form to use to remove the image, but I cannot figure out how to code the button to remove the users image. (memberFiles/$id.".jpg") Here is my code to upload an image. I'd like to add code to remove an image. Any ideas? [CODE]<?php session_start(); $id = $_SESSION['recid']; $school = $_SESSION['college']; // Process the form if it is submitted if ($_FILES['uploadedfile']['tmp_name'] != "") { // Run error handling on the file // Set Max file size limit to 120kb $maxfilesize = 120000; …

Member Avatar
Member Avatar
+0 forum 3

Here is my form.It works fine.Because it is a radio button form, only one variable of the six available is chosen. This variable is echoed in the relevant hidden field. Then when the variable from the hidden field is posted, it is supposed to be converted to one of six specified strings and then posted to the database into column "egroup". The problem I have is that it always goes to the last variable and posts the string "egroup6". I want to break out of the str_replace routine and post the replacement name which matches the sequence of the hidden …

Member Avatar
+0 forum 0

I know how to do basic forms. What I want to do is to pass a set value as a hidden field to accompany an input text value, and have both values entered in the database record. You can see in the code below that the form asks for names for up to six student groups, such as "Year7", "Year8", "Year9" and so on. What I want my form to do is to post the accompanying input name (in this case "group1", "group2" and so on) as a hidden field to another column in the same record, so that I …

Member Avatar
Member Avatar
+0 forum 2

I've got my code working OK in that the correct results are drawn from the database. What I have here in the code is an array consisting of an image, accompanied by its title and thirdly a link to activate a quiz associated with the image. Everything works fine, except that I have an unknown number of sets of data (image, title and link) which I want to display so that each set of data takes up a new row. The code I have here places all of the results into the same row. Any suggestions are most welcome. [CODE] …

Member Avatar
Member Avatar
+0 forum 2

I'm trying to display an array of images by using the following code but no images are displayed. The images are in a folder named images. Is there some problem using a variable in a path name? Or am I doing something else that is wrong? The variable $thumbnail refers to a column of filenames. If I echo that variable as an array, I get the required filenames. I just cannot turn that into an array of images. [CODE] <?php $query = mysql_query("SELECT title FROM topics WHERE managerId='".$managerId."' AND egroup1='"."1"."' ORDER BY title ASC"); while($row1 = mysql_fetch_array($query)) { $thumbnail .= …

Member Avatar
Member Avatar
+0 forum 9

The End.