Jump to content
  • Who's Online   0 Members, 1 Anonymous, 442 Guests (See full list)

    • There are no registered users currently online

All Activity

This stream auto-updates

  1. Yesterday
  2. For certain needs I want to use it; for others not. Instead of uninstalling and reinstalling it, I wanted to know if there is a way to turn it off, or rather, among those I proposed, which is the most correct one (or if both are equivalent). Nothing more, nothing lessexit!!!
  3. If you don't want to use the extension then don't install it 😕
  4. And to avoid loading the extension? There are those who suggest giving the command $ phpdismod xdebug There are those who suggest (for those like me who have Ubuntu 22.04.4) to open the file /etc/php/8.1/cli/conf.d/20-xdebug.ini and comment the line ;zend_extension=xdebug.so inserting ';' at the beginning And there are those who suggest other oddities, that I don't want to implement so as not to cause damage. Everyone has their say, but what is the correct, safe and official method?
  5. Last week
  6. What you're seeing is the default landing page for Laravel. If you're surfing to http://localhost:8000/ it's matching the '/' route in the web.php file, so it'll render the welcome.blade.php file. If you want to see your questions/* routes you need to request them - go to http://localhost:8000/questions.
  7. Check the content of your arrays. It looks like $allowed_forums contains a blank entry.
  8. The error is coming from line 347. The line containing $f = $forums['f'][$forum_id];. The message showed up when I upgraded to PHP 8.3.7 from 8.3.6. before then, there were no errors. so I'm guessing it's a deprecation error. I will try downgrading to 8.3.6. the error message reads vaguely; Undefined array key "" I changed the single quotations to double quotations and still it remains.
  9. Oops! Sorry, I won't make that mistake again! OK, I understand your hint. I've seen similar examples and just didn't understand until now. Thanks for your help (and for correcting me about uploading code). Dave
  10. On this site, we do not normally open attachments. In order to post code, use the <> button located in the toolbar. As for your issue, the PHP script will be read by the server when loading the webpage. It is currently doing what you have directed it to do (and has proven that it functions adequately). If you want to change your instructions to not run unless the submit button is clicked, then you have created a new CONDITION that needs to be added to the code. There are several ways to handle this: //let's say this is your button <input type="submit" name="my_submit" value="runPHP"> //Assuming the button is inside a <form method="POST"> tag, you now have several alternatives or combinations to use as conditions <?php if(isset($_POST['my_submit'])){ //code to run if the CONDITION is met hours here } else { //what to do if condition is NOT met echo "Sorry, the button was not clicked"; } //end the condition //OR do this if you want to meet a greater condition if(isset($_POST['my_submit']) && $_POST['my_submit'] == "runPHP"){ //code to run if ALL the CONDITIONs are met } else { //what to do if conditionS are NOT met echo "Sorry, the button was not clicked"; } //end the conditions statement ?> Hope this helps. You can research ISSET and see other examples online.
  11. BTW, I changed the name from test.php just so I could upload it.
  12. Hi, I'm struggling to get a simple example to work (with really no experience in php and just enough to make things work in html). My problem is this simple web page runs the php script when the page is loaded, writing to a file. I don't want the script to run until the submit button is pressed. What am I doing wrong? Thanks, Dave test.php.txt
  13. Hi, I am a newbie to Laravel and trying to familiarize myself with it, so I am starting with a CBT project and when I navigate to http://127.0.0.1:8000/, it keeps taking me to laravel news page which differ from my project page. Here is my web.php <?php use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Route; use Inertia\Inertia; use App\Http\Controllers\QuestionController; Route::get('questions', [QuestionController::class, 'index'])->name('questions.index'); Route::get('questions/create', [QuestionController::class, 'create'])->name('questions.create'); Route::post('questions', [QuestionController::class, 'store'])->name('questions.store'); Route::get('/', function () { return Inertia::render('Welcome', [ 'canLogin' => Route::has('login'), 'canRegister' => Route::has('register'), 'laravelVersion' => Application::VERSION, 'phpVersion' => PHP_VERSION, ]); }); Route::middleware([ 'auth:sanctum', config('jetstream.auth_session'), 'verified', ])->group(function () { Route::get('/dashboard', function () { return Inertia::render('Dashboard'); })->name('dashboard'); }); And here is the page I keeps loading to Please advise and if I could get a comprehensive tutorial that will guide me to pass the hurdles. I find it a bit difficult but with its authentication built in, it is okay.
  14. The extension still gets loaded and functions will still exist. Changing the xdebug.mode merely tells Xdebug not to do anything. https://xdebug.org/docs/all_settings#mode
  15. There are about a dozen array keys in that picture. If you want help... Be specific. Post textual code in a code block (<> button) and not a useless picture.
  16. $ apt show php-xdebug | head -n 2 Package: php-xdebug Version: 3.1.2+2.9.8+2.8.1+2.5.5-4 OK, xdebug is installed. But $ php -d xdebug.mode=off -r "xdebug_var_dump(123);" int(123) Strange that it works (to notice xdebug.mode=off). I was expecting something like this Call to undefined function xdebug_var_dump()
  17. Hi All, I am building a system where users can apply to attend events. When they do so they use a portal to make their application which is then submitted to the back end to be administered. I really need some help designing this from a functionality point of view and from a "how it looks" point of view. I am using bootstrap. The idea is that the back end user can create a custom workflow allowing for as many approval stages as they require. A very basic example would be Stage Comments Draft User savded without passing validation Submitted User passed validation and has done all that they needed to do Accepted/Approvded The back end user has OK'd the submission Rejected/Declined The back end user has said no to the application All of these stages will eventually trigger actions such as sending emails. The complexity that i have is that i want the back end user to be able to add their own stages. An example of this could be a 2 stage approval process. There could be another stage after approval such as security check, where someone else has a look at the data and approves it. i am struggling to build the interface where the journey is defined - the stages that will be used are defined elsewhere. There is a lot that i am not sure about and no doubt more and more will come up as we work throught it. I will provide any code that is wanted here to help or even allow you to log into the application if i have worked with you before and you think that will help - of course i dont expect you to do that, this is not your job, but if it helps and youre interested. This may not be enough information but should give you an idea of what i am trying to achieve. I will be more than happy to provide more context where required. Thanks As Always
  18. Hardly a priority...but. Although i love the ability to put tables into posts. They are VERY difficult to work with. Making changes or even adding additional rows is sometimes impossible, i have to delete the whole table and start again (also sometimes impossible). I dont know if there is anything that can be changed with the plug in but i thought i would let you know. Thanks as ever!
  19. I've sent the data to your mail sir @barand
  20. By now you should have learned to place code inside a code block! I'm happy try and help. Any data tables I already have from you are several years out of date and does not include the following tables used in your code: subject_position dummy arms_level promotion I would, therefore, require an up-to-date DB dump. (I'll PM you with my email address). Also - what MySQL version are you using?
  21. @Barand @All help me out This is my code $sql_mee ="SELECT yearid , semesterid , regno , subjectid , rank , total , grade , comment FROM ( SELECT yearid , semesterid , subjectid , @seq := CASE WHEN yss <> @prev THEN 1 ELSE @seq + 1 END as seq , @rank := CASE WHEN total = @prevtot THEN @rank ELSE @seq END as rank , @prevtot := total as total , @prev := yss as yss , regno , armsLevelId -- added FROM ( SELECT yearid , semesterid , subjectid , concat(yearid, armsLevelId, semesterid, subjectid) as yss , regno , total , armsLevelId -- added FROM subject_position ORDER BY yearid, armsLevelId, semesterid, subjectid, total DESC ) sorted JOIN (SELECT @prev := '', @seq := 0, @rank := 0, @prevtot := 0) as init ) ranked JOIN grade ON total BETWEEN grade.lomark AND grade.himark WHERE regNo='$_GET[name]' -- A and armsLevelId='$levelid' -- D and semesterid='$sem' -- E and yearid='$odun' -- D ORDER BY subjectid"; $query_mee = mysqli_query($con, $sql_mee); $data_sub_pos = array(); while($row_mee = mysqli_fetch_array($query_mee)){ $yearid_me = $row_mee["yearid"]; $semesterid_me = $row_mee["semesterid"]; $regNo_me = $row_mee["regNo"]; $subjectid_me = $row_mee["subjectid"]; $rank_me = $row_mee["rank"]; $total_me = $row_mee["total"]; $grade_me = $row_mee["grade"]; $data_sub_pos[] = $rank_me; } /*End of Subject Position Ranking*/ $sql = "select * from dummy where regid='$regno' and armsLevelId='$levelid' and yearid='$odun' and semesterid='$sem' group by subjectid"; $result = mysqli_query($con,$sql); while ($row_query=mysqli_fetch_array($result)){ $RegNo=$row_query["regid"]; $subject_id=$row_query["subjectid"]; $level_id=$row_query["armsLevelId"]; $semester=$row_query["semesterid"]; $session=$row_query["yearid"]; $fca=$row_query["firstCA"]; $sca=$row_query["secondCA"]; $exam=$row_query["exam"]; $total =$row_query["total"]; $grade =$row_query["grade"]; $comment =$row_query["comment"]; //subject $query_sub=mysqli_query($con,"select * from subject where id='".$subject_id."'"); while ($row_sub=mysqli_fetch_array($query_sub)){ $r_sub = $row_sub["subject_name"]; } //level $query_level=mysqli_query($con,"select * from armslevel where id='".$level_id."'"); while ($row_level=mysqli_fetch_array($query_level)){ $r_level = $row_level["Armslevel"]; } //semester $query_semester=mysqli_query($con,"select * from semester where id='".$semester."'"); while ($row_semester=mysqli_fetch_array($query_semester)){ $r_semester = $row_semester["term"]; } //session $query_year=mysqli_query($con,"select * from year where id='".$session."'"); while ($row_year=mysqli_fetch_array($query_year)){ $r_year = $row_year["session"]; } //student details $query_reg=mysqli_query($con,"select * from promotion where regNo='".$RegNo."'"); while ($row_reg=mysqli_fetch_array($query_reg)){ $reg_ID = $row_reg["id"]; $reg_title = $row_reg["title"]; $reg_Regno = $row_reg["regNo"]; $reg_firstName = $row_reg["firstname"]; $reg_middleName = $row_reg["middleName"]; $reg_lastName = $row_reg["lastName"]; $reg_gender = $row_reg["gender"]; $reg_houseID = $row_reg["houseid"]; $reg_profile_pic = $row_reg["passport"]; $reg_level_id=$row_reg["armslevelid"]; $reg_semester=$row_reg["semesterid"]; $reg_session=$row_reg["yearid"]; $reg_nationality=$row_reg["nationality"]; $reg_stateID=$row_reg["stateID"]; $reg_localgovtID=$row_reg["localgovtID"]; $reg_phone=$row_reg["phone"]; $reg_email=$row_reg["email"]; $reg_signup_date=$row_reg["signup_date"]; // $reg_status=$row_reg["status"]; //echo "select * from promotion where regNo='".$RegNo."' and armslevelid='$level_id' and arms='$arms' and yearid='$session'"; } for ($pos=0; $pos<count($data_sub_pos); $pos++) { if(!empty($data_sub_pos[$pos])){ $position = $data_sub_pos[$pos]; $position = $position; }else{ echo "Error Occured"; } } $outputdata .="<tr> <td>$sn</td> <td>$r_sub</td> <td>$fca</td> <td>$sca</td> <td>$exam</td> <td>$total</td> <td>$position</td> <td>$grade</td> <td>$comment</td> </tr>"; $sn++; } Note: the position column is populating the last data. the position column should populate 1st, 8th, 7th, 3rd the last data (3rd is populated). thanks for your help in advance.
  22. FYI Here is a simpler non-recursive solution... $cat_data = []; $res = $pdo->query("SELECT id , CONCAT(name, '::', position) as name , parent FROM category "); foreach ($res as $r) { $cat_data[$r['id']] = [ 'name' => $r['name'], 'parent' => $r['parent'] ] ; } $breadcrumbs = retrieve_category_path(552, $cat_data); echo $breadcrumbs; function retrieve_category_path($id, &$cats) { if (!isset($cats[$id])) { return "Unknown category"; } $category_path_array = []; do { array_unshift($category_path_array, $cats[$id]['name']); $id = $cats[$id]['parent']; } while ($id); return join(' / ', $category_path_array); }
  23. We want to add a new element to the $cpa array in each call to the function. To do this we need always to add to the original empty array. The ampersand allows us to to this. Without it, a copy of the array would be passed to the function and we would just keep adding to a new empty array each time. &$cpa passes the array by reference (ie its address in memory) instead of a copy. P.S. This method below (which stores all the category data into a $cat_data array instead of running a query in every call to the function, is 5x faster. $cat_data looks like this... Array ( [532] => Array ( [name] => Motorbikes::1 [parent] => 0 ) [533] => Array ( [name] => Cars::2 [parent] => 0 ) [534] => Array ( [name] => Boats::3 [parent] => 0 ) [535] => Array ( [name] => Bicycles::4 [parent] => 0 ) . . . ) CODE $cat_data = []; $res = $pdo->query("SELECT id , CONCAT(name, '::', position) as name , parent FROM category "); foreach ($res as $r) { $cat_data[$r['id']] = [ 'name' => $r['name'], 'parent' => $r['parent'] ] ; } $category_path_array = []; retrieve_category_path ($cat_data, 552, $category_path_array); $breadcrumbs = join('/', $category_path_array); echo $breadcrumbs; function retrieve_category_path (&$cats, $id, &$cpa) { array_unshift($cpa,$cats[$id]['name']); if ($cats[$id]['parent']) { retrieve_category_path($cats, $cats[$id]['parent'], $cpa); } } Thank you - much appreciated.
  1. Load more activity
×
×
  • 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.