Jump to content

Search the Community

Showing results for tags 'php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. I bought a slider script and need to merge it in the website. What is the best to put the script in the header or in the footer? And where i have to put it on wich line? I tried a lot and i have almost no more hair left on my head! One time i managed to get the images below header but not in a slider, it added the images below each other. It's not loading jquery or something else i don't know... this is the slider script: <?php echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>JQuery-Image-Slider</title> <link href=\"css/default.css\" rel=\"stylesheet\" type=\"text/css\" /> <script src=\"js/jquery.js\" type=\"text/javascript\"></script> <script src=\"js/yslider.js\" type=\"text/javascript\"></script> <script src=\"js/init.js\" type=\"text/javascript\"></script> </head> <body> <div id=\"content\"> <div class=\"slider\"> <div class=\"sliderContent\"> <div class=\"item\"> <img src=\"img/img1.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img2.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img3.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img4.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img5.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img6.jpg\" alt=\"\" /> </div> </div> </div> </div> </body> </html> "; ?> The header and footer script are atached footer.php header.php
  2. I have the following code below: <?php $xml = '<Divisions xmlns="urn:description7a.services.chrome.com"> <responseStatus responseCode="Successful" description="Successful"/> <division id="1">Acura</division> <division id="44">Aston Martin</division> <division id="4">Audi</division> <division id="45">Bentley</division> <division id="5">BMW</division> <division id="6">Buick</division> <division id="7">Cadillac</division> <division id="8">Chevrolet</division> <division id="9">Chrysler</division> <division id="11">Dodge</division> <division id="46">Ferrari</division> <division id="59">FIAT</division> <division id="13">Ford</division> <division id="170">Freightliner</division> <division id="15">GMC</division> <division id="16">Honda</division> <division id="17">Hyundai</division> <division id="18">Infiniti</division> <division id="19">Isuzu</division> <division id="20">Jaguar</division> <division id="21">Jeep</division> <division id="22">Kia</division> <division id="47">Lamborghini</division> <division id="23">Land Rover</division> <division id="24">Lexus</division> <division id="25">Lincoln</division> <division id="48">Lotus</division> <division id="53">Maserati</division> <division id="26">Mazda</division> <division id="61">McLaren</division> <division id="27">Mercedes-Benz</division> <division id="2">MINI</division> <division id="29">Mitsubishi</division> <division id="30">Nissan</division> <division id="34">Porsche</division> <division id="57">Ram</division> <division id="49">Rolls-Royce</division> <division id="52">Scion</division> <division id="42">Smart</division> <division id="37">Subaru</division> <division id="56">Tesla</division> <division id="39">Toyota</division> <division id="40">Volkswagen</division> <division id="41">Volvo</division> </Divisions> '; $parse = simplexml_load_string($xml); print_r($parse); The problem is is that it's not keeping the attribute values in the xml like <division id="1">Acura</division> <division id="44">Aston Martin</division> The PHP is erasing it to be like: array ( 0 => 'Acura', 1 => 'Aston Martin' ); I'm passing this to JSON so I need it to stay in the format of an array, but need the indexes to be the value of the division ID attribute. This is what it's exactly outputting right now: SimpleXMLElement Object ( [responseStatus] => SimpleXMLElement Object ( [@attributes] => Array ( [responseCode] => Successful [description] => Successful ) ) [division] => Array ( [0] => Acura [1] => Aston Martin [2] => Audi [3] => Bentley [4] => BMW [5] => Buick [6] => Cadillac [7] => Chevrolet [8] => Chrysler [9] => Dodge [10] => Ferrari [11] => FIAT [12] => Ford [13] => Freightliner [14] => GMC [15] => Honda [16] => Hyundai [17] => Infiniti [18] => Isuzu [19] => Jaguar [20] => Jeep [21] => Kia [22] => Lamborghini [23] => Land Rover [24] => Lexus [25] => Lincoln [26] => Lotus [27] => Maserati [28] => Mazda [29] => McLaren [30] => Mercedes-Benz [31] => MINI [32] => Mitsubishi [33] => Nissan [34] => Porsche [35] => Ram [36] => Rolls-Royce [37] => Scion [38] => Smart [39] => Subaru [40] => Tesla [41] => Toyota [42] => Volkswagen [43] => Volvo ) ) Thank you for any help!
  3. I need to develop a web based bulk SMS application to integrated into my existing website which is written in PHP. That means I shall use my authentication script to lock it down. The application should be able to pull phone numbers from MYSQL database, and from a specified list. If you can do this or need more information, reach out to me. Thanks.
  4. Good Day PHP world, I am encountering a problem in php code meant to allow the user to update their profile picture. I am using jquery.min and jquery.js. The code below runs with no errors reported. The file has been successfully uploaded to upload path using this form. upload.php <form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'> <input type="file" name="photoimg" id="photoimg" class="stylesmall"/> </form> ajaximage.php $path = "uploads/"; $valid_formats = array("jpg", "png", "gif", "bmp","jpeg"); if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { $name = $_FILES['photoimg']['name']; $size = $_FILES['photoimg']['size']; if(strlen($name)) { list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { if($size<(1024*1024)) // Image size max 1 MB { $actual_image_name = $name.".".$ext; $tmp = $_FILES['photoimg']['tmp_name']; if(move_uploaded_file($tmp, $path.$actual_image_name)) { $query = "UPDATE users SET profile_image='$actual_image_name' WHERE student_id='{$_SESSION['user_id']}'"; $result = mysqli_query($link_id, $query); echo "<img src='uploads/".$actual_image_name."' class='preview'>"; } The problem is the image being uploaded does not display on the Student_home.php <div id="about-img"> <img class="profile-photo" align="middle" src='uploads/".$actual_image_name."' /> </div> But the image uploaded will display when i write directly its filename example <div id="about-img"> <img class="profile-photo" align="middle" src="uploads/107.jpg" /> </div> My problem is i wanted to display the uploaded picture of the specific student on Student_Home.php
  5. Hey folks, I'm looking for an open-source php project to contribute to. I'm not looking for a really well-known project (ex: Wordpress, Zencart) Something small would be greatly appreciated!
  6. I am new to php and need help creating addition and multiplication tables using the html code we were given. I feel like I am on the right track, but I am getting a few errors and I cant figure them out. One of the errors is that it tells me I am not putting in a valid number for rows even though it is a positive number so it should work. Here is my code and all help is appreciated thanks in advance. <html> <head/> <body> <form method="POST" action="<?= $_SERVER['PHP_SELF'] ?>"> <table border="1"> <tr><td>Number of Rows:</td><td><input type="text" name="rows" /></td></tr> <tr><td>Number of Columns:</td><td><select name="columns"> <option value="1">1</option> <option value="2">2</option> <option value="4">4</option> <option value="8">8</option> <option value="16">16</option> </select> </td></tr> <tr><td>Operation:</td><td><input type="radio" name="operation" value="multiplication" checked="yes">Multiplication</input><br/> <input type="radio" name="operation" value="addition">Addition</input> </td></tr> </tr><td colspan="2" align="center"><input type="submit" name="submit" value="Generate" /></td> </tr> </table> </form> <?php //check to see if num of rows is numberic if (isset($_POST["rows"]) && is_numeric($_POST["rows"])){ //check to see if rows is a positive number if($_POST["rows"] > 0){ if(isset($_POST) && $_POST['operation'] == "multiplication") { for($r = 0; $r < $_POST["rows"]; $r++){ echo '<tr>'; for($c = 0; $c < $_POST["columns"]; $c++){ echo '<td>' .$c*$r. '</td>'; echo '</tr>'; }} } else if (isset($_POST) && $_POST['operation'] == "addition") { for($r = 0; $r < $_POST["rows"]; $r++){ echo '<tr>'; for($c = 0; $c < $_POST["columns"]; $c++){ echo '<td>' .$c+$r. '</td>'; echo '</tr>'; } } } } else{ echo 'Invalid rows columns parameters'; exit(); } } else{ echo 'Invalid rows columns parameters'; exit(); } ?> </body> </html>
  7. I have this 3 tables users (id_user) music_styles (id_style, style) ex. (1) - (Blues) user_styles (id_user, id_style) I'm trying to create a form in which the user ($user = $_SESSION['id_user']) chooses through a multiple select the styles of preference to store them in the database using mysqli statements. If the styles prefered are selected they should be displayed in the select input later, how can i accomplish this? Thanks.
  8. I'm using a web service call, my response comes back as an array: stdClass Object ( [contractVehicle] => Array ( [0] => ITSchedule70 [1] => ITCommodityProgram ) ) I then need to hand this response off to anther developer who needs to know that "ITSchedule70" is the selected Contract Vehicle (actually there could be more than one, this only returns one for now), so he can insert it into a SQL query against a MySQL database (to match "Products" with the right "Contract Vehicle". So basically how do I do that? How to wrap it up and send it off, and how to insert a query?
  9. Hi guys, Having some trouble entering some php into my wordpress site that runs on Optimize Press. I'm trying to insert this URL/ tracking code into my page as a hyperlink - 'Click Here Now'. http://www.mysite.com/offer.php?g=TinnitusMiracleTest1_50onRed&sub1=<?php echo $sub1; ?>&sub2=<?php echo $sub2; ?>&sub3=<?php echo $sub3; ?>&sub4=<?php echo $sub4; ?>&sub5=<?php echo $sub5; ?>&lpid=<?php echo $lpid; ?> This is what I have done so far: <a href="http://www.mysite.com/offer.php?g=TinnitusMiracleTest1_50onRed&sub1=<?php echo $sub1; ?>&sub2=<?php echo $sub2; ?>&sub3=<?php echo $sub3; ?>&sub4=<?php echo $sub4; ?>&sub5=<?php echo $sub5; ?>&lpid=<?php echo $lpid; ?>">Click Here Now</a> This does generate a hyperlink, however when I click it, I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=' at line 2 I understand for this code to work the page has to be saved in php. I thought wordpress did this automatically? Can anyone help please? Also, please bear in mind I am using the Optimize Press plugin. Many thanks in advance! Tom
  10. I am trying to make a database application. I encounterd a problem that. suppose multiple users tryto access data it may cause problem. to clearly understand please see the attachment. How can I resolve it?
  11. I found a tutorial on youtube that would allow me to create a calendar of events. We have the calendar html page: This includes the onload="initialCalendar();" function <script type="text/javascript"> /* <![CDATA[ */ function initialCalendar(){ var hr = new XMLHttpRequest(); var url = "calendar/calendar_start.php"; var currentTime = new Date (); var month = currentTime.getMonth() + 1; var year = currentTime.getFullYear(); showmonth = month; showyear = year; var vars= "showmonth="+showmonth+"&showyear="+showyear; hr.open("POST", url, true); hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hr.onreadystatechange = function() { if (hr.readyState == 4 && hr.status == 200) { var return_data = hr.responseText; document.getElementById("showCalendar").innerHTML = return_data; } } hr.send(vars); document.getElementById("showCalendar"). innerHTML = "processing..."; } /* ]]> */ </script> <script type="text/javascript"> /* <![CDATA[ */ function next_month() { var nextmonth = showmonth + 1; if(nextmonth > 12) { nextmonth = 1; showyear = showyear+1; } showmonth = nextmonth; var hr = new XMLHttpRequest(); var url = "calendar/calendar_start.php"; var vars= "showmonth="+showmonth+"&showyear="+showyear; hr.open("POST", url, true); hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hr.onreadystatechange = function() { if (hr.readyState == 4 && hr.status == 200) { var return_data = hr.responseText; document.getElementById("showCalendar").innerHTML = return_data; } } hr.send(vars); document.getElementById("showCalendar"). innerHTML = "processing..."; } /* ]]> */ </script> <script type="text/javascript"> /* <![CDATA[ */ function last_month() { var lastmonth = showmonth - 1; if(lastmonth < 1 ) { lastmonth = 12; showyear = showyear-1; } showmonth = lastmonth; var hr = new XMLHttpRequest(); var url = "calendar/calendar_start.php"; var vars= "showmonth="+showmonth+"&showyear="+showyear; hr.open("POST", url, true); hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hr.onreadystatechange = function() { if (hr.readyState == 4 && hr.status == 200) { var return_data = hr.responseText; document.getElementById("showCalendar").innerHTML = return_data; } } hr.send(vars); document.getElementById("showCalendar"). innerHTML = "processing..."; } /* ]]> */ </script> <script type="text/javascript"> /* <![CDATA[ */ function overlay() { el = document.getElementById("overlay"); el.style.display = (el.style.display == "block") ? "none" : "block"; el = document.getElementById("events"); el.style.display = (el.style.display == "block") ? "none" : "block"; el = document.getElementById("eventsBody"); el.style.display = (el.style.display == "block") ? "none" : "block"; } /* ]]> */ </script> <script type="text/javascript"> /* <![CDATA[ */ function show_details(theId) { var deets = (theId.id); el = document.getElementById("overlay"); el.style.display = (el.style.display == "block") ? "none" : "block"; el = document.getElementById("events"); el.style.display = (el.style.display == "block") ? "none" : "block"; var hr = new XMLHttpRequest(); var url = "calendar/events_fns.php"; var vars = "deets="+deets; hr.open("POST", url, true); hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hr.onreadystatechange= function() { if (hr.readyState == 4 && hr.status == 200) { var return_data = hr.responseText; document.getElementById("events").innerHTML = return_data; } } hr.send(vars); document.get ElementById("events").innerHTML = "processing..."; } /* ]]> */ </script> The script to show to actual calendar is called from here.... calendar_start.php <?php $showmonth = $_POST['showmonth']; $showyear = $_POST['showyear']; $showmonth= preg_replace('#[^0-9]#i', '', $showmonth); $showyear= preg_replace('#[^0-9]#i', '', $showyear); $day_count = cal_days_in_month(CAL_GREGORIAN, $showmonth, $showyear); $pre_days = date('w', mktime(0,0,0, $showmonth, 1, $showyear)); $post_days = (6-(date('w', mktime(0,0,0, $showmonth, $day_count, $showyear)))); echo '<div id="calendar-wrap">'; echo '<div class="title-bar">'; echo '<div class="previous-month"><input name="button" type="submit" value="Previous Month" onClick="javascript:last_month();"></div>'; echo '<div class="show-month">' . date('F', mktime(0, 0, 0, $showmonth)) . ' ' . $showyear . '</div>'; echo '<div class="next-month"><input name="button" type="submit" value="Next Month" onClick="javascript:next_month();"></div>'; echo '</div>'; echo '<div class="week_days">'; echo '<div class="days-of-week">Sun</div>'; echo '<div class="days-of-week">Mon</div>'; echo '<div class="days-of-week">Tues</div>'; echo '<div class="days-of-week">Wed</div>'; echo '<div class="days-of-week">Thur</div>'; echo '<div class="days-of-week">Fri</div>'; echo '<div class="days-of-week">Sat</div>'; echo '<div class="clear"></div>'; echo '</div>'; //Previous Month days if ($pre_days != 0) { for($i=1; $i<=$pre_days; $i++) { echo '<div class="non-cal-days"></div>'; } } //Current Month Days $conn = mysqli_connect('Databaseconnection Things') or die ("Could not connect to the Database"); for ($i=1; $i<= $day_count; $i++) { //get event logic $date = $i.'/'.$showmonth.'/'.$showyear; $query = mysqli_query('SELECT calid FROM calendar WHERE caldate = "'.$date.'"') or trigger_error("Query Failed! SQL: $sql - Error: ".mysqli_error($query), E_USER_ERROR); $num_rows = mysqli_num_rows($conn, $query); if($num_rows > 0) { $event = "<input name='$date' type='submit' value='Details' id='$date' onClick='javascript:show_details(this);'>"; } echo '<div class="cal-days">'; echo '<div class="day-heading">' . $i . '</div>'; if($num_rows != 0) { echo "<div class='opening'><br/>" . $event . "</div>";} echo '</div>'; } //Next Months Days if ($post_days !=0) { for($i=1; $i<=$post_days; $i++) { echo '<div class="non-cal-days"></div>'; } } echo '</div>'; ?> And events_fns. <?php $deets = $_POST['deets']; $deets = preg_replace('#[^0-9/]#i', '', $deets); $conn = mysqli_connect("Database Connection") or die ("Could not connect to the Database"); $events = ''; $query = mysqli_query('SELECT calid FROM calendar WHERE caldate = "'.$deets.'"') or die ("Error:".mysqli_errno()); //echo "$query"; $num_rows=0; if ($result = mysqli_query($query,$conn)) { $num_rows = mysqli_num_rows($result); } if ($num_rows > 0) { $events .= '<div id="eventsControl"><button onMouseDown="overlay()">Close</button><br /><br />'.$deets.'<br /><br /></div>'; while ($row = mysqli_fetch_array($query)) { $title = $row['eventtitle']; $desc = $row['description']; $loc = $row['eventlocation']; $events .='<div id="eventsBody">'.$title.'<br />'.$desc.'<br />'.$loc.'<hr /></div>'; } } echo $events; ?> I have posted all the code so you can see how it fits together ect ect however the issue I am having is an error message that repeats across the page. it reads: Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /home/sites/agile-cms.co.uk/public_html/mfcf/calendar/calendar_start.php on line 49 Fatal error: Query Failed! SQL: - Error: in /home/sites/agile-cms.co.uk/public_html/mfcf/calendar/calendar_start.php on line 49 for ($i=1; $i<= $day_count; $i++) { //get event logic $date = $i.'/'.$showmonth.'/'.$showyear; $query = mysqli_query($conn, 'SELECT eventid FROM events WHERE eventdate = "'.$date.'"') or trigger_error("Query Failed! SQL: $sql - Error: ".mysqli_error($query), E_USER_ERROR); $num_rows = mysqli_num_rows($query); if($num_rows > 0) { $event = "<input name='$date' type='submit' value='Details' id='$date' onClick='javascript:show_details(this);'>"; } echo '<div class="cal-days">'; echo '<div class="day-heading">' . $i . '</div>'; if($num_rows != 0) { echo "<div class='opening'><br/>" . $event . "</div>";} echo '</div>'; } I think I have missed something being so close to it and I think I need an outside P.O.V to look at it and point me in the right direction.... Any help would be much appreciated....
  12. Hi guys, i'm in a dead end with this. I'm more a design guy and i'm trying to implement these 2 payment gateways on a website i'm launching soon but don't know how to do it. I have the php sample files from bitpay and the other payment gateway (offline atm payments). I can implement a button for the payment but the php needed to receive payment notification, ipn or callback, and update user balance in the database it's way out of my knowlegde. Can someone give me a hand in implementing this? I have paypal runing but i'd like to have these other two options. Thanks in advance, Tiago Vasconcelos
  13. Hello, How can I make gif from video while uploading it or after uploaded? Is there any tutorial.. I've been searched but didn't found anything. The reason I want this is because when I upload video then I will show few thumbnails of the video on the page. Then when user hover the video will play short gif from the video 2-5 seconds and when the user click on video will play the video.. Hope you get what I mean.. I don't know how to explain it better. Just point me somewhere to read or watch about this.. Thank's in advanced! p.s. Sorry for my English! EDIT: Here is the exaplme.. when you hover over the video an hold your mouse there it will play some gif http://gifsoup.com/faq.php Is it possible this?
  14. Hello, Anyone can suggest me what is the best way to update table records. I'm kinda scared to make an update on a table because it may damage the system and I am not really good on SQL commands. Right now I just made a process on PHP to update table records. It does update email records on but it stop because of the limit of loading the page. Is there anyway accurately update all the data of the table. Here is what I want to achieve. I have a table with an "email" field on it, those email data from "email" field on tb_one must be change to cID records base on tb_two. tb_one Field = - id - email - etc. tb_two Field = - id - email (same as on tb_one) - cID
  15. I am having trouble implementing Anthony Ferrara's RandomLib library in my custom php application. Here's my code: require_once 'RandomLib/Factory.php'; $factory = new \RandomLib\Factory; $generator = $factory->getMediumStrengthGenerator(); return $generator->generate(16); Unfortunately, I'm getting the following error: Fatal error: Class 'SecurityLib\AbstractFactory' not found in C:\wamp\www\RandomLib-master\RandomLib-master\lib\RandomLib\Factory.php on line 30 How do i implement this library? Thanks
  16. Hi, I am getting the following error message when running my script. It worked recently, a library was restored and now I'm getting this. ITW0002CL in ITWEB type *N not found. SQLCODE=-204 ITW0002CL in ITWEB type *N not found. SQLCODE=-204 The library (ITWEB) and program (ITW0002CL) do exist and the authority to those objects is more than sufficient. The script works flawlessly when accessing any other system. I've debugged it in Zend Studio (Debug URL) specifying a system it works on and the one it is not finding the object on and all values in the variables are as they should be. I'm at a loss to figure out why it does not find the program object when it does exist. Not sure if it will help but the code (partially edited) is below. Any help would be greatly appreciated. bgg <?php // show generic header include ("../includes/iheader.php"); // show generic top navigation include ("../includes/iTopNavigate.php"); print ("<div id=body>"); print ("<div style=text-align: left;></div>"); print ("<div id=content>"); print ("<div style=text-align: left;></div>"); print ("<div style=text-align: right;>"); print ("<br />"); print ("<div style=text-align: left;>"); //Establish connection to remote systems after getting correct connection // parms ini_set('display_startup_errors', 0) ; ini_set('display_errors', 0) ; ini_set('log_errors', 1) ; ini_set('error_reporting', E_ALL | E_STRICT) ; $filename=$_POST['filename']; $library=$_POST['library']; $selected=$_POST['select']; $parmIN1 = $filename; $parmIN2 = $library; $parmIN3 = '*FILE'; $parmOUT3 = ' '; $database = " "; $stmt = " "; $codetext = ' '; $JOURNAL = ' '; $host = ''; $hasystem = ' '; $conn = i5_connect('', '', ''); $description = array( array( "Name"=>"CONPA", "IO"=>I5_INOUT, "Type"=>I5_TYPE_CHAR, "Length"=>"10" ), array( "Name"=>"RTVPRF", "IO"=>I5_INOUT, "Type"=>I5_TYPE_CHAR, "Length"=>"10" ), array( "Name"=>"NODE", "IO"=>I5_INOUT, "Type"=>I5_TYPE_CHAR, "Length"=>"8" ), ); $pgm = i5_program_prepare('ITWEB/WEBCONGET', $description); if (!$pgm) { throw_error("i5_program_prepare"); exit(); } $parameter = array( "CONPA"=>" ", "RTVPRF"=>"", "NODE"=>"$host" ); $parmOut = array( "CONPA"=>"CONPA" ); $ret = i5_program_call($pgm, $parameter, $parmOut); if ($ret === FALSE) { $errorTab = i5_error(); echo "FAIL : i5_program_call failure code <br>"; die(); } i5_program_close($pgm); i5_close($conn); function throw_error($func) { echo "Error in function: ".$func." --- "; echo "Error Number: ".i5_errno()." --- "; echo "Error Message: ".i5_errormsg()."<br>"; } $queryhasys = "Select * from ITWEBLCL.syslst where SALI = '$selected' "; $host = "*LOCAL"; $conn3 = db2_connect ($host,"", ""); echo db2_stmt_errormsg(); // Get the HA system name so we can add that system name to the search $queryexe = db2_exec($conn3, $queryhasys) ; while(db2_fetch_row($queryexe)) { $SHAS = db2_result($queryexe, 'SHAS'); // System Name HA Name $SALI = db2_result($queryexe, 'SALI'); // System Name Prod Alias $SHDN = db2_result($queryexe, 'SHDN'); // HA System DNS name $SPRD = db2_result($queryexe, 'SPRD'); // Production DNS name $SRDB = db2_result($queryexe, 'SRDB'); // relational database name $hasystem = $SHAS; } $host = $selected; if ($SRDB !== ' ') { $host = $SRDB; } $conn2 = db2_connect($host,"",$CONPA ); $proc = "CALL ITWEB.ITW0002CL(?, ?, ?, ?)"; $stmt = db2_prepare($conn2, $proc); echo db2_stmt_errormsg(); db2_bind_param($stmt, 1, "parmIN1", DB2_PARAM_IN); db2_bind_param($stmt, 2, "parmIN2", DB2_PARAM_IN); db2_bind_param($stmt, 3, "parmIN3", DB2_PARAM_IN); db2_bind_param($stmt, 4, "parmOUT3", DB2_PARAM_OUT); db2_execute($stmt); echo db2_stmt_errormsg(); switch (substr($parmOUT3, 0, 2)) { case '01': $codetext = "Object not found in library $library"; print ("<p><h2>File $filename in $library could not be checked on system $selected, the error returned was - $codetext</h2></p>"); break; case '02': $codetext = "Not Authorized to object in library $library"; print ("<p><h2>File $filename in $library could not be checked on system $selected, the error returned was - $codetext</h2></p>"); break; case '03': $codetext = "Library $library not found"; print ("<p><h2>File $filename in $library could not be checked on system $selected, the error returned was - $codetext</h2></p>"); break; case '04': $codetext = 'Member not found in file'; print ("<p><h2>File $filename in $library could not be checked on system $selected, the error returned was - $codetext</h2></p>"); break; case '05': $codetext = "Not authorized to use library $library"; print ("<p><h2>File $filename in $library could not be checked on system $selected, the error returned was - $codetext</h2></p>"); break; case '06': $codetext = 'Cannot assign library'; print ("<p><h2>File $filename in $library could not be checked on system $selected, the error returned was - $codetext</h2></p>"); break; case '07': $codetext = 'Error occured during processing of command'; print ("<p><h2>File $filename in $library could not be checked on system $selected, the error returned was - $codetext</h2></p>"); break; case 'NJ': $codetext = 'Object has no journal associated'; print ("<p><h2>File $filename in $library is not journaled on system $selected. No journal information retrieved</h2></p>"); break; case 'AA': // if the code is AA then we got a good return and we can start the page $codetext = 'Journal information found'; $JOURNAL = substr($parmOUT3, 2, 10); $JOURNLIB = substr($parmOUT3, 12, 10); $queryhasys = "Select * from ITWEBLCL.syslst where SALI = '$selected' "; $host = "*LOCAL"; $conn3 = db2_connect ($host,"", ""); echo db2_stmt_errormsg(); // Get the HA system name so we can add that system name to the search $queryexe = db2_exec($conn3, $queryhasys) ; while(db2_fetch_row($queryexe)) { $SHAS = db2_result($queryexe, 'SHAS'); // System Name HA Name $SALI = db2_result($queryexe, 'SALI'); // System Name Prod Alias $SHDN = db2_result($queryexe, 'SHDN'); // HA System DNS name $SPRD = db2_result($queryexe, 'SPRD'); // Production DNS name $hasystem = $SHAS; } $jrnsql = "Select * from itweblcl.itw0006pf where (itwjsysa = '$hasystem' and itwjjrn = '$JOURNAL') or (itwjsysa = '$selected' and itwjjrn = '$JOURNAL') order by ITWJATDAT DESC , ITWJATTIM DESC"; $queryexe = db2_exec($conn3, $jrnsql) ; echo db2_stmt_errormsg(); print ("<p><h3>Journal information requested for file $filename in library $library on system $selected</h3>"); print ("<h3>The journal associated with the file is $JOURNAL in $JOURNLIB</h3></p>"); print ("<br><br>"); print ("<table><tr><b><td>Node</td><td>Receiver Name </td><td> Receiver Library </td><td> Attached Date </td><td> Attached Time </td><td> Detached Date </td><td> Detached Time </td><td> Status</td><td>Backup Tape </td> <td> Tape Expiration&nbsp</td></b>\n"); while(db2_fetch_row($queryexe)) { $ITWJSYS = db2_result($queryexe, 'ITWJSYS'); // System Name $ITWJSYSA = db2_result($queryexe, 'ITWJSYSA'); // system alias $ITWJJRN = db2_result($queryexe, 'ITWJJRN'); // journal $ITWJJRNL = db2_result($queryexe, 'ITWJJRNL'); // journal library $ITWJJRNRC = db2_result($queryexe, 'ITWJJRNRC'); // receiver $ITWJJRNRL = db2_result($queryexe, 'ITWJJRNRL'); // receiver library $ITWJATDAT = db2_result($queryexe, 'ITWJATDAT'); // attached date $ITWJATTIM = db2_result($queryexe, 'ITWJATTIM'); // attached time $ITWJDTDAT = db2_result($queryexe, 'ITWJDTDAT'); // detached date $ITWJDTTIM = db2_result($queryexe, 'ITWJDTTIM'); // detached time $ITWJRNRSTA = db2_result($queryexe, 'ITWJRNRSTA'); // journal status $ITWJRNTAP = db2_result($queryexe, 'ITWJRNTAP'); // Journal Tape ID $ITWTAPSTA = db2_result($queryexe, 'ITWTAPSTA'); // Tape Status $ITWTAPEXP = db2_result($queryexe, 'ITWTAPEXP'); // Tape Expiration // Lets blank the date if its the defualt value if ($ITWTAPEXP == '0001-01-01') { $ITWTAPEXP = ' '; } // Lets blank the date if its the defualt value if ($ITWJDTDAT == '0001-01-01') { $ITWJDTDAT = ' '; } // Lets blank the date if its the defualt value if ($ITWJDTTIM == '00.00.00') { $ITWJDTTIM = ' '; } print ("<tr><td>$ITWJSYS</td><td><form name=setit method=post action=http://primintl/Journal/iJrnSetAut.php><input type=hidden name=SHDN value=$SHDN><input type=hidden name=ITWJJRN value=$ITWJJRN><input type=hidden name=SPRD value=$SPRD><input type=hidden name=ITWJJRNL value=$ITWJJRNL><input type=hidden name=CONPA value=$CONPA ><input type=submit value=$ITWJJRNRC></form></td> <td> $ITWJJRNRL </td><td> $ITWJATDAT </td><td> $ITWJATTIM </td><td> $ITWJDTDAT </td><td> $ITWJDTTIM </td><td> $ITWJRNRSTA </td><td> $ITWJRNTAP</td><td> $ITWTAPEXP </td></tr>\n"); } print("</tbody>"); print("</table>"); break; } // if the connection has failed, let the user know and clean up the screen if (!$conn2){ print ("<b> <h3>Connection to iSeries $host database failed </h3><b></b>\n"); print db2_conn_errormsg(); die( "Connection error is :" . i5_errormsg()); exit(); } db2_close($conn); db2_close($conn2); db2_close($conn3); //Show the flag banner at the bottom of the page print("<br>"); print("<br>"); //Show the flag banner at the bottom of the page include_once ("../includes/iFlags.php"); // Show left Navigation include_once ("../includes/iNavigate.php"); // Show the common footer include_once("../includes/ifooter.php"); // Column Header function Print_Head($ColHdg) { print("<hr style=WIDTH: 91.41%; HEIGHT: 3px align=center size=1 width=100.00%/>"); print("<tr> <th colspan=3><h3>$ColHdg</h3></th></tr> \n"); print("<left><table width=10% cellpadding=1>"); // will control the flag bottom position and the left tool bar print("<tbody>"); } ?>
  17. Hi all, Im a bit new to this forum so sorry if I ask rather silly questions.. Anyways I got given a project with entails making a simple php calendar, with hover effects to show the daily events ect.. I would use the source I was given but its making nearly no sense to me at this point.. Anyone know of a tutorial or vid I could read/watch to get a grip of what is needed.. Or maybe a snippet and/or advice how to tackle it Thanks in advance
  18. Hello, I want to grab some data from this site, using a script. But I am stuck right at the beginning. If you go to the site, you can make a selection with the drop-down-boxes and get some output. For example if you select (left side: text on page in dutch / right side: translation in english): Selecteer competitienaam: Najaarscompetitie 2014 Select league name: Autumn League 2014 Selecteer competitiegroep: Eredivisie dames Select league group: Eredivisie ladies Selecteer weergave: Programma (incl. uitslagen en stand) Select view: Program (including results and position) Optioneel poule filter: De Treffers R Optional group filter: De Treffers R Selecteer poule(s): Eredivisie - Poule A Select group(s): Premier League - Group A I want to grab the output you get after making all the selections. When I look at the webbrowser's page source the selections (drop-down-boxes) are inside an iframe from another domain: <iframe src="http://www.nttb-competitie.nl/" width="100%" height="1200" scrolling="yes" frameborder="0" name="NTTB_Competitie"></iframe> I figured out: First, the script gets url: http://www.nttb-competitie.nl/selectie.php?anr=0 And after last selection it gets url: http://www.nttb-competitie.nl/web_programma.php?reset=0&pidString=1009267&sc=0&vastgesteldeAfdelingsnr=0&cnid=10085&cid=10704&view=programma&pf=1269&pid=1009267 My problem is when I copy those URL's in a webbroser 's address bar, I get a page with only the words: Ongeldige aanroep! Which means "Invalid Call!" So my question is: How can I grab the data instead of this stupid message? Is it even possible or is it somehow protected? Please help!
  19. I need code for upload images for php as well as to edit that image
  20. Hello this may sound a little confusing. I recently made a fake website using this phpacademy tutorial I found. Anyways it has an quantity stock what I mean by this is let's I have 3 copies of a video game an a person set they quantity for 2 of the 3 copies and proceed to the checkout through paypal payment successful okay. My question is: How can I go about sending the quantity stock back to the database to subtract 2 from 3 to be left with 1 copy of the game in the quantity section after a successful purchase? Code is below in case I confused someone ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////// Maximumize / calling the quantity from Database ///////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if(isset($_GET['add'])){ $quantity = mysqli_query($db_conx,'SELECT id, quantity FROM products WHERE id='.mysqli_real_escape_string($db_conx,(int)$_GET['add'])); while ($row = mysqli_fetch_assoc($quantity)){ if ($row['quantity']!=$_SESSION['cart_'.(int)$_GET['add']]) { $_SESSION['cart_'.(int)$_GET['add']]+='1'; } } header('Location: '.$page); } if(isset($_GET['remove'])){ $_SESSION['cart_'.(int)$_GET['remove']]--; header('Location:' .$page); } if(isset($_GET['delete'])){ $_SESSION['cart_'.(int)$_GET['delete']]='0'; header('Location:' .$page); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////// Calling all products from Database ///////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function products($db_conx){ $get = mysqli_query($db_conx,"SELECT id, name, description, price FROM products WHERE quantity > 0 ORDER BY id DESC"); if (mysqli_num_rows($get) ==0){ echo "There are no products to display"; } else { while ($row = mysqli_fetch_assoc ($get)){ echo '<p>'.$row ['name']. '<br/> <br/>' .$row ['description']. '<br/> <br/>' .'&dollar;'.number_format($row['price'], 2).' <a href="cart.php?add='.$row ['id'].'">Add</a></p>'; } } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////// Paypal Checkout ///////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function paypal_items($db_conx){ $num = 0; foreach($_SESSION as $name => $value){ if ($value != 0){ if(substr($name, 0, 5)=='cart_'){ $id = substr($name, 5, strlen($name) -5); $row = mysqli_query($db_conx,'SELECT id, name, price, shipping FROM products WHERE id ='.mysqli_real_escape_string($db_conx,(int)$id)); while ($query = mysqli_fetch_assoc($row)){ $num++; echo '<input type="hidden" name="item_number_'.$num.'" value="'.$id.'">'; echo '<input type="hidden" name="item_name_'.$num.'" value=" '.$query['name'].' ">'; echo '<input type="hidden" name="amount_'.$num.'" value=" '.$query['price'].' ">'; echo '<input type="hidden" name="shipping_'.$num.'" value=" '.$query['shipping'].' ">'; echo '<input type="hidden" name="quantity_'.$num.'" value=" '.$value.' ">'; } } } } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////// Shopping Cart View ///////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function cart($db_conx) { foreach($_SESSION as $name => $value) { if ($value > 0) { if(substr($name,0 ,5) . 'cart_'){ $id = substr($name, 5, (strlen($name) -5)); $row = mysqli_query($db_conx,'SELECT id, name, price FROM products WHERE id=' .mysqli_real_escape_string ($db_conx,(int)$id)); while ($query = mysqli_fetch_assoc($row)){ $sub = $query['price']*$value; echo $query['name'].' x ' .$value. ' @ &dollar;' .number_format ($query['price'], 2). ' = &dollar;'.number_format($sub, 2). '<a href="cart.php?remove='.$id.'">[-]</a> <a href="cart.php?add='.$id.'">[+]</a> <a href="cart.php?delete='.$id.'">[Delete]</a> <br/> <br/> '; } } $total += $sub + $shipping; } } if ($total ==0) { echo "Your cart is empty."; } else { echo 'Total: &dollar;' .number_format($total, 2); ?> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="business" value="youremail@outlook.com"> <?php paypal_items($db_conx); ?> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="amount" value="<?php echo $total ;?>"> <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but03.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> <?php } } ?>
  21. I've just gotten back into re learning web development, I have created a contact form however my server is forcing me to use SMTP which will require me to have a config include with my details inside. How do I ensure nobody can open the files in the browser? I have heard of putting the files outside of the webroot or using htaccess files however the passive aggressive answers I got from stack over flow didn't tell me HOW to implement them. The files are Form.HTML Bin/config.php Bin/mail.php Any help is appreciated.
  22. Hello, I want to grab some data using a script from this site. But I am stuck right at the beginning. If you make a selection with the drop down boxes you get some output. For example you select: Selecteer competitienaam: Najaarscompetitie 2014 Selecteer competitiegroep: Eredivisie dames Selecteer weergave: Programma (incl. uitslagen en stand) Optioneel poule filter: De Treffers R Selecteer poule(s): Eredivisie - Poule A I want to grab this output. When I look at the page source it is inside an iframe: <iframe src="http://www.nttb-competitie.nl/" width="100%" height="1200" scrolling="yes" frameborder="0" name="NTTB_Competitie"></iframe> I figured out: The script on the site first it gets url: http://www.nttb-competitie.nl/selectie.php?anr=0 And after last selection it gets url: http://www.nttb-competitie.nl/web_programma.php?reset=0&pidString=1009267&sc=0&vastgesteldeAfdelingsnr=0&cnid=10085&cid=10704&view=programma&pf=1269&pid=1009267 My problem is when I copy those URL's in a webbroser I get a page with only the words: Ongeldige aanroep! Which means "Invalid Call!" So my question is: How can I grab the data instead of this stupid message. Is it even possible or is it somehow protected? Please help!
  23. i have a register and login page where the users can perform register and login task and their detail gets saved in the database. my requirement is that when the user enters his/her account, they should be redirected to their profile page, where they can view all their profile details. Till now i have been able to make the user login and dislay a part of their profile page, for this purpose the code that i am using is <code> <?php include('retailer_session.php'); ?> <!DOCTYPE> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Welcome to your homepage</title> <meta name="viewport" content="width=device-width", initial-scale=1.0"> <link href="css/bootstrap.min.css" rel="stylesheet" /> <link href="css/styles.css" rel="stylesheet" /> <link href="css/carousel.css" rel="stylesheet"> </head> <body> <div id="profile"> <div class="navbar navbar-inverse navbar-static-top"> <div class="container"> <a href="#" class = "navbar-brand"> <id="welcome">Welcome : <i><?php echo $login_session; ?></i> </a> <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse"> <span class = "icon-bar"> </span> <span class = "icon-bar"> </span> <span class = "icon-bar"> </span> </button> <div class="collapse navbar-collapse navHeaderCollapse"> <ul class = "nav navbar-nav navbar-right"> <li class ="active"> <a href="admin_profile.php">Home</a></li> <li> <a href="retailer_logout.php"><id="logout">Log Out</a></li> </ul> </div> </div> </div> </div> </body> </html> Apart from this i want a listing where the user can view their data and edit their details as it is done on many websites. can anyone please help me with the code </code>
  24. <?php error_reporting(E_ALL); $psPath = "powershell.exe"; $psDir = "C:\\wamp\\www\\ps\\"; $psScript = "SampleHTML.ps1"; $runScript = $psDir. $psScript; $prem = "-Action enable"; $runCMD = $psPath. " " .$runScript. " " .$prem; //var_dump($runCMD); $output = exec($runCMD); echo $output; ?> Hello, I am working on a small project to get results from powershell script by using PHP. For some reason in PHP logs I get Exec unable to fork. Above is the script I wrote to execute powershell script within php. My webserver is IIS 7, and app pool is using a domain user that has full rights for Powershell to execute and get remote server results.
  25. So why would one use a php template engine like smarty, other than to seperate the code from html? Is this method preffered for creating larger web applications with php?
×
×
  • 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.