-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
constantly checking if a variable has been changed
MadTechie replied to envexlabs's topic in PHP Coding Help
echo $premiso; echo "and for Qty use on change!"; -
also here http://www.phpfreaks.com/forums/index.php/topic,155984.0.html
-
$Query = "SELECT * FROM analyzer_query WHERE Employee_ID = {$_POST['Employee_ID']}"; should be $Query = "SELECT * FROM analyzer_query WHERE Employee_ID = '{$_POST['Employee_ID']}'"; Note the single quotes SELECT * FROM analyzer_query WHERE Employee_ID = '{$_POST['Employee_ID']}'";
-
[SOLVED] php insert in asp using Microsoft.XMLHTTP
MadTechie replied to becca800's topic in PHP Coding Help
you need the Thispage = i added that back bascially you could do Thispage="www.thisISmySITE.com" but Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") gets those details try it, see what happens <% Dim objHttp set objHttp = Server.CreateObject("Microsoft.XMLHTTP") Thispage=Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") objHttp.open "POST", "http://www.advicediva.com.com/ad/comments/comments.php?PAGE=" & Thispage, false objHttp.Send If objHttp.status = 200 Then response.write(objHttp.responseText) End If set objHttp = nothing %> -
http://www.google.co.uk/search?q=php+CMS found loads
-
erm.. your missing part of that error! inany case change to $Query = "SELECT * FROM analyzer_query WHERE Employee_ID = '{$_POST['Employee_ID']}'"; it should stop the error
-
[SOLVED] php insert in asp using Microsoft.XMLHTTP
MadTechie replied to becca800's topic in PHP Coding Help
Okay i think i get you.. your calling from an ASP using XMLHTTP request to call a PHP page (to do stuff) but a form on the PHP page needs to contain the path of the ASP page .. Okay.. if you doing 90% of the code in ASP i would do this <% Dim objHttp set objHttp = Server.CreateObject("Microsoft.XMLHTTP") 'Get the current page (i thin the below will do it set Thispage ="http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") 'Pass it via URL objHttp.open "POST", "http://www.yoursite.com/ad/comments/comments.php?PAGE=" & Thispage, false objHttp.Send If objHttp.status = 200 Then response.write(objHttp.responseText) End If set objHttp = nothing %> $ASPpage = urldecode($_GET['PAGE']); <input type=hidden name="href" value="$ASPpage"> Other option is PHP only <input type=hidden name="href" value="{$_SERVER['HTTP_REFERER']}"> i think thats what your looking for -
change from "../init.php" to "init.php"
-
change $ret = $db_conn->Execute("SELECT * FROM analyzer_query WHERE Employee_ID = {$_POST['Employee_ID']}") or die("Please enter correct EmployeeID"); to var_dump($_POST['Employee_ID']); $Query = "SELECT * FROM analyzer_query WHERE Employee_ID = {$_POST['Employee_ID']}"; $ret = $db_conn->Execute($Query) or die("Please enter correct EmployeeID:$Query");
-
[SOLVED] php insert in asp using Microsoft.XMLHTTP
MadTechie replied to becca800's topic in PHP Coding Help
Okay i have read this twice.. and i have no idea what your asking.. what do you want to do ? -
LMAO, I read it correctly but copied the wrong thing..
-
Okay.. i haven't used ADODB, for a while but i think this should do it.. <?php require("config.php"); if($_GET['action'] == 'post') { if(!empty($_POST['Employee_ID'])) { $ret = $db_conn->Execute("SELECT * FROM analyzer_query WHERE Employee_ID = {$_POST['Employee_ID']}") or die("Please enter correct EmployeeID"); if ($ret->FieldCount() < 1) { error("blank"); exit; } } if( empty($_POST['Date']) || empty($_POST['Activity']) || empty($_POST['Miles'])) { //if everything is not filled in than prints out error message error("blank"); exit; } else $db_conn->Execute("INSERT INTO Activity_Log (`Employee_ID`, `Date`, `Activity`, `Miles`) VALUES ('{$_POST['Employee_ID']}', '{$_POST['Date']}', '{$_POST['Activity']}', '{$_POST['Miles']}')") or die("Error in connecting to the database"); header("Location: success.php?action=success"); } function error($error) { //if error is equal to blank if($error == 'blank') { echo "Please fill in all the required fields before submitting"; } } ?>
-
check the file "msgloglist.php" exists in 'FlashChat/admin/'
-
something like this depends on the connection type <?php require("config.php"); if($_GET['action'] == 'post') { if(!empty($_POST['Employee_ID'])) { $db_conn->Execute("SELECT * FROM analyzer_query WHERE Employee_ID = {$_POST['Employee_ID']}") or die("Please enter correct EmployeeID"); //unsure if your using ODBC if ($db_conn->odbc_num_rows < 1){ error("blank"); exit; } } if( empty($_POST['Date']) || empty($_POST['Activity']) || empty($_POST['Miles'])) { //if everything is not filled in than prints out error message error("blank"); exit; } else $db_conn->Execute("INSERT INTO Activity_Log (`Employee_ID`, `Date`, `Activity`, `Miles`) VALUES ('{$_POST['Employee_ID']}', '{$_POST['Date']}', '{$_POST['Activity']}', '{$_POST['Miles']}')") or die("Error in connecting to the database"); header("Location: success.php?action=success"); } function error($error) { //if error is equal to blank if($error == 'blank') { echo "Please fill in all the required fields before submitting"; } } ?> also echo error("blank"); should be error("blank");
-
[SOLVED] structure of mysql database and sending data via php
MadTechie replied to dinvinci's topic in PHP Coding Help
Okay i only skimmed the post but i think you want something like this 3 tables (as examples) Table: users userID, UserName, FirstName Table: Gifts GiftID, GiftName, GiftPrice Table: UserGifts uID, UserID, GiftID now the 'Users' table has a list of users and the 'Gifts' table a list of gifts.. so to link a gift to a users you add a new records in 'UserGifts' with the usersID and the GiftID.. make sense ? of course Gifts could be the children and the user could be the parent.. or even users be the family name and the gifts members of that family as a side note for autonumbers.. if you do an insert use mysql_insert_id() to get the autonumbers.. hope this helps EDIT: oh the uID on UserGifts table is UniqueID, (most tables should have one) -
you need a script.. google or the freelance section works well
-
try here http://www.phpfreaks.com/forums/index.php/topic,155984.0.html
-
try this <?php $i = 0; $tmpname = ""; while ($rs_prop = mysql_fetch_array($result_prop)) { ?> <tr> <td style="padding-left:5px; padding-right:2px;" width="188" height="23" bgcolor="#E9EDF4" class="style35"><span class="style10"> <?php if($rs_prop["Name"] != $tmpname) { $tmpname = $rs_prop["Name"]; echo $rs_prop["Name"]; } ?> </span></td> <td height="23" bgcolor="#E9EDF4" class="style35" style="padding-left:5px; padding-right:2px;"><span class="style10"> <?= $rs_prop["Venue_Name"]; ?> </span></td> <td height="23" bgcolor="#E9EDF4" class="body4"><div align="right"><span class="style10"> <?= $rs_prop["Quantity"]; ?> </span></div></td> <td height="23" bgcolor="#E9EDF4" class="body4"><div align="right"><span class="style10"> R <?= $rs_prop["Income"]; ?> </span></div></td> </tr> <?php $i++; }?>
-
[SOLVED] What does \r mean and what does \n mean?
MadTechie replied to Sam Granger's topic in PHP Coding Help
Can you click solved please.. (bottom left) -
[SOLVED] What does \r mean and what does \n mean?
MadTechie replied to Sam Granger's topic in PHP Coding Help
\r = CR (carriage return) \n = LF (line feed) they are used for splitting into lines.. but to start a new line depends on the system.. Windows = \r\n unix = \n Mac = \r Now. if you view source your see the line are broken up.. but you need to convert this to html.. so to do this use nl2br() ie <?php $str ="Hello.\r\n\r\nText goes here.\r\n\r\nAnd a seperate paragraph here also!"; echo nl2br($str); ?> EDIT: Ahh .. too slow -
try this Read comments <?php //Check your connecting to the database.. (i assume thats okay) //moved the or die to the query (date is a field so use backtick) $query = "SELECT * FROM event WHERE club_id = '$club_id' ORDER BY `date` DESC"; $result = mysql_query($query)or die(mysql_error()); //Line 43 while ($row = mysql_fetch_assoc($result)) { $eventid = $row['event_id']; ?>
-
So this is a JavaScript question? if so your in the wrong section
-
you wouldn't use $i a better option would be <?php foreach($_POST as $copy) { //$copy will loop throught the values } ?> if you must use a while.. you could do something like this <?php $i++; $copy= current($_POST); while($i<$num) { $first=mysql_result($result,$i,"First Name"); echo $copy; //At the end $copy= next($_POST); } ?>
-
[SOLVED] INSERT in MySQL problem... My code is not working?
MadTechie replied to bri0987's topic in PHP Coding Help
please note the 2 options above just takes pratice.. i have spent 2 days trying to work out a problem (was a hard one) but the solution was so simple when i thought about it later