Jump to content

Jurik

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Jurik's Achievements

Member

Member (2/5)

0

Reputation

  1. Never mind I have it working now, just needed to make name in code to Name, DOH! Thanks
  2. hhhmmm I tried this as well and it just does not print the number. Its just blank after "Your job number is" any ideas?
  3. Hi guys, this is proberly a simple soluition and I should know it by now, but I just cant think today and its getting ridiculas now, what im wanting to do is get the ID of the data I have just recently entered so that the user can get a job number from it. My code is below for you to look at im wanting the ID number to appear where I have typed "Your job number is **" any ideas? [code] <?php if (isset($_POST['submit'])) { $Name = $_POST['Name']; $Date = $_POST['Date']; $Department = $_POST['Department']; $Room = $_POST['Room']; $ProbCat  = $_POST['ProbCat']; $ProbDes = $_POST['ProbDes']; $submit = $_POST['submit']; } else { $Name = ""; $Date = ""; $Department = ""; $Room = ""; $ProbCat  = ""; $ProbDes = ""; $submit = ""; } $success = 0; if ($submit == "Save" && $Name != NULL && $Date != NULL && $Department != NULL && $Room != NULL && $ProbCat != NULL && $ProbDes != NULL) { $sql = "INSERT INTO help_msg (Name,Date,Department,Room,ProbCat,ProbDes) VALUES ('" . $Name . "', '" . $Date . "', '" . $Department . "' ,'" . $Room . "' ,'" . $ProbCat . "' ,'" . $ProbDes . "')"; include "conn.inc.php"; $result = mysql_query($sql); if(mysql_affected_rows() == 1) { print("New record has been added sucessfuly. Your job number is **"); $success = 1; } else { print("I'm afraid an error has been detected, please check the information entered again. If the problem persists then contact IT support"); } } if($success != 1) { ?> [/code]
  4. ok I have tried both methods and for the first one it prints out '; ?> while the second example just displays blank, any ideas?  Heres what ive done <?php $pictures=glob('PrizeGiving/thumbnails/*.jpg'); echo $pictures[rand(0,count($pictures)-1)]; ?>
  5. Hi guys. I have a folder with a load of images in, all of which are named diffrently. They are all .jpg however so that makes things a little bit easier I was just wondering how I would go about setting up a peice of php code that will pick one of these images and display it. Basicaly a random image generator I have googled it but all the tutorials seem to only work if you name the images 1.jpg 2.jpg etc any help would be great.
  6. [quote author=sanfly link=topic=118586.msg484696#msg484696 date=1166089400] Most likely the value of $rows is not an array try using [url=http://au3.php.net/manual/en/function.print-r.php]print_r()[/url] to print out the array, it might give you an idea whats going on eg: print_r($rows); [/quote] Ok ive tried printing the array but nothing is displayed, i've also looked for the var but cannt find it all I can find is the following in the script [code] // SOMES VARIABLES $option = mosGetParam( $_REQUEST, 'option', 'com_events'); $task = mosGetParam( $_REQUEST, 'task', _CAL_CONF_STARTVIEW); $mode = mosGetParam( $_REQUEST, 'mode', 'com_events'); $limit = intval( mosGetParam( $_REQUEST, 'limit', '' ) ); $limitstart = intval( mosGetParam( $_REQUEST, 'limitstart', 0 ) ); $offset = intval( mosGetParam( $_REQUEST, 'offset', 0 ) ); $catid = intval( mosGetParam( $_REQUEST, 'catid', 0 ) ); $agid = intval( mosGetParam( $_REQUEST, 'agid', 0 ) ); $keyword = mosGetParam( $_REQUEST, 'keyword', '' ); $pop = mosGetParam( $_REQUEST, 'pop', 0 ); [/code]
  7. Hi I was wondering if anyone could help me with this error I am getting with this script, when I run the script in both explorer and firefox I am getting the following messages [quote] Warning: usort(): The argument should be an array in /home/e-smith/files/ibays/Primary/html/mambo/components/com_events/events.php on line 1349 Warning: Variable passed to each() is not an array or object in /home/e-smith/files/ibays/Primary/html/mambo/components/com_events/events.php on line 1350 [/quote] Now below is what is on both of these lines as well as the whole function it is in, the errors are comming from the usort and while lines but to me it seems fine. Can anyone see the problem? [code] function showCalendar ($rows,$year,$month,$day){     global $mosConfig_offset,$database,$option,$Itemid;         $cellcount = count($rows);        usort($rows, "sortEvents");     while(list($key,$value)=each($rows)) {                                $id_Array[] = $value->id;                                          $title_Array[] = $value->title;                 $color_Array[] = $value->color_bar;                 $publish_up_Array[] = $value->publish_up;                 $publish_down_Array[] = $value->publish_down;                  $reccurtype_Array[] = $value->reccurtype;                 $reccurday_Array[] = $value->reccurday;                  $reccurweekdays_Array[] = $value->reccurweekdays;              } [/code]
  8. [quote author=ProjectFear link=topic=118168.msg482584#msg482584 date=1165838603] well you how much other images are there. i am guessing you are changing img_header.jpg? well just have a couple of those with a number on the end. then use the rand. [code=php:0] <img src="<?php echo $mosConfig_live_site; ?>/templates/waterandstone_green/images/img_header<?php echo rand(1, 4); ?>.jpg" alt="header image" />[/code] remember to change the 4 to however many images there are. [/quote] Thats works a treat, thanks alot
  9. Hi guys,         I've been asked to add a radom image generator to a site that is using Mambo to create it's web-site in. At the moment the image that is needed to become a random image is using the following code [code] <img src="<?php echo $mosConfig_live_site; ?>/templates/waterandstone_green/images/img_header.jpg" alt="header image" /> [/code] Now I have tried to add some scripts I have found on the net to make this image randomly selected but I just cant seem to get it to work, can anyone help me out?
  10. [quote author=thorpe link=topic=113224.msg459968#msg459968 date=1162219148] You dont' need to escape forward slashes. [code=php:0] $target_path = "/benin/videolibrary/"; [/code] Also... you [i]may[/i] need to remove the trailing slash. [/quote] well ive tried /benin/videolibrary/ as well as /benin/videolibrary and no success, would it bing worthwhile to meantioning that the benin drive is over a network, they are not in the same case together.
  11. [quote author=thorpe link=topic=113224.msg459960#msg459960 date=1162218465] For starters its Lin[b]u[/b]x not Linex, and it uses / as a directory delimeter. [/quote] ok well i've changed the $target_path = "\\\benin\\videolibrary\\"; to $target_path = "///benin//videolibrary//"; and still no joy, im sorry I havent used Linux before so I have no idea how to map an address from it
  12. Hi guys i've just moved my finished project for work over to the server on which it is going to be run off only to find that its a linex box and that the place im saving the files to with the code is a windows box so the path I am using is on longer working. Can anyone tell me how I can set this $target_path = "\\\benin\\videolibrary\\"; so that it moves from the linex server and onto the address given above which is a windows server.
  13. [quote author=thorpe link=topic=113207.msg459922#msg459922 date=1162211648] I would think this... [code=php:0] unlink("\\\benin\\Videolibrary\\" . $Videofile); [/code] would need to be..... [code=php:0] unlink("\\\benin\\Videolibrary\\" . $row['Videofile']); [/code] [/quote] That seemed ta do the job, thanks
  14. [quote author=Destruction link=topic=113207.msg459917#msg459917 date=1162210187] As far as I'm aware print_r() is for arrays, I think using print $tralala will appear as an empty array because it's not actually reading the array. In the code given, you haven't actually defined the $videoFile at all.  You've fetched the array into $tralala and not done anything following that such as: [code] <?php $videoFile = $tralala['videoFile']; ?> [/code] HTH Dest [/quote] Have tried that and am still getting blank reports, this is strange
  15. [quote author=kenrbnsn link=topic=113207.msg459907#msg459907 date=1162209113] How is this script being invoked? Is $_GET['vivID'] set when entering? Put this code at the start of your script: [code]<?php echo '<pre>' . print_r($_GET,true) . '</pre>'; ?>[/code] Ken [/quote] Well this is what its printing out Array (     [ID] => 75 ) Running query ... SELECT * FROM videos WHERE ID = 75 Found 1 record(s) Resource id #4Array
×
×
  • 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.