
jossylala
Members-
Posts
13 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
jossylala's Achievements

Newbie (1/5)
0
Reputation
-
Like i said earlier, i just need someone to guide me towards creating it and provide sample codes when applicable. Didnt use google because i can get the kind of support i would get here,there. So please mates,help me out...
-
Hello, am undergoing a lesson on Qbasic and was told to go do and assignment and teach my group.would be droping thequestions for help, need the solution plus how to go about teaching my colleagues that is i need to understand it.Regards 1. Develop a QBASIC program to compute the mean grade of an unspecified number of students.The sentinel value for the grade is any negative value 2. Develop a QBASIC code to (a) input the grades at 100-,200-,300-,400- levels (b)Then Compute the GPA ©Award Class of Degree 3. Write a QBASIC code to perform the following tasks: Read a sequence of integers and keep a running total until either (a) A zero is read, or (b) A hundred numbers have been read, whichever happens first 4. write a program segment that will read 15 realnumbers into a one-dimentional array NUM, assuming that you do not know the format of the data nor how many numbers are on each line, except that all numbers on the same line are separated by aleast one blank space 5. write a complete QBASIC Program that reads and integer array and prints out several characteristics about the array.These characteristics are: Number of positive elements Number of Zero elements Number of negative elements Trace(sum of elements on top-left to bottom-right diagonal) Largest number of array Waiting for your help.
-
Okay,here is my full header.php code. thats where the link is locate. @ thorpe, i tried changing it but its did work. please check this and get back to me. thanks <?php include ($_SERVER["DOCUMENT_ROOT"] ."/includes/config.inc.php"); $user_id = loggedUser($sid); $contents = selectFrom("SELECT id,user_id FROM " . TBL_ADMIN_USERS . " WHERE user_id='$user_id'"); $user_type = getUserType($user_id); switch ($user_type){ case('SA'): $Type="Sub Admin"; break; case('A'): $Type="Administrator"; break; default: $Type="Admin"; } $Result = getRights($user_id); ?> <html> <head> <title><?=TITLE?></title> <link rel="stylesheet" href="<?=ADMIN_CSS_PATH?>interface.css" type="text/css"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <TABLE width="100%" height="120" border="0" cellPadding="0" cellSpacing="0" background="images/hdrbg.gif"> <TBODY> <TR> <TD height="120" valign="top"><TABLE height="120" cellSpacing="0" cellPadding="0" width="100%" border="0"> <TBODY> <TR> <TD vAlign="top" align="right" colSpan="3" height="11"></TD> </TR> <TR> <TD width="20%" height="85" align="center" vAlign="middle"><span class="indexText">Administration</span><br> <strong><a href="<?echo HOST_URL?>" target="_blank"><span class="linkColor"><?echo $HTTP_HOST?></span></a></strong></TD> <TD width=65% height="85" align="center" vAlign=top> <table width="100%" border="0"><tr> <?PHP $flag = 1; for ($j=0; $j<count($Result); $j++){ $folder_name = $Result[$j]["folder_name"]; $cat_name = $Result[$j]["cat_name"]; //echo "cat_name >>>>>>>>>> $cat_name"; if($flag == 1){ echo "<td>";} ?> <table width="100%" border="0"><tr> <td width="3%"><span class="headerLinkColor">»</span></td> <td align="left"> <a target="leftFrame" href="<?=ADMIN_FOLDERS_PATH?><?=$folder_name?>/?sid=<?=$sid?>" class="headerLinkColor"> <?=$cat_name?></a> </td> </tr></table> <?PHP if( $flag == 4){ echo "</td>"; $flag=1; }else{ $flag++; } }// for loop ?></tr> </table> </td> <TD width=15% height="85" align="center">Your IP is<br> <span class="linkColor"><?echo getIP();?></span> </TD> </TR> <TR> <TD vAlign="top" colSpan="3" height="24"><TABLE cellSpacing="0" cellPadding="0" width=100% border="0"> <TBODY> <TR> <TD width="467" height="24" background="images/hdr12.gif"> <TABLE height="24" cellSpacing="0" cellPadding="0" width="187" border="0"> <TBODY> <TR> <TD width="187" background="images/hdr11.gif"> <B>Logged in as: <span class="linkColor"><?php echo $contents['user_id']?></span></B></TD> </TR> </TBODY> </TABLE></TD> <TD width=69 valign="top" ><IMG height="24" src="images/hdr13.gif" width="54"></TD> <TD width="297" valign="top" > </TD> <TD vAlign="top" align="center" width="176"><span class="linkColor"> <strong>You are Admin. </strong></span></TD> </TR> </TBODY> </TABLE></TD> </TR> </TBODY> </TABLE></TD> </TR> </TBODY> </TABLE> </body> </html> EDIT: If your going to post code, please use tags.
-
what should the variable am to add look like? Note this was working perfectly until ma host upgraded to another php version
-
Here is the code <td width="3%"><span class="headerLinkColor">»</span></td> <td align="left"> <a target="leftFrame" href="<?=ADMIN_FOLDERS_PATH?><?=$folder_name?>/?sid=<?=$sid?>" class="headerLinkColor"> <?=$cat_name?></a> </td> </tr></table> <?PHP if( $flag == 4){ echo "</td>"; $flag=1; }else{ $flag++; } }// for loop ?></tr> </table> </td> And am getting links like this http://admin/credit_mgmt/?sid=532bb180e67ea7234d73502205321bfe i need the link to be site url/admin/credit_mgmt/?sid=532bb180e67ea7234d73502205321bfe any help? thanks
-
The admin folder path suppose to locate folder found in www.site.com/admin . is that language outdated? if yes what should i use instaed of that?
-
Here is the code <td width="3%"><span class="headerLinkColor">»</span></td> <td align="left"> <a target="leftFrame" href="<?=ADMIN_FOLDERS_PATH?><?=$folder_name?>/?sid=<?=$sid?>" class="headerLinkColor"> <?=$cat_name?></a> </td> </tr></table> <?PHP if( $flag == 4){ echo "</td>"; $flag=1; }else{ $flag++; } }// for loop ?></tr> </table> </td> And am getting links like this http://admin/credit_mgmt/?sid=532bb180e67ea7234d73502205321bfe i need the link to be site url/admin/credit_mgmt/?sid=532bb180e67ea7234d73502205321bfe any help? thanks
-
error on my code,please help me find the fault.thanks
jossylala replied to jossylala's topic in PHP Coding Help
thanks mate i have fixed it. the problem was that the config.inc.php file has the $HTTP_SERVER_VARS code in it. -
error on my code,please help me find the fault.thanks
jossylala replied to jossylala's topic in PHP Coding Help
i did change it and i got this error: Warning: include(/includes/ dbuserpass.php) [ function.include]: failed to open stream: No such file or directory in /home2/ infotec7/public_html/ noticeone/includes/ config.inc.php on line 32 Warning: include() [function.include]: Failed opening '/includes/ dbuserpass.php' for inclusion (include_path='.:/usr/lib64/ php') in /home2/infotec7/ public_html/noticeone/ includes/config.inc.phpon line 32 Warning: include(/includes/ common.inc.php) [ function.include]: failed to open stream: No such file or directory in /home2/ infotec7/public_html/ noticeone/includes/ config.inc.php on line 33 Warning: include() [function.include]: Failed opening '/includes/ common.inc.php' for inclusion (include_path='.:/ usr/lib64/php') in /home2/ infotec7/public_html/ noticeone/includes/ config.inc.php on line 33 Warning: include(/includes/ db.php) [function.include]: failed to open stream: No such file or directory in / home2/infotec7/ public_html/noticeone/ includes/config.inc.phpon line 34 Warning: include() [function.include]: Failed opening '/includes/db.php' for inclusion (include_path='.:/usr/lib64/ php') in /home2/infotec7/ public_html/noticeone/ includes/config.inc.phpon line 34 Warning: include(/includes/ commonfunction.php) [ function.include]: failed to open stream: No such file or directory in /home2/ infotec7/public_html/ noticeone/includes/ config.inc.php on line 35 Warning: include() [function.include]: Failed opening '/includes/ commonfunction.php' for inclusion (include_path='.:/ usr/lib64/php') in /home2/ infotec7/public_html/ noticeone/includes/ config.inc.php on line 35 Fatal error: Call to undefined function dbConnection() in /home2/ infotec7/public_html/ noticeone/includes/ config.inc.php on line 37 -
this the error i get:Warning: include(/includes/ config.inc.php) [ function.include]: failed to open stream: No such file or directory in /home2/ infotec7/public_html/ noticeone/index.php on line 1 Warning: include() [function.include]: Failed opening '/includes/ config.inc.php' for inclusion (include_path='.:/usr/lib64/ php') in /home2/infotec7/ public_html/noticeone/ index.php on line 1 Fatal error: Call to undefined function selectFrom() in /home2/ infotec7/public_html/ noticeone/index.php on line 3 here is my index.Php file please tell me what i did wrong. thanks <? include ($HTTP_SERVER_VARS ["DOCUMENT_ROOT"] ."/includes/ config.inc.php"); $page_data = selectFrom("SELECT description FROM ".TBL_CONTENT." WHERE id = 10"); ?>
-
Please Check My Code And Tell Me What I Did Wrong.
jossylala replied to jossylala's topic in Third Party Scripts
yes, the frihost.com is just a smple of how the actual url looks like. secondly, i have tried puting port but to no avail. anyother help? -
got a api from an sms provider that looks like this CODE http://www.frihost.com/api/send_sms.php?user=xxxxpassword=xxxx&to=1234&from=xxxx&content=hello&content_type=text am writing a php file for my sms site to send message so that the output would give something like the one above. Here is a look at my code: CODE <?php session_start(); include($HTTP_SERVER_VARS["DOCUMENT_ROOT"] ."/includes/config.inc.php"); if(isset($_SESSION['user_id'])){ $user_id = $_SESSION['user_id']; } else {redirect("login.php"); exit();} $to = $_POST['to']; $msg = $_POST['msg']; $num_rows = CountRecords("SELECT * FROM ".TBL_CREDITS." WHERE user_id = $user_id"); if($num_rows >0){ $result = selectFrom("SELECT * FROM ".TBL_CREDITS." WHERE user_id = $user_id"); if($result['credit'] < 1) { redirect("home.php?p=single&error=true"); } else { $username = 'private'; $password = 'private'; $to = $to; $content = $msg; $from = $from; $url = 'http://www.frihost.com/api/send_sms.php'; /* * We recommend that you use port 5567 instead of port 80, but your * firewall will probably block access to this port (see FAQ for more * details): * $port = 5567; */ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_PORT, $port); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $post_body = ''; $post_fields = array( username => $username, password => $password, message => $content, to => $to from => $from ); foreach($post_fields as $key=>$value) { $post_body .= urlencode($key).'='.urlencode($value).'&'; } $post_body = rtrim($post_body,'&'); curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_body); $response_string = curl_exec($ch); $curl_info = curl_getinfo($ch); if ($response_string == FALSE) { redirect("home.php?p=single&sent=fail"); } elseif ($curl_info['http_code'] != 200) { redirect("home.php?p=single&sent=fail"); } else { // redirect("home.php?p=single&sent=fail&a=Z"); $result = explode('|', $response_string); //print_r($result); if (count($result) != 3) { redirect("home.php?p=single&sent=fail&a=A"); } else { if ($result[0] == '0') { $amt1 = (int) $result['credit']; $amt3 = $amt1 - 1; update("UPDATE ".TBL_CREDITS." SET credit = ".$amt3); redirect("home.php?p=single&sent=true"); } else { if($result[0] == '24') redirect("home.php?p=single&sent=24&phone=".$to); else redirect("home.php?p=single&sent=fail&a=B"); } } } /* foreach($post_fields as $key=>$value) { $post_body .= urlencode($key).'='.urlencode($value).'&'; } $post_body = rtrim($post_body,'&'); curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_body); $response_string = curl_exec($ch); $curl_info = curl_getinfo($ch); if ($response_string == FALSE) { print "cURL error: ".curl_error($ch)."\n"; } elseif ($curl_info['http_code'] != 200) { print "Error: non-200 HTTP status code: ".$curl_info['http_code']."\n"; } else { print "Response from server:$response_string\n"; $result = split('\|', $response_string); if (count($result) != 3) { print "Error: could not parse valid return data from server.\n".count($result); } else { if ($result[0] == '0') { print "Message sent - batch ID $result[2]\n"; } else { print $result[0].'************'; print "<br>Error sending: status code [$result[0]] description [$result[1]]\n"; } } } */ curl_close($ch); } } else { redirect("home.php?p=single&error=true"); } ?> if i try sending sms through it i get something like, message not sent. what did i do wrong? please help