-
Posts
78 -
Joined
-
Last visited
Everything posted by Heinz Stapff
-
OK. I had set up an Iframes test site and then changed the frames to divs for UniServer/www/index.html, hopping that creating seperate html files would make it easier to create php files to call onclick of li elements from external.js files that change the div.innerHTML with mysql_query. The onclick of the query works and the div.innerHTML changes as httpresponce echo file.php, producing the desired html elements in the div The external CSS presents the change perfectly. Unfortunatley the external.js no longer has power over the elements produced by the query. I checked the view source on the page and found that it remained the same and did not reveal the div content change which might mean I can't grab the element values that I need to manipulate the query result html elements. I realize now that the connection was closed at the end of the query so the elements must be there along with their values even if they don't show up in view source? External.js Example part of same js that called mysql_query function pictureclick( ) { var f1=document.getElementById('f1');//div changed by mysql_query var pictures=f1.getElementsByTagName('img');//tags created by mysql_query var iObj=pictures; for(var i=0; i<iObj.length; i++) { iObj[i].onclick=function( ) { enhance(this);}; } }; function enhance(img){ var icell = img.parentNode.parentNode;//accessable in standard html var pref = icell.getElementsByTagName('input')[2].value; f1.innerHTML = "<img src='"+pref+"' id='eimage'align='center' style='height:100%; width:auto;'/> <button id='imgbt' style='position:fixed; top:78%; left:80%; z-index:100;'>Continue Shopping</button>"; alert(pref);//produces ..../file.jpg in standard html not in echo php div content? } addEvent(window,'load',function( ){ var alreadyrun = false; if(alreadyrun) { return; } alreadyrun=true; f1class( );//already acctivated on index.html load },false); addtocart( );pictureclick( );//addtocart dosen't work on the query result elements either I'm wondering if this occurs because of the browser change in UniServer and my .js isn't a good cross browser solution though I've taken a lot of care to make it so. Any advise Greatly appreciated!
-
Path to php.ini pointing to C: When Uniserver in D:
Heinz Stapff replied to Heinz Stapff's topic in phpMyAdmin
Hay Coral, BobS was right and it worked, the div innerHTML gets the output from query the only thing is that the getSilver.php returns the #comment at the top of the php page along with the table. Is there a way to write the SELECT that dosen't return the #Comment in the php page? -
Hay Coral, BobS was right and it worked, the div innerHTML gets the output from query the only thing is that the getSilver.php returns the #comment at the top of the php page along with the table. Is there a way to write the SELECT that dosen't return the #Comment in the php page?
-
Path to php.ini pointing to C: When Uniserver in D:
Heinz Stapff replied to Heinz Stapff's topic in phpMyAdmin
Coral, BobS spoted the error and I havent testeted the result yet. Let me know if you see anything else or recomend anything else. BobS is correct when he says this isn't the forum for Ajax and php tutorials but it is for UniServer working correctly questions. <?php $link=mysql_connect("localhost","root","root")or die(mysql_error( )); mysql_select_db("bwi",$link) or die(mysql_error( )); $query=mysql_query("SELECT Code,Item,Description,Href,Src FROM silver")or die(mysql_error( )); // had msql_query not mysql!!!!!!!!!! echo "<table border='1'> <tr> <th>Code</th> <th>Item</th> <th>Description</th> <th>Href</th> <th>Src</th> </tr>"; while($row = mysql_fetch_array($query)) { echo "<tr>"; echo "<td>" . $row['Code'] . "</td>"; echo "<td>" . $row['Item'] . "</td>"; echo "<td>" . $row['Description'] . "</td>"; echo "<td>" . $row['Href'] . "</td>"; echo "<td>" . $row['Src'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($link); ?> Hay Coral, BobS was right and it worked, the div innerHTML gets the output from query the only thing is that the getSilver.php returns the #comment at the top of the php page along with the table. Is there a way to write the SELECT that dosen't return the #Comment in the php page? -
Roger that BobS
-
BobS You could be right, I'll check it out, should be mysql_query() first, then $result but acctualy the whole script runs like this and draws the error in the div designated for the http response <?php $link=mysql_connect("localhost","root","root")or die(mysql_error( )); mysql_select_db("bwi",$link) or die(mysql_error( )); $query=mysql_query("SELECT Code,Item,Description,Href,Src FROM silver")or die(mysql_error( )); echo "<table border='1'> <tr> <th>Code</th> <th>Item</th> <th>Description</th> <th>Href</th> <th>Src</th> </tr>"; while($row = mysql_fetch_array($query))// could be msql_fetch_row($query) ??? { echo "<tr>\n"; echo "<td>" . $row['Code'] . "</td>\n";// don't know if new line is required? echo "<td>" . $row['Item'] . "</td>\n"; echo "<td>" . $row['Description'] . "</td>\n"; echo "<td>" . $row['Href'] . "</td>\n"; echo "<td>" . $row['Src'] . "</td>\n"; // don't know if it should be $row[5] ref? echo "</tr>"; } echo "</table>"; mysql_close($link); ?> Sorry BobS I think your right that this is not the place for tutorials but I need to know UniServer is working properly before I proceed.
-
BobS Thanks for the response. Will try everything you said and the Wiki. Frustration with fatal error on the div change this morning made me check out a lot but if phpinfo() shows php configure file path=c/windows then it's not going to work anyway. I checked the php.ini and PHPINdir on Apache and found that all was directed corectly and uncommented etc.
-
Am getting fatal error: Call to undefined function() in D:/UniServer/www/getSilver.php on line 9 Checked phpinfo in Admin panel and it tells me Configuration File (php.ini) Path = C:\WINDOWS Loaded Configuration File = D:\UniServer\usr\local\php\php.ini Hints from web searches indicate that I should change the file path to the D:\UniServer\usr\local\php\php.ini To stop this error. I am using UniServer Orion 7.1.3 and the PHP configuration link dosen't provide a path to php.ini change? Not even sure that it would work
-
Coral I'm not sure but I guess your telling me I have to convert my index.html page into index.php before the server acctually processes anything correctly. I,m also guessing you're right when you say there isn't enough information, though I don't think the UniServer team would advertise that you have to convert all your html to php to get the full benifit of the server. Unfortunatley I did not have any choice as I deleted ISS and visual studio programing from my original WIN XP PRO SP3 and Microsoft hasn't provided a way to reload them without the disc and often regards systems without them as illegal copies. I really didn't understand how big a part of the OS those components where. Even the pdf file Mastering phpMyAdmin seems to fall short in describing how you change PHP =values. I'm guessing your going to be locked into PHP one way or the other. The language selection is just a part of the browser OS war and Dom vs MS model. Correct me if I'm wrong but you are saying that I need to convert my index.html into index.php? No pun on the? intended. Something I never got wind of.
-
Not sure but when I run Apache and Msql as programs in D: Then enter http localhost/index.html in the next tab I get My Index page but no errors showup. When I CLICK on the index.html file in D:/UniServer/www it opens and reports errors. I'm wondering how or if I should turn it on? The error that shows up when I use the click method on the index.html after I click one of it's links is 'Access Denied' but I'm not getting the error when I enter the page through the localhost browser input. The link addevent onclick runs two functions, one that changes the logo image and another that makes a sql call to a database and table that I have in mysql. The logo changes but no db info or error shows up unless I opened the index.html by clicking on it in the www folder. In any case I'm getting pissed off that UniServer is not helping me learn Ajax OR sql without a complete run around.
-
Getting Access denied with this code $link=mysql_connect("localhost","root","root")or die(mysql_error( )); mysql_select_db("bwi",$link) or die(mysql_error( )); $result=msql_query("SELECT Code,Item,Description,Href,Src FROM silver")or die(mysql_error( )); What password and ussername do I have to use with mysql_connect??????????????????????????????????? I haven't changed them and Uniserver is running on thumb drive.
-
I can't conect to bwi with $link=mysql_connect("localhost","root","root")or die(mysql_error( )); mysql_select_db("bwi",$link) or die(mysql_error( )); $result=msql_query("SELECT Code,Item,Description,Href,Src FROM silver")or die(mysql_error( )); Developer tools is reporting 'Access denied'. Uniserver in D: thumb drive and my index.html in www folder on WIN XP SP3 system run as Administrator??????????????????????????? What username and passwords should I use in mysql_connect????????????????????????
-
I found this at w3 schools PHP tutorial but see it represents a Select html box and options and my site has UL, List/Li Elements that had < a tags with href and target attributes. I've stripped the jewelry UL of it's Li < a tags and want to know how to get the Li oncklick to get the database table to change the 'f1' div innerHTML. w3 School http://www.w3schools.com/php/php_ajax_database.asp The function function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getuser.php?q="+str,true); xmlhttp.send(); } I have addEvent in mockup.js like so var jewelrylist=document.getElementById('jewelrylist'); var jewelry=jewelrylist.getElementsByTagName('li'); var silver=jewelry.item(1); function getsilver(text)//Changed from 'str' { if (silver.text=="Silver")//the li element text { document.getElementById("f1").innerHTML="";//the div id I want to change return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("f1").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getSilver.php?s="+str,true);//don't know if this file goes in the www folder? xmlhttp.send(); } addEvent(silver,'click', getsilver(); }, false);//Should work?? My HTML UL ID jewelrylist <ul id="jewelrylist"> <li id="jewelry" class="top" title="The Most Beautiful Jewelry Made in Mexico!">Jewelry</li> <li class="item" title="Silver Jewelry Made in Mexico!">Silver</li> <li class="item" title="Silver & Gold Jewelry, Made in Mexico!">Silver & Gold</li> <li class="item" title="Silver Jewelry with Stones, Made in Mexico!">Silver & Stones</a> </li> </ul> getSilver.php Not sure what folder to put this in, www or php? <?php $s=$_GET["s"]; $con=mysql_connectmysql_connect('localhost','root','root');//default for Uniserver?? if(!con){die('Not connected:'.mysql_error( ));} mysql_select_db("wbi",$con);//mydb $sql="SELECT*FROM silver WHERE Id='".$s."'";//table silver has 2 test rows $result=mysql_query($sql); while($row = mysql_fetch_array($result))//might have to add some splits for Set types in rows? { echo "<div id='rowcell" . $row['Id'] . "' class='rowcell'>"; echo "<div id='imagecell" . $row['Id'] . "' class='imagecell' align='center'>"; echo "<a id='imageref" . $row['Id'] . "' class='imageref'"; echo "href='" . $row['Href'] . "' title='Take a Closer Look then Press Your"; echo "Back Button to Return'><img src='" . $row['Src'] . "'/></a></div>"; #end of .imagecell continues verbosley I know I'll have to use INCLUDE mydb.php and filtering to make it more secure but I'd like to get it tried before I start modifying the other ULs. Any advise greatly appreciated. Also let me know if this is an inappropriate forum for this topic
-
I'm just about to test some get and post requests from index.html in www folder. I'm assuming that the relevant getSilver.php should go in the same folder/directory please let me know. Might be the PHP folder? Also let me know if I can just use 'getSilver.php' or need another path name like PHP/getSilver.php etc.
-
Traycontroller useless on Windows 7 64 bit
Heinz Stapff replied to Borszczuk's topic in Uniform Server - Windows
BobS Yeah, thanks for that to, I don't have the need to run as a Service though I did run it that way the first time I setup Uniserver 3 or four versions ago. I'm wondering if I'll have to use that tidbit some time soon? In any case, I have found that it will install the services properly with only one change. For \UniServer\Start.exe, in Properties>Compatibility, click on "Change settings for all users", and then ONLY check the "Run this program as an administrator" box. No more fiddling needed -
Traycontroller useless on Windows 7 64 bit
Heinz Stapff replied to Borszczuk's topic in Uniform Server - Windows
Borszczuk You can only run it as a program and have to right click or left click the tray icon to see the difference. If you are runing the servers from a USB/THUMB drive on WIN XP. If you run the servers from a harddrive folder like C:/UniServer then you have to set up the folder so that it has no file path spaces like WIN XP has e.g. C:/My Documents and Settings contains spaces between the words. Most of this is written in the UniServer/Docs folder though some what abstract. Read all of the .txt files and you might get it. When run as Services they run on a virtual drive created on C: Normally called W: I think and the virtual drive only exists while the servers are runing. -
Thanks sdogi I was asking if I ran a local folder server could I just copy and paste it to thumb drive D: which would solve the portability problem and should be easy if it wasn't for the no spaces in file path change. Would the server run from the thumb drive. I guess the answer would be yes if you ran the servers as programs from the D: drive but don't know.
-
BobS Sorry, been caught up in other matters and lost context. I'm not even sure I've got the latest Orion 7.1.2 running any more but there is no password dialog to enter and yes I probably changed the password on the install then deleted it and reinstalled to get access without the password dialog. It's total confussion in this one man army. Very pertinant the Might have said 'access my.ini via link to left of administrators panel 'MySQL config file' Should have same directions for all links in administrators panel
-
sdogi Thanks for the info regarding Just to be clear Your running Uniserver on hard drive C or thumb drive D as a Service? What is the file folder, C: InetPub or other? I have the same system and run on D:/UniServer as a program just fine? Without IIS or Both IIS and Apache? Would like local folder if I could copy to thumb/USB drive? The true strength of UniServer is portability? Adding this to MyFavs. Will that book mark this topic, say UniServer XP? Best regards for the input
-
Entering Select Options Disabled True or False?
Heinz Stapff replied to Heinz Stapff's topic in MySQL
megan It is actually a phpMyAdmin question, thanks for the response will check the links out. Again, I thought that 'Mastering phpMyAdmin, did not address the Attributes field itself and infact did not address others and their elements. I had to go back to HTML web search w3.school to find the answer. select options HTML disabled = "disabled" Dom and disabled = "true/false" for ie6 actually can be written without the '=' equals sign like so < option disabled > Go Figure </option>//it works < option selected > Go Figure, it works to </option> How it applies to php? echo "<option " . $row['Disabled(Enum field name)','0(from Enum field in phpMyAdmin?)'] . "> Go Figure </option>"; echo "<option " . $row['Selected(Enum field name)','0(from Enum field in phpMyAdmin?)'] . "> Go Figure </option>"; Entering the Enum field attributes can be confussing because the word 'attributes' should be 'elements' so entering the 'elements for the Attribute field' could be addressed? 'STARTING phpMyAdmin' would be a better title but they would have failed in that they never cover the complete list of inputs in phMyAdmin. Or the 'elements' for each. -
I want to controll Selected=, Disabled=, title= for each Option in a select tag. The sql looking like this echo "<option selected='".$row['Csel','0']."'value='".$row['Cval','0']."' disabled='" .$row['CAble','0']."'>".$row['Color','0']."</option>"; echo "<option selected='".$row['Csel','1']."'value='".$row['Cval','1']."' disabled='" .$row['CAble','1']."'>".$row['Color','1']."</option>"; echo "<option selected='".$row['Csel','2']."'value='".$row['Cval','2']."' disabled='" .$row['CAble','2']."'>".$row['Color','2']."</option>"; echo "<option selected='".$row['Csel','3']."'value='".$row['Cval','3']."' disabled='" .$row['CAble','3']."'>".$row['Color','3']."</option>"; echo "<option selected='".$row['Csel','4']."'value='".$row['Cval','4']."' disabled='" .$row['CAble','4']."'>".$row['Color','4']."</option></select><br/><br/>"; Column:Csel Enum: 'True','False','False','False' produces error selected= for all options Column:CAble Enum: 'False','True','True','True' produces error disabled= for all options Column:Cval Enum: 'Silver','Gold','White Gold','Platinum' value= for all options Column:Color Enum: 'Silver','Gold','White Gold','Platinum' Text for all options sugested on web Column:Csel; Type:Tinyint; Enum:'0','1','1','1' Atributes:unsigned? I was thinking Enum:'Yes','No','No','No' with Type:Text or varchar( ) but can't see that selected='Yes' or selected='No' works in HTML, would be nice but there are one too many geniuses involved. The idea is to control all options from one column/field. Column:Ctitle; Type:Varch(10); Enum:'5% Discount','6% Discount','8% Discount','15% Discount' Like to know what works. Have saved most columns/fields varchar() blank but need to change to test the php page. Any help greatly appreciated. PS. megan, the Mastering phpMyAdmin.pdf is very skimpy on the Attributes:Unsigned etc; mysql input for fields and uses the term through out without addressing the input and it's elements at all?
-
Thanks Megan, followed link but didn't see 'Noteab'. In an case 'Notepad' was at the top of the list and they say it can be tweeked. I'm guessing that I will have to investigate that but the files I was looking at contain squares every every sentence and unless word wrap is set they appear as three lines etc. I don't beleive these are the files I should be editing anyway even if search companion found them, correct me if I'm wrong.
-
Thanks guys, I guess I just wanted to be ahead of the game. I already have the Html built so was hopefull that I had the latest Version of UniServer installed before I moved it to the server. I downloaded Orion and booted it up and was amazed that the start up screen required a username and password and that I couldn't access any of the my.ini files to make changes directly through phpmyadmin because you are blocked by the login screen and it turns out that you can't just access the .ini files and make changes comfortably because they are hard to view in notepad and rely heavely on library folders etc.
-
Building My first MySQL database for wholesale products site using myphpAdmin. I'm guessing that as I am trying to work from the server to create the site I should have a list of the html elements in the HTML pages in the order of the HTML set in a table. Something like this; SITE_TABLE FIELDS:|Id---------|HTML_Id|HTML_NAME|Description|Classes|Onchange|Image--------|Function_name -------------------------------------------------------------------------------------------------------------------- TYPE:--|PRIMARY+|INDEX---|UNIQUE-----|Text( )-----|ENUM---|INT+-----|VARCHAR( )---|VARCHAR( ) --------------------------------------------------------------------------------------------------------------------- EXPL:--|List of------|#logo--|logo---------|Site Head--|.logo----|counter--|logo.jpg-------|logoOnchange ---------|HTML-------|or-------|or------------|Company--|.Article--|eg. How-|in images-----|in scripts ---------|elements--|id=" "?-|name=" "?-|Logo--------|.Prod----|many-----|sunglasses--|Index.js ---------|in order on|syntax?|syntax?----|as is--------|Drop-----|times-----|syntax?-------|syntax? ---------|page-------|question|question--|Shown-----|down----|occur-----|question------|question The syntax? questions are there to ask what form I should use to use php to manipulate the site best like activating '../scripts/index.js/logoOnchange or loading ../images/sources/logo.jpg. sql Escape characters might be applied to the fields like ../%images/%sources/%logo.jpg to overide sql statement for field input values as long as the images and scripts can be loaded using that value. Again, I don't know what is best for php use. Almost imposable to type. Any advice greatly appreciated
-
Yes BobS I did that yesterday and was wondering what happens when PHP 8.0 comes, they already have eAccelerator.dll .9.0 etc. This time the php-x.x.x folder was completely different. The system folder was just named PHP which makes it easier to change it to the old version by renaming it php-x.x.x and the new version just PHP but there is no way to find the version number of the old PHP? Well I could not find it so I named it PHP2. I guess that just replacing the eAccelerator should clinch that. I have to checkout it's version on Orion.