Welcome! Log In Create A New Profile

Advanced

Testing your assignment

Posted by Mac 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar
Mac
Testing your assignment
February 28, 2012 02:52PM
I note that some of you have posted links to your sites for testing. Although I have not picked up any active links to the code text files, I need to stop this, because at some stage it will be up and then there is an option for plagiarism. Sorry!
Re: Testing your assignment
March 01, 2012 11:56AM
Good day sir
How is Florida sir smile
Regards!

Easyphp.........#wink#
avatar
Mac
Re: Testing your assignment
March 01, 2012 12:46PM
Lucas van Source Code Wrote:
-------------------------------------------------------
> Good day sir
> How is Florida sir smile
> Regards!

Enjoying it here thanks smileys with beer
Re: Testing your assignment
March 01, 2012 02:38PM
Sir I have link "escape.txt" at below of the "escape.php" page and it open on separate window but
I'm not sure about width and height because it does not allow me to set a text file, but it does really link
to each other thus I want to know whether I'm right or wrong
avatar
Mac
Re: Testing your assignment
March 02, 2012 07:50AM
The setting of a window size is independent of the type of file opening in it.
Re: Testing your assignment
March 06, 2012 10:49AM
good day sir
i'm busy working on my implementation i'm developing a comparison system. so i do like to know how can i retrive price from two or more tables and compare it there after
thanks

Easyphp.........#wink#
avatar
Mac
Re: Testing your assignment
March 07, 2012 07:44AM
Lucas van Source Code Wrote:
-------------------------------------------------------
> good day sir
> i'm busy working on my implementation i'm
> developing a comparison system. so i do like to
> know how can i retrive price from two or more
> tables and compare it there after
> thanks

Show what you have tried...!
Re: Testing your assignment
March 08, 2012 09:00PM
Hi Mac

Please assist with debugging the code. I need it to count number of times it generates a random number;

<?php

rand;

echo (rand(1,100))."<br><br>";
$counter += 1;
#$counter = $counter + 1;

echo "Total running is ".$counter;



?>

Regards
avatar
Mac
Re: Testing your assignment
March 09, 2012 06:44AM
I refuse to read posts that are not posted here in formatted code...
Re: Testing your assignment
March 09, 2012 12:20PM
Language: PHP
rand; <? php echo (rand(1,100))."<br><br>"; $counter += 1; #$counter = $counter + 1;   echo "Total running is ".$counter;   ?>

Can please help debugg the code to count number of times it generates a random number;
avatar
Mac
Re: Testing your assignment
March 09, 2012 02:29PM
OK, I am reading it now smiling smiley

I'll say this - why do you want to count the number of times it generates random number? A running total means if it was 4, and one refreshes the page, and it is now 3, then the total is seven. Refresh the page and it is 99, then the "running total" is 106. Nothing to do with count.
Re: Testing your assignment
March 13, 2012 09:20PM
@ 40541797, Try using a session. i believe you know about sessions.
Re: Testing your assignment
April 18, 2012 03:59PM
Sir, I am working on a project where the user is provided
with a form to enter his name last name age and address
like we did on validation. Only here I want to save the data enter on the
form to a text file so that I can retrieve it later, but for some reason
it doesn't want to write to the file and the get method returns an empty
string. Is there any special method that I must use to write form
data to a file?

Any kind of help will be kindly appreciated. Thanks
avatar
Mac
Re: Testing your assignment
April 18, 2012 05:09PM
That is covered in the H&L tutorial. Should it not, you need to consider the permissions the server allows for writing to a file. It is a bit of a minefield.
Re: Testing your assignment
April 18, 2012 05:30PM
Which tutorial is the H&L tutorial, where do I find it Sir?
With regards to the permissions, I have been writing and
reading to files without any problems. The problem only
started when I tried writing and reading from forms.
avatar
Mac
Re: Testing your assignment
April 19, 2012 06:38AM
The H&L tut is on your CD (home and learn).

A simple Google search will return plenty examples? http://www.utexas.edu/learn/php/example5.shtml
Re: Testing your assignment
April 19, 2012 12:42PM
Thank you Sir.

Which folder contains the database and tables we should
Upload? I must say, I really enjoyed the portfolio smiling smiley - I don't like this book though. Sir is there any other book I can get that covers more explanations and doesn't have so many typo's?
avatar
Mac
Re: Testing your assignment
April 19, 2012 12:44PM
There is no folder you must create it yourself. This book is cheapest and covers most issues.
Re: Testing your assignment
April 19, 2012 02:11PM
After creating the folder, must I then copy all the files inside 'phpmyadmin' or which files must I copy to it?

With regards to writing form data to files; I've tried almost everything its just not working -- the most stressful part is that, I'm not getting any errors *stressed*
avatar
Mac
Re: Testing your assignment
April 19, 2012 02:41PM
What folder? You use phpmyadmin to create the database and tables.

Why do you want to write to a file? Write to the db.
Re: Testing your assignment
April 19, 2012 02:52PM
I'm asking for upload purposes, how do I upload my database after creating it
Re: Testing your assignment
April 19, 2012 02:57PM
Here is a simple form that won't work on my machine: am I missing something here?

Language: PHP
<?php   #print form echo "Enter name <input name='fname' type='text'> <br>"; echo "<input name='submit' type='submit' value='submit'>"; echo "</form>";   #if form is submitted if (isset($_POST['submit']) == TRUE) {   $filename = "info.txt"; $fname = "Your name is: " . $_POST['fname'];   if (is_writable($filename)) { #check permissions $handle = fopen($filename, "w"); #open file for writing if (fwrite($handle, $fname) == FALSE) { #check if file was not written echo "didn't write to file"; }else { echo "file written successfully"; } fclose($handle); #close file }else { echo "file is not writable"; } } ?>
avatar
Mac
Re: Testing your assignment
April 19, 2012 06:03PM
You are confusing me since it appears you are going in directions which are not required (but appreciated).

In PHP coding there is never a simple solution. Yet it appears you did not bother to read the link I posted. For example, in that code you will see

Language: PHP
$out = fopen("output.txt", "a");

i.e. you need to create a file before you can open it.

OK, maybe you have uploaded the file already, i.e. it already exists. In that case, if the file is not readable , you should get the result, e.g. "file is not writeable"

Point is, there is no simple solution because there are too many unknown variables (reasons) involved. I cannot replicate your problem. Google, suffer, learn. Harsh, I know, but once you have solved it, you will float.

More so, I cannot guess what you have done or not done (e.g. have you created the file?). I know it is not easy. Not for you, but also not for me. I have no crystal ball handy. Stay positive.
Re: Testing your assignment
April 19, 2012 09:15PM
Thank you very much for your words of encouragement Sir. Sorry about the link, I never noticed it. I will however look at it just now...then I'll get back to you...hope I'm gonna find the solution eventually.
Re: Testing your assignment
April 20, 2012 01:32PM
Sir I have looked through my previous scripts closely and I read the link u gave me, it really helped I have found a working solution. Thank u
avatar
Mac
Re: Testing your assignment
April 20, 2012 01:36PM
There you go smiling smiley
Re: Testing your assignment
April 23, 2012 04:18PM
Sir, there's a problem with my MySQL connection, I uploaded my database but now it doesn't want to connect -- what parameters must I pass to the mysql_connect() function? I passed ("localhost", "root", ""winking smiley and its not working...
avatar
Mac
Re: Testing your assignment
April 24, 2012 06:48AM
Well, you must use the connection details the hosting service provided you when you created the db. You did this last year with ICT2613.
Re: Testing your assignment
April 24, 2012 06:58AM
No Sir, I passed Java in 2010. Thank u, I'll try using that.
avatar
Mac
Re: Testing your assignment
April 24, 2012 09:29AM
Oh.
Re: Testing your assignment
April 24, 2012 04:51PM
Sir, I've been done with the OOP questions for a while now, I might have used my own methods, but everything is working exactly as it should...does this mean less/more marks on my portfolio or is it ok? (Remember you replied, "figure it out; fix it", in most cases).

Kind regards.
avatar
Mac
Re: Testing your assignment
April 25, 2012 06:45AM
Well, as long as you are extracting the data from the database you can use any method... although with OOP the method is fairly set. So you cannot use if/else statements and hard code the result in.
Re: Testing your assignment
May 10, 2012 03:07PM
I forgot to reply "Thank u" on this post, my apologies sir..

Sir why don't UNISA introduce a video learning method? I mean, they've the resources and to be quite honest, those videos are very helpful i.e the examples are quite clearer when u watch someone doing them. #Just a thought though

Kind regards
avatar
Mac
Re: Testing your assignment
May 11, 2012 07:03AM
Like the last time when only 20 students turned up over two days? We are expected to start making use of podcasts in 2 years, then students do not download it. There is more than enough resources on the Internet to support students with PHP, and the module is not a feeding scheme..... what purpose would that have?
Re: Testing your assignment
May 11, 2012 06:11PM
I was just saying, in general - not just for PHP (as an additional resource for each module).
Sir, I am not complaining it was just an idea I had in mind; I thought I might share it with u.
avatar
Mac
Re: Testing your assignment
May 13, 2012 04:30PM
You are welcome to express your opinions smiling smiley I appreciate it. We look at all these issues.-
Re: Testing your assignment
May 14, 2012 09:53AM
Dear Sir

About the server.php page I have just displayed the server variables on the page and their description is that okay?
avatar
Mac
Re: Testing your assignment
May 14, 2012 12:03PM
This question has been asked elsewhere.
Re: Testing your assignment
May 14, 2012 12:21PM
There is a lot of posts in this forum section. I cannot find it
Re: Testing your assignment
May 14, 2012 01:22PM
@Thato - check out 'Displaying server variables' on this forum. GoodLuck
avatar
Mac
Re: Testing your assignment
May 14, 2012 02:24PM
Or try the search function - you are 3rd year eye popping smiley
Re: Testing your assignment
May 15, 2012 03:58PM
Sir, what happens now after I pass this module (hoping for a 100% smiling smiley), how do I keep in touch with u...will I still be able to login on this forum?
avatar
Mac
Re: Testing your assignment
May 16, 2012 06:40AM
I have other work to do....smileys with beer
Re: Testing your assignment
May 16, 2012 07:45AM
Hi Ntsiki the best is to start coding your own projects that way you will be able to master PHP even more....
Re: Testing your assignment
May 16, 2012 07:55AM
Oracle University has also introduced an international certificate for PHP/MYSQL Web Application Development
Re: Testing your assignment
May 17, 2012 06:57PM
Implement your ICT3714 project using PHP? Thats what Im going to do smiling smiley

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Re: Testing your assignment
May 18, 2012 01:10AM
@Thato -i already have a running site (PhP), tel us more about the Oracle PhP App.
@Bokkie - haha I already said I was gonna use VB...lol can I change it?smileys with beer

@Sir - but sir are u still gonna be here (on this forum)? and Sir, I have a problem, and I urgently need to fix this: when I log in on my site it shows adsense ads (my content doesn't want to show) - I tried searching for solutions but most of them state that I need to cancel my account with Google Adsense - problem is, I don't even have an account with them. I don't know how their ads got to my website.. HELP!!!
avatar
Mac
Re: Testing your assignment
May 18, 2012 06:44AM
That is what you get on free hosting services. Where your content is I would not know. Search that site for solutions.
Re: Testing your assignment
May 18, 2012 08:24AM
@Ntsiki
Only if you can really justify your reasons for doing so.
But switching between VB and PHP? Depends on if your system is for desktop or for the internet?
Soooo.... smiling smiley what is your system all about? smiling smiley

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Re: Testing your assignment
May 18, 2012 08:25AM
@Everybody.... talking of free hosting services... remember to keep your portfolio live until you have your results.

Im going to try to make a habit of logging into my site every Monday morning first thing....

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Sorry, you do not have permission to post/reply in this forum.