Jump to content

siric

Members
  • Posts

    116
  • Joined

  • Last visited

Everything posted by siric

  1. I do not know the schema for GoDaddy, but usually copying the file from a localhost verbatim will not work. Try changing the hostname to "localhost".
  2. I would start by breaking down the problem line since I find that double quotes can cause unnecessary stress. Change $query = mysql_query("SELECT Admin FROM Users WHERE Username = '$_SESSION['s_logged_n']' LIMIT 1") or die(mysql_error()); to $s_logged_n = $_SESSION['s_logged_n']'; $query = mysql_query("SELECT Admin FROM Users WHERE Username = '$s_logged_n' LIMIT 1") or die(mysql_error());
  3. Your script shows the database name as "vixtay.db", yet the GoDaddy information shows the name as "vixtayDatabase".
  4. This is the way to go. Integer will not allow commas (it strips anything after).
  5. What is the data type on the price? If it is text or varchar, you will get that problem. Make sure that it is set to integer or float.
  6. What you need to do print the variables all the way along the script and follow along manually. This should help you find where the problem variable is.
  7. $logged_string = "$_SERVER[REMOTE_ADDR] |" . date("j M Y g:i a")." \n\r" ; $file = fopen("userIP.log", "a"); fputs($file, $logged_string, strlen($logged_string)); fclose($file);
  8. As a debug, I would print the $query statement to a logfile and check it when the problem occurs.
  9. You need to run a select for each year and order the results Say you had a table named TABLE with columns DATE and VALUE. $sqlYear = "SELECT DISTINCT YEAR(datepro) AS YEAR FROM factory_output ORDER BY YEAR DESC;"; //This will select all unique instances of the year from the date field and sort them in descending order $resYear = mysql_query($sqlYear); $numYear = mysql_num_rows($resYear); for ($i = 0; $i < $numYear; $i++) { $year = mysql_result($resYear,$i,'year'); $sqlValue = "select VALUE from TABLE where year = '$year' order by VALUE"; $resValue = mysql_query($sqlValue); $numValue = mysql_num_rows($resValue); echo "$year <br />; echo "--------- <br />; for ($j=0; $j < $numValue ;j++) { //Rotates through each instance of the value for that year $value = mysql_result($res,$j,'value'); echo "$value <br />; } echo "<br />"; } Wrote this on the fly, so give this a wing and let us know.
  10. That was the problem. I started from an if statement from scratch and realised just before I saw this post. Much Thanks.
  11. Thanks. Will try this. Have tried it and it doe snot work. Button is always unchecked.
  12. Hi, I am pulling data from a database to populate a form for editing purposes. The form includes many radio buttons. Is there a more elegant way to accomplish this than the following - if ($var1 = '1') { print "<input type='radio' value='1' checked name='quality'>1<p>; } else { print "<input type='radio' value='1' name='quality'>1<p>; } if ($var1 = '2') { print "<input type='radio' value='2' checked name='quality'>2<p>; } else { print "<input type='radio' value='2' name='quality'>2<p>; } ...... Thanks
  13. [!--quoteo(post=363665:date=Apr 11 2006, 02:20 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Apr 11 2006, 02:20 PM) [snapback]363665[/snapback][/div][div class=\'quotemain\'][!--quotec--] Firtly, the Msxml2.ServerXMLHTTP object is not a native asp object, but an extension. It looks like most of this functionality would be available in php's [a href=\"http://php.net/curl\" target=\"_blank\"]curl[/a] extension though. Server.Createobject = curl_init() oXmlHttp.setRequestHeader = curl_setopt() oXmlHttp.send = curl_exec() Response.Write = echo() [/quote] Thanks for the info.
  14. Hi, I have a short script that I need to convert from ASP to PHP. It basically pushs headers and variables through a URL from a form. [code] ' Assign values to variables strURL = "http://192.168.254.1:7000/" varRecipient = Request("frmPhone") & ":1:1" varSubject = Request("frmSubject") varMessage = Request("frmMessage") varContentLength = Len(varSubject) + Len(varMessage) Set oXmlHttp = Server.Createobject("Msxml2.ServerXMLHTTP") oXmlHttp.open "POST", strURL, False Call oXmlHttp.setRequestHeader("Host","Host") Call oXmlHttp.setRequestHeader("X-Service","service") Call oXmlHttp.setRequestHeader("X-Password","password") Call oXmlHttp.setRequestHeader("X-Sender","sender") Call oXmlHttp.setRequestHeader("X-Recipient",varRecipient) Call oXmlHttp.setRequestHeader("Content-Length",varContentLength) oXmlHttp.send(varSubject & varMessage) If (oXmlHttp.status <> 200) Then   ' If not successful display error response text and code   strReturn = oXmlHttp.responseText   Response.Write(strReturn & "<br>")   Response.Write(oXmlHttp.status & "<br>")   Response.Write(oXmlHttp.readyState & "<br><br>")   Response.Write("Error!! <br><br>") Else   ' Else display sms sent   Response.Write("<b>All Ok!</b> <br><br> Recipient(s): " & Request("frmPhone") & "<br> Subject: " & varSubject & "<br> Message: " & varMessage & "<br><br>") End If [/code] So I am trying find the equivalent of Server.Createobject, oXmlHttp.setRequestHeader, oXmlHttp.send, Response.Write It is possible? My research is pointing me in the direction of AJAX. Is that the only option? Thanks Steve
×
×
  • 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.