Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Yes in fact I recently found that repeating code myself. It does need some additional em code in the CSS, but it does the job.
  3. You could have a look at https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/repeating-linear-gradient
  4. So it's impossible to make it the way I explained? IE if you had a slogan, and it had to be on two rows... you have to them make two rows of H2 tags.. and apply the gradient to each row? That's very awkward.
  5. Where is the data coming from? There could be several different reasons why you're not seeing whatever it is you're expecting. Which is a good point - what exactly are you expecting to see?
  6. Yesterday
  7. The gradient is applied across the whole element, not across each row. Put each row in it's own element
  8. .class{ -webkit-background-clip: text; color: none; background: linear-gradient(#333333 45%, #000000 73%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; } I want to apply this gradient so it is lighter at the top, ie if it was white at the top and soft grey at the bottom. The problem is, if I do this to text that is bold and goes to two lines, the top line is one shade and the bottom is the other shade. Rather than might splitting the two rows into two tags, can this be done on a 'per line' basis?
  9. So you can't do that if it's a H1 tag, since it is in a Text tag?
  10. One way... <?php $data = array ( 0 => array ( 'Q_id' => '1.1.1|||1.1.2|||1.1.3|||1.1.4|||1.1.5|||1.1.6|||1.1.7|||1.1.8|||1.1.9|||1.1.10|||1.1.11|||1.1.12|||1.1.13|||1.1.14|||1.1.15|||1.1.16|||1.1.17|||1.1.18|||1.1.19|||1.1.20|||1.1.21|||1.1.22|||1.1.23|||1.1.24|||1.1.25|||1.1.26|||1.1.27|||1.1.28|||1.1.29|||1.1.30|||1.1.31|||1.1.32|||1.1.33|||1.1.34|||1.1.35|||1.1.36|||1.1.37|||1.1.38|||1.1.39|||1.1.40|||1.1.41|||1.1.42|||1.1.43|||1.1.44|||1.1.45|||1.1.46|||1.1.47|||1.1.48|||1.1.49|||1.1.50', 'QueNo' => NULL, 'qNo' => '1|||2|||3|||4|||5|||6|||7|||8|||9|||10|||11|||12|||13|||14|||15|||16|||17|||18|||19|||20|||21|||22|||23|||24|||25|||26|||27|||28|||29|||30|||31|||32|||33|||34|||35|||36|||37|||38|||39|||40|||41|||42|||43|||44|||45|||46|||47|||48|||49|||50', 'SECTION' => 'SECTION A', ), 1 => array ( 'Q_id' => '1.1.51|||1.1.51.2|||1.1.51.3|||1.1.51.4|||1.1.51.5|||1.1.51.6|||1.1.51.7|||1.1.51.8|||1.1.51.9|||1.1.51.10', 'QueNo' => 'b|||c|||d|||e|||f|||g|||h|||i|||j', 'qNo' => '51|||51|||51|||51|||51|||51|||51|||51|||51|||51','SECTION' => 'SECTION B', ), ) ; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example</title> <style type='text/css'> table { border-collapse: collapse; width: 500px; } td { padding: 8px } </style> </head> <body> <table border='1'> <?php foreach ($data as $k => $v) { foreach ($v as $k1 => $v1) { // do something (such as output) $vals = str_replace('|||', ', ', $v1); echo "<tr><td>$k</td><td>$k1</td><td>$vals</td></tr>"; } } ?> </table> </body> </html>
  11. how can i loop through this array in php ( 'data' => array ( 0 => array ( 'Q_id' => '1.1.1|||1.1.2|||1.1.3|||1.1.4|||1.1.5|||1.1.6|||1.1.7|||1.1.8|||1.1.9|||1.1.10|||1.1.11|||1.1.12|||1.1.13|||1.1.14|||1.1.15|||1.1.16|||1.1.17|||1.1.18|||1.1.19|||1.1.20|||1.1.21|||1.1.22|||1.1.23|||1.1.24|||1.1.25|||1.1.26|||1.1.27|||1.1.28|||1.1.29|||1.1.30|||1.1.31|||1.1.32|||1.1.33|||1.1.34|||1.1.35|||1.1.36|||1.1.37|||1.1.38|||1.1.39|||1.1.40|||1.1.41|||1.1.42|||1.1.43|||1.1.44|||1.1.45|||1.1.46|||1.1.47|||1.1.48|||1.1.49|||1.1.50', 'QueNo' => NULL, 'qNo' => '1|||2|||3|||4|||5|||6|||7|||8|||9|||10|||11|||12|||13|||14|||15|||16|||17|||18|||19|||20|||21|||22|||23|||24|||25|||26|||27|||28|||29|||30|||31|||32|||33|||34|||35|||36|||37|||38|||39|||40|||41|||42|||43|||44|||45|||46|||47|||48|||49|||50', 'SECTION' => 'SECTION A', ), 1 => array ( 'Q_id' => '1.1.51|||1.1.51.2|||1.1.51.3|||1.1.51.4|||1.1.51.5|||1.1.51.6|||1.1.51.7|||1.1.51.8|||1.1.51.9|||1.1.51.10', 'QueNo' => 'b|||c|||d|||e|||f|||g|||h|||i|||j', 'qNo' => '51|||51|||51|||51|||51|||51|||51|||51|||51|||51','SECTION' => 'SECTION B', ), ), )
  12. Can you post it again, using var_export() instead of var_dump() so we have something processable?
  13. array(1) { ["data"]=> array(2) { [0]=> array(14) { ["Q_id"]=> string(438) "1.1.1|||1.1.2|||1.1.3|||1.1.4|||1.1.5|||1.1.6|||1.1.7|||1.1.8|||1.1.9|||1.1.10|||1.1.11|||1.1.12|||1.1.13|||1.1.14|||1.1.15|||1.1.16|||1.1.17|||1.1.18|||1.1.19|||1.1.20|||1.1.21|||1.1.22|||1.1.23|||1.1.24|||1.1.25|||1.1.26|||1.1.27|||1.1.28|||1.1.29|||1.1.30|||1.1.31|||1.1.32|||1.1.33|||1.1.34|||1.1.35|||1.1.36|||1.1.37|||1.1.38|||1.1.39|||1.1.40|||1.1.41|||1.1.42|||1.1.43|||1.1.44|||1.1.45|||1.1.46|||1.1.47|||1.1.48|||1.1.49|||1.1.50" ["QueNo"]=> NULL ["qNo"]=> string(238) "1|||2|||3|||4|||5|||6|||7|||8|||9|||10|||11|||12|||13|||14|||15|||16|||17|||18|||19|||20|||21|||22|||23|||24|||25|||26|||27|||28|||29|||30|||31|||32|||33|||34|||35|||36|||37|||38|||39|||40|||41|||42|||43|||44|||45|||46|||47|||48|||49|||50"["SECTION"]=> string(9) "SECTION A" } [1]=> array(14) { ["Q_id"]=> string(106) "1.1.51|||1.1.51.2|||1.1.51.3|||1.1.51.4|||1.1.51.5|||1.1.51.6|||1.1.51.7|||1.1.51.8|||1.1.51.9|||1.1.51.10" ["QueNo"]=> string(33) "b|||c|||d|||e|||f|||g|||h|||i|||j" ["qNo"]=> string(47) "51|||51|||51|||51|||51|||51|||51|||51|||51|||51"["SECTION"]=> string(9) "SECTION B" } } } how can I loop through such an array using php
  14. Thanks Admin,i had to go back and re-read php and figured out how to get the data.
  15. Hello everyone. I hope you're having a great day! I have a series of codes on my page that pic up different things when someone enters a youtube link in a form to send to the database. It works beautifully. I am now to where I need to Add to this to get a duration. The code below successfully gets the title. There is a lot more code on the page but it's not significant to this issue. What I need to do is get the duration and if it's more than 7 minutes long, then a message appears saying that the video is too long, try again. I've been searching for a couple weeks now when I get the time and all I can find is stuff to use with an api key, etc. I don't have that and I really don't want to alter a very long page (over 1000 lines) to adjust to that. So below is my code that gets the title. Is there a way to achieve the time duration limit from this as well? Thank you so very much The example below, if someone enters (aka this link is the $ytvideo1 value) https://www.youtube.com/watch?v=6ROwVrF0Ceg it will output (entered in database function is later in the page not showing below) Chuck Berry - Johnny B. Goode (Live 1958) $linkurl = "$ytvideo1"; parse_str( parse_url( $linkurl, PHP_URL_QUERY ), $vid ); preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:shorts/)?|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $linkurl, $match); $youtube_id = $match[1]; $preurl = "https://www.youtube.com/watch?v=$match[1]"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $preurl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); $document = htmlspecialchars($output); curl_close($ch); $line = explode("\n", $document); $judul = ""; foreach($line as $strline){ preg_match('/\&lt;title\&gt;(.*?)\&lt;\/title\&gt;/s', $strline, $hasil); if (!isset($hasil[0]) || $hasil[0] == "") continue; $title = str_replace(array("&lt;title&gt;", "&lt;/title&gt;"), "", $hasil[0]); }
  16. Iam very sorry Sir. Iam writing an MVC FROM SCRATCH. When iam in the paper controller class,the variables $StudylevelId,$SubjectId,$PaperId, are available with in that scope. how can I avail them to the model class Paperview class PaperView { // Public variables to be used in fsa template public $mPaper; public $mPaperId; // Private stuff private $_mStudylevelId; private $_mSubjectId; private $_mPaperId; // Class constructor public function __construct($StudylevelId,$SubjectId,$PaperId) { // Variable initialization // Get StudylevelId if ($StudylevelId<>'') $this->_mStudylevelId = (int)$StudylevelId; // Get SubjectId from query string casting it to int if ($SubjectId<>'') $this->_mSubjectId = (int)$SubjectId; if ($PaperId<>'')//$_GET['ProductId'])) $this->mPaperId = (int)$PaperId; //$_GET['ProductId']; else trigger_error('PaperId not set'); } } which is called in the view file below: Yes i have made them public in the papercontroller class,but now how do i access them here where they are required <section class="bg" > <?php require MODEL.'paper_view.php'; // Create presentation object $Papersdetail=new PaperView($StudylevelId,$SubjectId,$PaperId); ?> <!-- Quiz Box --> <div class="quiz_box"> <header> <div class="title"><?=$Papersdetail->mPaperId?><h2></header> i hope i have tried explaining better
  17. If you're going to work with PHP then I suggest you learn the fundamentals of PHP. That's going to be really important for you to be able to write code that actually works. When you have a grasp on it, spend some time learning about how your MVC framework works. About how views work, and about this $data variable it apparently sets up in the view, and about how to use view classes to pass data. I say that because I can see (1) you did not make anything public, and (2) changing $data->mPaperId to just mPaperId actually made your problem worse. What you should (as far as I can see) be doing is leaving mPaper and mPaperId alone, make your mStudylevelId and friends public (and please rename them to not have an underscore), and then using $data in the view to reference those properties. But that could be hard to understand if you don't have a basic knowledge of PHP or of the framework you need to use.
  18. // Handles paper details class PaperView { // Public variables to be used in fsa template public $mPaper; public $mPaperId; // Private stuff private $_mStudylevelId; private $_mSubjectId; private $_mPaperId; // Class constructor public function __construct($StudylevelId,$SubjectId,$PaperId) { // Variable initialization // Get StudylevelId from query string casting it to int $paginate = new Pag(35); if ($StudylevelId<>'') $this->_mStudylevelId = (int)$StudylevelId; // Get SubjectId from query string casting it to int if ($SubjectId<>'') $this->_mSubjectId = (int)$SubjectId; if ($PaperId<>'')//$_GET['ProductId'])) $this->mPaperId = (int)$PaperId; //$_GET['ProductId']; else trigger_error('PaperId not set'); } } that is the class i used to try to capture the mpaperid variable from the papercontroller class below class papersController extends Controller { //public $paper; public function index($StudylevelId='',$SubjectId='',$PaperId='',$name='') { echo 'PaperId is'. $PaperId;//check wether variables are there require MODEL.'paper_view.php'; //$Paper new PaperView($StudylevelId,$SubjectId,$PaperId); // Retrieve data from the model $this->view('papers\index',new PaperView($StudylevelId,$SubjectId,$PaperId)); $this->view->render(); } the view is here <section class="bg" > <?php //require MODEL.'paper_view.php'; /*$className = str_replace(' ', '', ucfirst(str_replace('_', ' ', substr(basename(__FILE__), 0, strrpos(basename(__FILE__), '.')))));*/ // Create presentation object //$Papersdetail=new PaperView($StudylevelId,$SubjectId,$PaperId); //$Papersdetail = new $className(); ?> <!-- Quiz Box --> <div class="quiz_box"> <header> <div class="title"><?=mPaperId?></div> </header> </div> iam not getting the variable displayed above.how can i do that
  19. Post the code you tried, both for the class and for the view.
  20. Last week
  21. I can actually see this, when i render the view page.It is there in the paperscontroller as seen with the echo statement there. it does display at the top of the view page.My issue is that i cannot access this inside the paperview class that needs to use it.
  22. Again, with svg we can add the text shadow and letter spacing <div style='background-color: black; text-align: center;'> <svg width='380' height='80' viewBox='0 0 380 80'> <defs> <style type='text/css'> .olap { font-family: "arial black"; font-size: 60pt; letter-spacing: -15px; fill: #fff; text-shadow: -0.08em 0.03em 0.12em rgba(0, 0, 0, 0.7); } </style> </defs> <text class='olap' x='190' y='70' text-anchor='middle' >OVERLAP</text> </svg> </div>
  23. You can't access $StudylevelId and such because those variables do not exist. You should use what's in $data. You can't access $data->_mStudylevelId because it's private. Either make the variables public, like mPaperId is, or find some other way to make those values available outside of the class.
  24. I have this controller: class papersController extends Controller { //public $paper; public function index($StudylevelId='',$SubjectId='',$PaperId='',$name='') { echo 'StudylevelId is'. $StudylevelId; require MODEL.'paper_view.php'; //$Paper new PaperView($StudylevelId,$SubjectId,$PaperId); // Retrieve data from the model //$data = $this->model->getData();// Pass the data to the view //$this->view->render('route_view', ['data' => $data]); $this->view('papers\index',new PaperView($StudylevelId,$SubjectId,$PaperId)); $this->view->render(); } i need to pass the three variables $StudylevelId,$SubjectId,$PaperId in index function() to the paperview model // Handles paper details class PaperView { // Public variables to be used in fsa template public $mPaper; public $mPaperId; // Private stuff private $_mStudylevelId; private $_mSubjectId; private $_mPaperId; // Class constructor public function __construct($StudylevelId,$SubjectId,$PaperId) { // Variable initialization // Get StudylevelId from query string casting it to int $paginate = new Pag(35); if ($StudylevelId<>'') $this->_mStudylevelId = (int)$StudylevelId; // Get SubjectId from query string casting it to int if ($SubjectId<>'') $this->_mSubjectId = (int)$SubjectId; if ($PaperId<>'')//$_GET['ProductId'])) $this->mPaperId = (int)$PaperId; //$_GET['ProductId']; else trigger_error('PaperId not set'); } how can i access the data from paperview model in the actual view below.the echo statement works fine but the variables cannot be accessed in the view page for further use <section class="bg" > <?php //require MODEL.'paper_view.php'; /*$className = str_replace(' ', '', ucfirst(str_replace('_', ' ', substr(basename(__FILE__), 0, strrpos(basename(__FILE__), '.')))));*/ // Create presentation object //$Papersdetail=new PaperView($StudylevelId,$SubjectId,$PaperId); //$Papersdetail = new $className(); ?> <!-- Quiz Box --> <div class="quiz"> <header> <div class="title"><?=$data->mPaperId?><h2> PAPER 1</h2></div> i can't acess $StudylevelId,$SubjectId,$PaperId in the above code. help out
  25. Try using a shadowed font (such as Google's "Rubik Doodle Shadow) and set the element's letter-spacing attribute to a negative value
  26. https://codingartistweb.com/2021/11/overlap-text-effect-with-html-and-css/ This is not an advert, I Want to know if I can create this effect, but without many many Spans down the page. So I can create a slogan, and apply this effect to it. Is that possible??
  27. OH very cool, thanks. Though tI think I managed it in the end with some CSS, of relative positioning.
  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.